History

Update stack walk in debugger to show source file name. Format function name to include full type signature.

arr committed 9 years ago

Commit 2b710fc1 parent 72f24ec3 files · +173 −13Browse files

Showing the changes to src/exec/debugger.cpp (1 of 3 files). Show all

Unified · Split

src/exec/debugger.cpp+23−3
@@ -749,6 +749,20 @@ namespace · 748 unmodified lines
749 << console_modifiers::reset_all;749 << console_modifiers::reset_all;
750 }750 }
751 751
752 void set_value_cmd(const std::vector<std::string> &args, dbg_cmd_cxt_t &)
753 {
754 if (args.size() == 0)
755 {
756 // [TODO] Print all options current state
757 return;
758 }
759 else if (0 == args[0].compare("help"))
760 {
761 // [TODO] Print help for 'set' command
762 return;
763 }
764 }
765
752 const dbg_cmd_t cmds[] =766 const dbg_cmd_t cmds[] =
753 {767 {
754 { "c", "Continue", nullptr, nullptr, cmd_continue },768 { "c", "Continue", nullptr, nullptr, cmd_continue },
@@ -766,6 +780,8 @@ namespace · 11 unmodified lines
766 { "~", "Switch to thread", "~ [0-9]+", "~ 42", cmd_switchthread },780 { "~", "Switch to thread", "~ [0-9]+", "~ 42", cmd_switchthread },
767 { "d", "Disassemble the next/previous N instructions (default N = 4)", "d (-?[0-9]+)?", "d, d -4, d 5", cmd_disassemble },781 { "d", "Disassemble the next/previous N instructions (default N = 4)", "d (-?[0-9]+)?", "d, d -4, d 5", cmd_disassemble },
768 { "x", "Examine memory", "x [mp|fp] [0-9]+ ([0-9]+)?", "x mp 3, x fp 20 6", cmd_examine },782 { "x", "Examine memory", "x [mp|fp] [0-9]+ ([0-9]+)?", "x mp 3, x fp 20 6", cmd_examine },
783
784 //{ "set" , "Set a debugger option", "set [ _a-zA-Z0-9]*", "'set help' for available options", set_value_cmd },
769 { "?", "Print help", nullptr, nullptr, cmd_help },785 { "?", "Print help", nullptr, nullptr, cmd_help },
770 786
771 // Undocumented commands787 // Undocumented commands
@@ -882,11 +898,15 @@ std::string debugger::resolve_function_source_line(std::shared_ptr<const vm_modu · 110 unmodified lines
882 // Position the debug symbol iterator898 // Position the debug symbol iterator
883 d.set_current_pc(pc);899 d.set_current_pc(pc);
884 900
901 const auto src = d.current_source_location();
902
885 ss << m->module_name->str()903 ss << m->module_name->str()
886 << '!'904 << '!'
887 << d.current_function_name()905 << d.current_function_name(symbol::function_name_format_t::declaration)
888 << ' '906 << " at "
889 << d.current_source_location().begin_line;907 << d.get_source_by_id(src.source_id)
908 << ':'
909 << src.begin_line;
890 910
891 return ss.str();911 return ss.str();
892}912}