1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 01:05:08 +00:00

Debugger: Fix CLI parsing of breakpoint addresses

Previously, we only accepted addresses that started with digits
'0'-'9', which was not correct because we expect addresses to be in
base 16.
We now expect addresses to be written with '0x' prefix, e.g 0xdeadbeef.
This commit is contained in:
Itamar 2020-10-10 11:28:02 +03:00 committed by Andreas Kling
parent 0974991d05
commit a8cfb83d08

View file

@ -128,8 +128,8 @@ static bool handle_breakpoint_command(const String& command)
return false;
}
breakpoint_address = result.value();
} else if ((argument[0] >= '0' && argument[0] <= '9')) {
breakpoint_address = strtoul(argument.characters(), nullptr, 16);
} else if ((argument.starts_with("0x"))) {
breakpoint_address = strtoul(argument.characters() + 2, nullptr, 16);
} else {
auto symbol = g_debug_session->elf().find_demangled_function(argument);
if (!symbol.has_value()) {