From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19857 invoked by alias); 11 Mar 2011 16:09:26 -0000 Received: (qmail 19846 invoked by uid 22791); 11 Mar 2011 16:09:23 -0000 X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL 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; Fri, 11 Mar 2011 16:09:19 +0000 Received: by vxc38 with SMTP id 38so3345063vxc.0 for ; Fri, 11 Mar 2011 08:09:17 -0800 (PST) Received: by 10.52.176.199 with SMTP id ck7mr7360876vdc.139.1299859757081; Fri, 11 Mar 2011 08:09:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.185.140 with HTTP; Fri, 11 Mar 2011 08:08:57 -0800 (PST) From: Kevin Pouget Date: Fri, 11 Mar 2011 16:09:00 -0000 Message-ID: Subject: GDB Python API: stop/continue after breakpoint To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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-03/txt/msg00087.txt.bz2 Hello, I've tried the GDB python interface today, which seems quite efficient, but there is one important thing I couldn't figure out by myself: how to restart GDB when a[n internal] breakpoint is hit ? from the testsuite I've got this code: def breakpoint_stop_handler (event): if (isinstance (event, gdb.StopEvent)): print "event type: stop" if (isinstance (event, gdb.BreakpointEvent)): print "stop reason: breakpoint" print "breakpoint number: %s" % (event.breakpoint.number) if ( event.inferior_thread is not None) : print "thread num: %s" % (event.inferior_thread.num); else: print "all threads stopped" gdb.events.stop.connect (breakpoint_stop_handler) which where I get the notification of the stop, but I'd to be able to tell GDB something like enum bpstat_what_main_action { /* Remove breakpoints, single step once, then put them back in and go back to what we were doing. It's possible that this should be removed from the main_action and put into a separate field, to more cleanly handle BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE. */ BPSTAT_WHAT_SINGLE, /* Stop silently. */ BPSTAT_WHAT_STOP_SILENT, /* Stop and print. */ BPSTAT_WHAT_STOP_NOISY, ... } to continue silently, stop silently or print the breakpoint hit. is it possible at this stage ? Thanks, Kevin