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 everytime....
2 Answers
set output-radix 16
(and set output-radix 10
to switch it back).
-
It too bad this does not work in practice... How do I force GDB to print in base 16?– jwwMay 17, 2017 at 4:14
-
Works for me, with
bt full
. So maybe it doesn't always work (as described in the linked question), but sometimes it works really well. Nov 4, 2017 at 19:31 -
Now open in the GDB Bugzilla: Issue 23390, GDB does not honor 'set output-radix 16'; it displays in octal. I could not take it anymore. Man I loathe working with GDB. I cringe when it is the only debugger available.– jwwJul 9, 2018 at 17:44
-
Works for me. gdb --version: GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1– PaulDec 12, 2018 at 10:47
-
Works, for me except inside strings. I'm working with UTF/ISO conversions so would be really helpful to have "unknown" chars displayed in hex instead of octal.– thoni56May 14, 2021 at 6:42