title: GDB python Breakpoint class interface and conditional breakpoints
body: <p>I am using the GDB Python interface to handle Breakpoints</p>
  
  <pre><code>import gdb
  class MyBP(gdb.Breakpoint):
      def stop(self):
          print("stop called "+str(self.hit_count))
          return True
  bp = MyBP("test.c:22")
  </code></pre>
  
  <p>This works as expected. The hit_count is increased after the "stop" method returns.</p>
  
  <p>Now when I want to use a conditional breakpoint:</p>
  
  <pre><code>bp.condition="some_value==2"
  </code></pre>
  
  <p>it is not working as expected. The stop method is always executed regardless whether the condition is true or false. If the stop method returns "True" the breakpoint will only halt the program if the condition is also true. The hit_count is increased after the Stop method returns and the condition holds.</p>
  
  <p>So it seems as if GDB is only applying the condition check after the Stop method was called. </p>
  
  <p>How can I ensure that the Stop method is only called when the condition holds?</p>