Skip to content

Commit

Permalink
target/breakpoints: Fix 'orig_instr' output
Browse files Browse the repository at this point in the history
The 'orig_instr' information of software breakpoints is incorrect
because buf_to_hex_str() expects the length of the buffer to be
converted in bits and not bytes.

Change-Id: I9a9ed383a8c25200d461b899749d5259ee4c6e3d
Signed-off-by: Marc Schink <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/8218
Reviewed-by: Antonio Borneo <[email protected]>
Tested-by: jenkins
  • Loading branch information
zapb-0 authored and borneoa committed Aug 2, 2024
1 parent 5b3d503 commit d5adab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/target/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3921,7 +3921,7 @@ static int handle_bp_command_list(struct command_invocation *cmd)
while (breakpoint) {
if (breakpoint->type == BKPT_SOFT) {
char *buf = buf_to_hex_str(breakpoint->orig_instr,
breakpoint->length);
breakpoint->length * 8);
command_print(cmd, "Software breakpoint(IVA): addr=" TARGET_ADDR_FMT ", len=0x%x, orig_instr=0x%s",
breakpoint->address,
breakpoint->length,
Expand Down

0 comments on commit d5adab6

Please sign in to comment.