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
749749 << console_modifiers::reset_all;
750750 }
751751
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+
752766 const dbg_cmd_t cmds[] =
753767 {
754768 { "c", "Continue", nullptr, nullptr, cmd_continue },
@@ -766,6 +780,8 @@ namespace · 11 unmodified lines
766780 { "~", "Switch to thread", "~ [0-9]+", "~ 42", cmd_switchthread },
767781 { "d", "Disassemble the next/previous N instructions (default N = 4)", "d (-?[0-9]+)?", "d, d -4, d 5", cmd_disassemble },
768782 { "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 },
769785 { "?", "Print help", nullptr, nullptr, cmd_help },
770786
771787 // Undocumented commands
@@ -882,11 +898,15 @@ std::string debugger::resolve_function_source_line(std::shared_ptr<const vm_modu · 110 unmodified lines
882898 // Position the debug symbol iterator
883899 d.set_current_pc(pc);
884900
901+ const auto src = d.current_source_location();
902+
885903 ss << m->module_name->str()
886904 << '!'
887− << d.current_function_name()
888− << ' '
889− << d.current_source_location().begin_line;
905+ << d.current_function_name(symbol::function_name_format_t::declaration)
906+ << " at "
907+ << d.get_source_by_id(src.source_id)
908+ << ':'
909+ << src.begin_line;
890910
891911 return ss.str();
892912 }