1

This answer describes how you can manipulate the debugging environment when running gdb interactively. The specific suggestion is to use the following command aid in catching a Heisenbug.

(gdb) set disable-randomization off

However, when using gdb from the command-line, you lose a lot of amenities that you would have with a graphical debugging front end (such as nemiver or kdbg). I am using kdbg, which allows me to specify a command-line for use when invoking gdb. Is there a command-line argument that achieves the same results as the interactive command shown above?

S.S. Anne
  • 15,171
  • 8
  • 38
  • 76
Brent Bradburn
  • 51,587
  • 17
  • 154
  • 173
  • Try putting `set disable-randomization off` in a file and add the arguments `-x path-to-that-file` to the **How to invoke GDB** option. gdb does take a `-ex "command"` argument, but that'll only work with single-word commands, since kdbg apparently (I looked at version 2.5.4) splits the gdb invocation line into separate argv strings based solely on the presence of blanks without regard to traditional shell quoting. – Mark Plotnick Jul 12 '15 at 23:55
  • 1
    Also try putting them in `~/.gdbinit`. – Tom Tromey Jul 13 '15 at 02:42

0 Answers0