From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10957 invoked by alias); 19 May 2011 18:34:29 -0000 Received: (qmail 10812 invoked by uid 22791); 19 May 2011 18:34:28 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 18:34:14 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4JIYDUs018454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 May 2011 14:34:13 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4JIYCg6004280; Thu, 19 May 2011 14:34:13 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p4JIYC4Q007575; Thu, 19 May 2011 14:34:12 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id BC7DD37918A; Thu, 19 May 2011 12:34:11 -0600 (MDT) From: Tom Tromey To: Kevin Pouget Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Handle multiple breakpoint hits in Python interface References: Date: Thu, 19 May 2011 18:34:00 -0000 In-Reply-To: (Kevin Pouget's message of "Fri, 22 Apr 2011 05:33:13 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 X-SW-Source: 2011-05/txt/msg00452.txt.bz2 >>>>> "Kevin" =3D=3D Kevin Pouget writes: Kevin> following the discussion on Kevin> http://sourceware.org/ml/gdb/2011-04/msg00131.html, here is a patch Kevin> which allows Python scripts to know that several breakpoints (with t= he Kevin> same PC) where hit during the "stop" event callback. Kevin> What do you think about it ? It seems like a reasonable idea. I think we can't just replace the "breakpoint" attribute with "breakpoints", since this is going to ship in 7.3, and we don't want to break backward compatibility. IIRC, you don't yet have your paperwork in place, so this can't go in too quickly. This still needs a doc review. Kevin> +@defivar BreakpointEvent breakpoints Kevin> +A tuple containing references to the breakpoints (type Not technically a tuple, the code makes a list. Saying "sequence" would be ok. Kevin> +=C2=A0 /*Add any breakpoint set at this location to the list.=C2=A0= */ Space after the first "*". Kevin> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (list =3D= =3D NULL) Kevin> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = list =3D PyList_New (0); You must check for failure here. Kevin> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (PyList_A= ppend (list, (PyObject *) current_bs-> breakpoint_at->py_bp_object)) Kevin> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = goto fail; In the fail case, nothing frees 'list'. Tom