Experimental way to launch a game with GDB.

Useful for when you do indeed need a debugger.
This commit is contained in:
2025-11-06 12:24:28 -05:00
parent fa597a9ca3
commit 4d32740975

View File

@@ -569,8 +569,22 @@ game_launcher() {
fi fi
process_launcher_flags process_launcher_flags
custom_launch_parameters custom_launch_parameters
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 wine start /d "${game[1]%\\*}" "${game[1]##*\\}" /realtime
fi fi
fi
exit 0 exit 0
} }
@@ -662,6 +676,7 @@ declare -A command=(
[C]="Clear the cache. All game installers will be deleted." [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]="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." [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." [h]="This help screen."
[i]="Install games." [i]="Install games."
[I:]="Noninteractive game installation." [I:]="Noninteractive game installation."
@@ -692,6 +707,9 @@ while getopts "${args}" i ; do
unset WINEDEBUG unset WINEDEBUG
game_installer game_installer
;; ;;
g)
debugGdb=1
game_launcher;;
h) help;; h) help;;
i) game_installer;; i) game_installer;;
I) I)