From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1551 invoked by alias); 21 Apr 2011 13:01:54 -0000 Received: (qmail 1543 invoked by uid 22791); 21 Apr 2011 13:01:53 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Apr 2011 13:01:39 +0000 Received: by vxk20 with SMTP id 20so1654756vxk.0 for ; Thu, 21 Apr 2011 06:01:39 -0700 (PDT) Received: by 10.220.187.4 with SMTP id cu4mr2574061vcb.58.1303390899079; Thu, 21 Apr 2011 06:01:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.61.6 with HTTP; Thu, 21 Apr 2011 06:01:19 -0700 (PDT) In-Reply-To: References: From: Kevin Pouget Date: Thu, 21 Apr 2011 13:01:00 -0000 Message-ID: Subject: Re: GDB Python API: stop/continue after breakpoint To: Tom Tromey Cc: pmuldoon@redhat.com, gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00130.txt.bz2 > Kevin> * in event.stop.connect() that's possible, but I can't > Kevin> `gdb.execute("continue")' the execution because I would miss any > Kevin> "non-python" reasons to stop (ie, a user-breakpoint, a signal ...) > > I think you should be able to examine the stop event object to see what > caused the event. =A0If the event is a gdb.BreakpointEvent, and if > event.breakpoint is your breakpoint, then do what you want. I'm afraid that's impossible to do it with the current implementation, look: def handle_double_stop(event): print "Stop event: ", event.breakpoint.number gdb.events.stop.connect(handle_double_stop) (gdb) break main Breakpoint 1 (gdb) break main Breakpoint 2 (gdb) run Stop event: 1 ... as far as I know, there is no 'easy' way to know that Bp 2 was hit as w= ell