Browse Source

Added filename (if available) to debug status if state is stopped

merge-requests/365/head
eidheim 10 years ago
parent
commit
1be61a7f1b
  1. 13
      src/debug.cc

13
src/debug.cc

@ -2,8 +2,8 @@
#include <stdio.h> #include <stdio.h>
#ifdef __APPLE__ #ifdef __APPLE__
#include <stdlib.h> #include <stdlib.h>
#include <boost/filesystem.hpp>
#endif #endif
#include <boost/filesystem.hpp>
#include <iostream> #include <iostream>
#include "terminal.h" #include "terminal.h"
#include "filesystem.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); auto status=event_desc.substr(pos+3);
if(state==lldb::StateType::eStateStopped) { if(state==lldb::StateType::eStateStopped) {
char buffer[100]; char buffer[100];
auto n=process->GetSelectedThread().GetStopDescription(buffer, 100); auto thread=process->GetSelectedThread();
auto n=thread.GetStopDescription(buffer, 100);
if(n>0) if(n>0)
status+=" ("+std::string(buffer, n<=100?n:100)+")"; 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); status_callback(status);
} }
if(state==lldb::StateType::eStateStopped) { if(state==lldb::StateType::eStateStopped) {
auto line_entry=process->GetSelectedThread().GetSelectedFrame().GetLineEntry();
if(stop_callback) { if(stop_callback) {
auto line_entry=process->GetSelectedThread().GetSelectedFrame().GetLineEntry();
if(line_entry.IsValid()) { if(line_entry.IsValid()) {
lldb::SBStream stream; lldb::SBStream stream;
line_entry.GetFileSpec().GetDescription(stream); line_entry.GetFileSpec().GetDescription(stream);

Loading…
Cancel
Save