mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
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 :)
This commit is contained in:
parent
e207de8449
commit
1191ab9500
1 changed files with 3 additions and 1 deletions
|
@ -95,6 +95,7 @@ void handle_print_registers(const PtraceRegisters& regs)
|
||||||
|
|
||||||
bool handle_disassemble_command(const String& command, void* first_instruction)
|
bool handle_disassemble_command(const String& command, void* first_instruction)
|
||||||
{
|
{
|
||||||
|
(void)demangle("foo");
|
||||||
auto parts = command.split(' ');
|
auto parts = command.split(' ');
|
||||||
size_t number_of_instructions_to_disassemble = 5;
|
size_t number_of_instructions_to_disassemble = 5;
|
||||||
if (parts.size() == 2) {
|
if (parts.size() == 2) {
|
||||||
|
@ -212,7 +213,8 @@ int main(int argc, char** argv)
|
||||||
ASSERT(optional_regs.has_value());
|
ASSERT(optional_regs.has_value());
|
||||||
const PtraceRegisters& regs = optional_regs.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 (;;) {
|
for (;;) {
|
||||||
auto command = get_command();
|
auto command = get_command();
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue