Skip to content

Gdb Support

360900 edited this page Aug 2, 2026 · 2 revisions

The current gdb implementation is mainly untested and might even be incomplete. Basically it seems to work correctly, but no idea how stable using gdb with wine/proton should be generally. During basic testing I got access violations e.g. with specific games. I can't tell if this could be fixed from the TinkerGame side; it might just as well be a problem with a specific Proton version, which also happens with X64dbg Any contributions are welcome as usual (I should stop mentioning this everywhere)

Configuration

The terminal used for gdb (USETERM) and its default command line option to directly start a command (TERMARGS) need to be set by the user in the Global Menu/Global Config

The default values are

  • USETERM="xterm" (likely the terminal emulator which is available on most systems)
  • TERMARGS="-e" (should be valid for most terminal emulators)

Usage

A game can automatically be started using the debugger gdb gdb either by enabling "Debug with gdb" in the Game Menu/Game Config or by simply putting the game into the "GDB" Steam Collection.

Functions

When enabled, gdb is activated like this:

  • Required files, including a start script (/dev/shm/tinkergame/gdbgamerun.sh) for the selected game are created/prepared
  • a loop waits for the game pid while the game is started via the start script above, and a minimal gdb launch script (/dev/shm/tinkergame/gdbrun.sh) using that PID is created and started when ready

If everything goes well, gdb opens in the selected terminal and attaches to the running game process. When something goes wrong, it might be worth checking whether the game can be started correctly with the auto-created start script /dev/shm/tinkergame/gdbgamerun.sh manually (to find out if the problem lies in the gdb hook or in launching the game directly)

Special thanks

The initial feature request was support for protongdb by Joshua-Ashton. I decided to not use it directly, but it helped a lot to get all bits and pieces together. The helper function by rbernon that is used in protongdb is used in TinkerGame as well, so thanks to both authors here!

Clone this wiki locally