Next: ABI, Previous: Screen Size, Up: Controlling GDB
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 neither begin with `0' or `0x', nor end with a `.' 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 commands described below.
set input-radix
baseset input-radix 012 set input-radix 10. set input-radix 0xa
sets the input base to decimal. On the other hand, `set input-radix 10' leaves the input radix unchanged, no matter what it was, since `10', being without any leading or trailing signs of its base, is interpreted in the current radix. Thus, if the current radix is 16, `10' is interpreted in hex, i.e. as 16 decimal, which doesn't change the radix.
set output-radix
baseshow input-radix
show output-radix
set radix
[base]show radix
set radix
sets the radix of input and output to
the same base; without an argument, it resets the radix back to its
default value of 10.