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