10

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.

2 Answers2

21

You just need to add the hex prefix:

b *0x9048f23
Igor Skochinsky
  • 23,838
  • 1
  • 67
  • 104
3

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.)

Matthew Slattery
  • 43,223
  • 7
  • 96
  • 117