views:

80

answers:

1

In a kde3 game called ksirtet (a tetris clone) when playing against a computer the human player cannot move the tetris piece left/right. I'm trying to fix it but cannot debug in gdb. After the line "kapp->exec()" gdb stops responding, the game runs and I cannot input any command do gdb to see what's going on. So the question is about debugging kde event loop and any help would be much appreciated.

+1  A: 

Generally speaking, you wouldn't want to debug into the event loop unless necessary. That said, you probably want to scatter a sprinkling of breakpoints at places of interest, especially where you think the code should be running after the key press. If you try to step through the event loop code from the beginning, you'll run into problems trying to interact with the program you want to debug.

Additionally, if I recall correctly, you can control-c in gdb, and it will interrupt the program at its current point of execution, and restore control to you. If you really want to see what is going on, try queueing up some events in the game (mash a bunch of keys quickly), then interrupt gdb and step through what the program is doing in response to those events. You'll have to be very quick, though, as the event loop processing on a modern computer is very fast.

Caleb Huitt - cjhuitt
Thanky you for your response. I'm fighting against gdb and this ctrl-c trick, but no luck so far.
Humberto Pinheiro