Search code examples
gdb

Can a gdb backtrace somehow omit the argument values?


I'm working on some modifications to DynamoRIO, which uses byte* for pointers into the code cache. When I'm debugging in gdb, the backtrace command thinks every byte* is null terminated, so it prints this massive spew of byte values all over the backtrace. I need a way to either:

  1. Turn off the display of arguments in the backtrace, or
  2. Change the way gdb prints a byte* (preferably just the pointer value as a hex number)

Solution

    1. Use "set print frame-arguments none" to turn off display of arguments in backtraces. See GDB Manual: Print Settings.
    2. You can also write a pretty printer in Python and register it with GDB to change how byte * are displayed.