You can always enter numbers in octal, decimal, or hexadecimal in
GDB by the usual conventions: octal numbers begin with
0
, decimal numbers end with .
, and hexadecimal numbers
begin with 0x
. Numbers that begin with none of these are, by
default, entered in base 10; likewise, the default display for
numbers--when no particular format is specified--is base 10. You can
change the default base for both input and output with the set
radix
command.
set input-radix
base
set radix 012 set radix 10. set radix 0xa
sets the base to decimal. On the other hand, set radix 10
leaves the radix unchanged no matter what it was.
set output-radix
base
show input-radix
show output-radix