TCSGrad
TCSGrad

Reputation: 12128

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.

Upvotes: 34

Views: 20251

Answers (2)

WW00WW
WW00WW

Reputation: 437

In my machine, set output-radix 10 doesn't work, but set output-radix 0xA works.

Upvotes: 0

Matthew Slattery
Matthew Slattery

Reputation: 47058

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

Upvotes: 60

Related Questions