From 1191ab9500520b512e2074fe0244b38d8ddc424d Mon Sep 17 00:00:00 2001 From: Itamar Date: Mon, 13 Apr 2020 19:21:24 +0300 Subject: [PATCH] Debugger: Print where we're stopped at For some reaason, some magic is required to convince gcc to give us the implementation for "__cxa_demangle" Thanks @predmond for finding this simpler form of magic :) --- Applications/Debugger/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Applications/Debugger/main.cpp b/Applications/Debugger/main.cpp index eeb09ffa99..eab93e621c 100644 --- a/Applications/Debugger/main.cpp +++ b/Applications/Debugger/main.cpp @@ -95,6 +95,7 @@ void handle_print_registers(const PtraceRegisters& regs) bool handle_disassemble_command(const String& command, void* first_instruction) { + (void)demangle("foo"); auto parts = command.split(' '); size_t number_of_instructions_to_disassemble = 5; if (parts.size() == 2) { @@ -212,7 +213,8 @@ int main(int argc, char** argv) ASSERT(optional_regs.has_value()); const PtraceRegisters& regs = optional_regs.value(); - printf("Program is stopped at: 0x%x\n", regs.eip); + auto symbol_at_ip = g_debug_session->elf().symbolicate(regs.eip); + printf("Program is stopped at: 0x%x (%s)\n", regs.eip, symbol_at_ip.characters()); for (;;) { auto command = get_command(); bool success = false;