From 4d327409755a4b6094053cebc14edcece737e952 Mon Sep 17 00:00:00 2001 From: Hunter Jozwiak Date: Thu, 6 Nov 2025 12:24:28 -0500 Subject: [PATCH] Experimental way to launch a game with GDB. Useful for when you do indeed need a debugger. --- audiogame-manager.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index b8ceaab..caf0ddc 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -569,7 +569,21 @@ game_launcher() { fi process_launcher_flags custom_launch_parameters - wine start /d "${game[1]%\\*}" "${game[1]##*\\}" /realtime + if [[ "$debugGdb" == "1" ]]; then + echo "Starting GDB server for debugging..." + echo "Connect from another terminal with:" + echo " gdb" + echo " (gdb) target remote localhost:1234" + echo "" + echo "Press Ctrl+C to stop the debugger." + echo "" + # Change to game directory before launching + pushd "$(winepath "${game[1]%\\*}")" > /dev/null + winedbg --gdb "${game[1]##*\\}" + popd > /dev/null + else + wine start /d "${game[1]%\\*}" "${game[1]##*\\}" /realtime + fi fi exit 0 } @@ -662,6 +676,7 @@ declare -A command=( [C]="Clear the cache. All game installers will be deleted." [D]="Create desktop shortcut. You can launch audiogame-manager from the desktop or applications menu." [d]="Debug mode, wine will be much more verbose when games are installed with this flag." + [g]="Debug with GDB. Launch game with winedbg --gdb for step-through debugging." [h]="This help screen." [i]="Install games." [I:]="Noninteractive game installation." @@ -692,6 +707,9 @@ while getopts "${args}" i ; do unset WINEDEBUG game_installer ;; + g) + debugGdb=1 + game_launcher;; h) help;; i) game_installer;; I)