Skip to content

Commit d390f25

Browse files
committed
Allow 0x-prefixed addresses to -trigger addr:
Signed-off-by: Tudor Brindus <[email protected]>
1 parent 44599da commit d390f25

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/elf.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ let find_selection t name : Selection.t option =
218218
in
219219
let find_addr_selection name =
220220
Option.bind
221-
(Option.try_with (fun () -> Int.Hex.of_string name))
221+
(Option.try_with (fun () ->
222+
let name =
223+
if String.is_prefix ~prefix:"0x" name then String.drop_prefix name 2 else name
224+
in
225+
Int.Hex.of_string name))
222226
~f:(fun address -> Some (Selection.Address { address; name }))
223227
in
224228
let find_symbol_selection name =

0 commit comments

Comments
 (0)