GTK+ FAQ
<<< Previous | Development with GTK+: the begining | Next >>>

# I try to debug my GTK+ application with gdb, but it hangs my X server when I hit some breakpoint. Any Idea? [GTK 2.x]

From Federico Mena Quintero:

"X is not locked up. It is likely that you are hitting a breakpoint inside a callback that is called from a place in Gtk that has a mouse grab."

"Run your program with the `--sync` option; it will make it easier to debug. Also, you may want to use the console for running the debugger, and just let the program run in another console with the X server."

Eric Mouw had another solution:

"An old terminal connected to an otherwise unused serial port is also great for debugging X programs. Old vt100/vt220 terminals are dirt cheap but a bit hard to get (here in The Netherlands, YMMV)."

Another option is to run your application on Xnest. Xnest is an X server which displays its root window in a regular window of another X server. A pointer grab on the Xnest display will not affect the GUI of your debugger running on your regular X server.

    Xnest :1
    twm -display :1
    myapp --display=:1

<<< Previous | Home | Next >>>
I want to add some configure stuff, how could I do this? [GTK 2.x] | Up | Development with GTK+: general questions