title: Debugging GTK Event callbacks
body: <p>I'm trying to debug for the first time a gtk code and actually, I want to debug a callback function for <code>key-press-event</code> so I set a breakpoint with <code>gdb</code> and when it hits the breakpoint, the whole desktop evirement is freezing (I'm running under gnome-shell) it seems that the graphic envirement is waiting for the event to finish.</p>
  
  <p>I got some idea that didn't worked : </p>
  
  <p>The first attempts was to assign some <code>gdb</code> commands to the breakpoint :</p>
  
  <pre><code>(gdb) break on_key_press_callback
  (gdb) commands
        &gt; back trace
        &gt; next
        &gt; next
        &gt; next
        &gt; continue
        &gt; end
  </code></pre>
  
  <p>but I don't know why, only the <code>back trace</code> command is executed, and then freeze.</p>
  
  <p>The second attempt was to debug remotely using <code>gdbserver</code> and <code>gdb</code> on <code>tty1</code> (no graphigs to freeze :) )  I was able to send commands like <code>next</code>  and <code>step</code> after the breakpoint but there was nothing to see (can't <code>list</code> code, inspect the stack, ect ...)</p>
  
  <p>So any good tips to be able to debug in such situations ? </p>
  
  <p>Thanks</p>