From a8cfb83d087be60ea59be13441b17c3a977de55a Mon Sep 17 00:00:00 2001 From: Itamar Date: Sat, 10 Oct 2020 11:28:02 +0300 Subject: [PATCH] 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. --- Applications/Debugger/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Applications/Debugger/main.cpp b/Applications/Debugger/main.cpp index 1a3d332a71..6e70d19cfc 100644 --- a/Applications/Debugger/main.cpp +++ b/Applications/Debugger/main.cpp @@ -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()) {