From 1be61a7f1b82e88d3a8d418a57a1280ce4c52510 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 3 Jan 2016 17:12:23 +0100 Subject: [PATCH] Added filename (if available) to debug status if state is stopped --- src/debug.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index f706e32..50b4b5a 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -2,8 +2,8 @@ #include #ifdef __APPLE__ #include -#include #endif +#include #include #include "terminal.h" #include "filesystem.h" @@ -137,16 +137,23 @@ void Debug::start(const std::string &command, const boost::filesystem::path &pat auto status=event_desc.substr(pos+3); if(state==lldb::StateType::eStateStopped) { char buffer[100]; - auto n=process->GetSelectedThread().GetStopDescription(buffer, 100); + auto thread=process->GetSelectedThread(); + auto n=thread.GetStopDescription(buffer, 100); if(n>0) status+=" ("+std::string(buffer, n<=100?n:100)+")"; + auto line_entry=thread.GetSelectedFrame().GetLineEntry(); + if(line_entry.IsValid()) { + lldb::SBStream stream; + line_entry.GetFileSpec().GetDescription(stream); + status +=" - "+boost::filesystem::path(stream.GetData()).filename().string()+":"+std::to_string(line_entry.GetLine()); + } } status_callback(status); } if(state==lldb::StateType::eStateStopped) { - auto line_entry=process->GetSelectedThread().GetSelectedFrame().GetLineEntry(); if(stop_callback) { + auto line_entry=process->GetSelectedThread().GetSelectedFrame().GetLineEntry(); if(line_entry.IsValid()) { lldb::SBStream stream; line_entry.GetFileSpec().GetDescription(stream);