Wednesday, February 19, 2014

Stuck in a full screen game when debugging?

Sometimes we do stupid things.

Like stepping over a 'create window' call (e.g. SDL_CreateWindow) in a game where the parameters set full screen. Or adding a breakpoint and running when the game is configured to run full screen. Then you are left with nothing ... no debugger, everything is stuck and quit doesn't appear to work. So you try other stuff: Adding an extra monitor doesn't work, neither does command/alt tabbing or force quitting (option/alt-command-esc on the Mac).

But a power down seems silly.

When working on the Mac, I always have ssh (Remote Login) enabled. So, assuming you know the IP (I also have a reserved IP at home, which I can lookup by logging into the router) then you can go to another computer and do the following:

ssh x.x.x.x
ps -A | grep gdb
kill -9 zzzzz

  • x.x.x.x is your IP address.
  • The ps line will show you the debuggers running, and this grep.
  • zzzzz should be replaced with the process ID number at the start of the line produced by ps for your debugger.

And breath...


Post a Comment

<< Home

Newer›  ‹Older