summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2020-10-10 11:28:02 +0300
committerAndreas Kling <kling@serenityos.org>2020-12-14 23:05:53 +0100
commita8cfb83d087be60ea59be13441b17c3a977de55a (patch)
tree0ee389e311f76b923689274140e6b28362400b98 /Applications
parent0974991d051517802ad319022d9e46313d6cd4d4 (diff)
downloadserenity-a8cfb83d087be60ea59be13441b17c3a977de55a.zip
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.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Debugger/main.cpp4
1 files 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()) {