Skip to content

Commit

Permalink
Fix -trigger addr:... selections
Browse files Browse the repository at this point in the history
The hex string parsing was reversed.

Signed-off-by: Tudor Brindus <[email protected]>
  • Loading branch information
Xyene committed Jan 10, 2024
1 parent 79a3bba commit 2fa1573
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/elf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ let find_selection t name : Selection.t option =
| None -> None
| Some address -> Some (Selection.Address { address; name })))
in
let find_addr_selection name =
let find_addr_selection addr =
Option.bind
(Option.try_with (fun () ->
let name =
if String.is_prefix ~prefix:"0x" name then String.drop_prefix name 2 else name
let addr =
if not (String.is_prefix ~prefix:"0x" addr) then "0x" ^ addr else addr
in
Int.Hex.of_string name))
Int.Hex.of_string addr))
~f:(fun address -> Some (Selection.Address { address; name }))
in
let find_symbol_selection name =
Expand Down

0 comments on commit 2fa1573

Please sign in to comment.