From 5a0420113128342f605a6cbf82ccada9b69cccee Mon Sep 17 00:00:00 2001 From: eidheim Date: Sat, 9 Jan 2016 08:47:48 +0100 Subject: [PATCH] Added module filename in backtrace --- src/debug.cc | 6 ++++++ src/debug.h | 1 + src/window.cc | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index d26d31c..af354d5 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -291,6 +291,12 @@ std::vector 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; diff --git a/src/debug.h b/src/debug.h index 9ae597c..e79b2fe 100644 --- a/src/debug.h +++ b/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; diff --git a/src/window.cc b/src/window.cc index e785404..84290ca 100644 --- a/src/window.cc +++ b/src/window.cc @@ -912,12 +912,12 @@ void Window::set_menu_actions() { return; for(auto &frame: backtrace) { - std::string row; + std::string row=""+frame.module_filename+""; 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=""+Glib::Markup::escape_text(file_path)+":"+std::to_string(frame.line_nr)+" "+Glib::Markup::escape_text(frame.function_name); + row+=":"+Glib::Markup::escape_text(file_path)+":"+std::to_string(frame.line_nr)+" - "+Glib::Markup::escape_text(frame.function_name); } (*rows)[row]=frame; view->selection_dialog->add_row(row);