From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28759 invoked by alias); 9 Sep 2013 19:01:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28746 invoked by uid 89); 9 Sep 2013 19:01:02 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2013 19:01:02 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r89J10ke012930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Sep 2013 15:01:00 -0400 Received: from localhost.localdomain (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r89J0wCf003096; Mon, 9 Sep 2013 15:00:59 -0400 Message-ID: <522E1AE9.6080601@redhat.com> Date: Mon, 09 Sep 2013 19:01:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [python][patch] Add temporary breakpoint features to Python breakpoints. References: <522D9D57.5030309@redhat.com> <87r4cxj0i3.fsf@fleche.redhat.com> In-Reply-To: <87r4cxj0i3.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00309.txt.bz2 On 09/09/13 19:47, Tom Tromey wrote: >>>>>> "Phil" == Phil Muldoon writes: > > Phil> This patch allows Python breakpoints to be made temporary on > Phil> creation. It adds an optional argument, and keyword: "temporary". > > Phil> OK? > > Thanks, Phil. > > Phil> 2013-09-09 Phil Muldoon > > Phil> * python/py-breakpoint.c (bppy_get_temporary): New function. > Phil> (bppy_init): New keyword: temporary. Parse it and set breakpoint > Phil> to temporary if True. > > Is there a PR associated with this? > I thought there was, but I didn't check. I will double-check. > Phil> +@defvar Breakpoint.temporary > Phil> +This attribute indicates whether the breakpoint was created as a > Phil> +temporary breakpoint. Temporary breakpoints are automatically deleted > Phil> +after that breakpoint has been hit. Access to this attribute, and all > Phil> +other attributes and functions other than the @code{is_valid} > Phil> +function, will result in an error after the breakpoint has been hit > Phil> +(as it has been automatically deleted). This attribute is not > Phil> +writable. I ended up rewriting this paragraph several times to try to explain hit ;) In the end I deleted as we already use "hit" as a verb in the API (and in the documentation). (IE, hit_count). I could not come up with a good turn of phrase without turning the paragraph of the constructor for breakpoints into a mess of technical discussion with how GDB handles stop events for breakpoints. What do you think we should use here? Breakpoints with a disposition of del, or del_at_next_stop are deleted when the when the inferior stops. But good point, there could possibly be a case where the "stop" and disposition may conflict. (When the stop callbacks are executed, the inferior is stopped by the kernel, but the state has not yet changed in the GDB record keeping). I will double check. > I think it is worth spelling out what "hit" means. > In particular I was wondering how it interacts with the "stop" method. > > Phil> + if (self_bp->bp->disposition == disp_del || > Phil> + self_bp->bp->disposition == disp_del_at_next_stop) > > "||" at the wrong spot. > > Phil> + static char *keywords[] = { "spec", "type", "wp_class", "internal", "temporary", NULL }; > > This line is too long. > > Phil> + if (temporary) > > temporary != NULL OK thanks for catching these. Cheers, Phil