Re: Why is debugging under Linux such a pain

From: Marko Macek
Date: Sat Feb 05 2005 - 13:15:26 EST


Otto Wyss wrote:
> No
mouse or keyboard input was possible. I was completely stuck, IMO
something _never_ should happen. Who's to blame for this situation:
wxWidgets, GDB, GCC/G++, X or the Linux kernel? Or any combination?

This is by design in X. XGrabKeyboard and XGrabPointer are usually to blame. Sometimes XGrabServer (not that a normal app should ever need to call it). Often things are made worse by a toolkit that doesn't flush
Ungrab operations immediately.

Some toolkits (Qt) have a --nograb option and sometimes activate it automatically when being debugged.

A workaround:

- check out X config setting AllowDeactivateGrabs, enable it (see also AllowClosedownGrabs)

- Ctrl+Alt+Numpad-Divide will then allow you to ungrab the keyboard and mouse.

Warning: this might break your screen saver display lock function due to an incorrect design of the lock mechanism (it uses the same "X display" as your login session).

It would be nice if display lock programs used a separate X display (some kind of "virtual" display support might be nice to have, mainly for performance).

This would also be good for running games. Currently it's a a major problem when a game freezes and there is no way to get back to the desktop without killing X.

It would of course need to interact with current console switching mechanism.


Mark
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/