I develop on both mac and linux and have one network mounted home directory that is shared between them. On linux, it is useful to have the following in my .gdbinit:
set print thread-events off
Unfortunately, this errors on mac:
(gdb) set print thread-events off
Undefined set print command: "thread-events off". Try "help set print".
Is there a way in .gdbinit to have this command only executed on linux?
Create
~/.gdbinit.Linuxand~/.gdbinit.MacOS, then (bash syntax):Of course you could do the same thing with a gdb shell wrapper script instead of an alias.
Alternatively you can build
GDB7.x on both, and have full power ofPythonat your disposal.