Search code examples
cdebugginggdb

How to make GDB print out all values in hexadecimal mode?


By default, GDB always prints/displays all variables / arguments in base 10.

Is there any way to ask GDB to always use base 16 while printing anything (and turn back to default settings when I don't need that)?

I know that it can be printed by supplying the /x argument to print/display, but I don't want to do it every time.


Solution

  • set output-radix 16 (and set output-radix 10 to switch it back).