Browse Source

Added module filename in backtrace

merge-requests/365/head
eidheim 10 years ago
parent
commit
5a04201131
  1. 6
      src/debug.cc
  2. 1
      src/debug.h
  3. 6
      src/window.cc

6
src/debug.cc

@ -291,6 +291,12 @@ std::vector<Debug::Frame> Debug::get_backtrace() {
auto function_name=frame.GetFunctionName();
if(function_name!=NULL)
backtrace_frame.function_name=function_name;
auto module_filename=frame.GetModule().GetFileSpec().GetFilename();
if(module_filename!=NULL) {
backtrace_frame.module_filename=module_filename;
}
auto line_entry=frame.GetLineEntry();
if(line_entry.IsValid()) {
lldb::SBStream stream;

1
src/debug.h

@ -13,6 +13,7 @@ class Debug {
public:
class Frame {
public:
std::string module_filename;
std::string file_path;
std::string function_name;
int line_nr;

6
src/window.cc

@ -912,12 +912,12 @@ void Window::set_menu_actions() {
return;
for(auto &frame: backtrace) {
std::string row;
std::string row="<i>"+frame.module_filename+"</i>";
if(frame.file_path.empty())
row=frame.function_name;
row+=" - "+frame.function_name;
else {
auto file_path=boost::filesystem::path(frame.file_path).filename().string();
row="<b>"+Glib::Markup::escape_text(file_path)+":"+std::to_string(frame.line_nr)+"</b> "+Glib::Markup::escape_text(frame.function_name);
row+=":<b>"+Glib::Markup::escape_text(file_path)+":"+std::to_string(frame.line_nr)+"</b> - "+Glib::Markup::escape_text(frame.function_name);
}
(*rows)[row]=frame;
view->selection_dialog->add_row(row);

Loading…
Cancel
Save