Skip to content

Gdb Support

frostworx edited this page Jul 2, 2022 · 2 revisions

The current gdb implementation is mainly untested and might be even 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 f.e. with specific games. Can't tell if this could be fixed from steamtinkerlaunch side, it might be as well a problem with a specific proton version, which also happens with X64dbg Any contributions 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/steamtinkerlaunch/gdbgamerun.sh) for the selected game are created/prepared
  • a loop is waiting for the game pid while the game is started via above start script and a minimal gdb launch script (/dev/shm/steamtinkerlaunch/gdbrun.sh) using that pip is created and started when ready

If everything went well, gdb is opened in the selected terminal and is attached to the running game process. When something goes wrong it might be worth to check if the game can be started correctly with the auto created start script /dev/shm/steamtinkerlaunch/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 used in protongdb is used in steamtinkerlaunch as well, so thanks to both authors here!

Clone this wiki locally