How to put a break on an instruction specified by address in gdb?
16,543
Solution 1
You just need to add the hex prefix:
b *0x9048f23
Solution 2
By default, you'll need the 0x
prefix to specify a hex number (as Igor says; +1).
If you prefer hex to be used for numeric input in general (without needing a prefix), you can change the default with:
set input-radix 16
You can also change the default output radix with set output-radix
, or both at the same time with set radix
; see the relevant section of the gdb
documentation for details.
(And you can put these commands in your ~/.gdbinit
file if you want them to apply automatically to every gdb
session.)
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on June 08, 2022Comments
-
Admin about 2 years
How can I put a break point to that instruction. When I write either:
break 9048f23 break *9048f23
It does not work.
How I can put a break point to that instruction.
9048f23: 8a 51 e6 mov 0x12(%esp),%eax
Platform: Linux.