From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26978 invoked by alias); 3 Apr 2012 12:15:26 -0000 Received: (qmail 26964 invoked by uid 22791); 3 Apr 2012 12:15:23 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Tue, 03 Apr 2012 12:15:07 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q33CF4mD022192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Apr 2012 08:15:04 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q33CF2cC010818; Tue, 3 Apr 2012 08:15:02 -0400 Message-ID: <4F7AE9C6.7050708@redhat.com> Date: Tue, 03 Apr 2012 12:15:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Kevin Pouget CC: Tom Tromey , gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: [PATCH] Add bp_location to Python interface References: <83r4z8eqoa.fsf@gnu.org> <87zkaxn9zf.fsf@fleche.redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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: 2012-04/txt/msg00029.txt.bz2 > On Fri, Mar 30, 2012 at 9:51 PM, Tom Tromey > wrote: > On 04/03/2012 11:34 AM, Kevin Pouget wrote: > the idea here was that a tuple is not mutable, whereas a list is -- > () vs. []. I've removed the tuple, although although I'm not sure > when I'm supposed to use the List or the Tuple. This was my comment way back when, so apologies for the conflicting comments. I prefer to return non-mutable objects when they reflect an internal state of GDB; just to provide a hint that the data exchange is one-way -- that changing the list won't change state back in GDB (hence the immutable tuple). Though I suspect it does not really matter -- the user can quite easily turn a tuple into a list. As for returning a tuple versus a list, again, I guess it does not really matter; the tuple idiom was just my convention (though with very large lists, the conversion to a tuple might be expensive). > 2012-03-04 Kevin Pouget > > Add bp_location to Python interface > * Makefile.in (SUBDIR_PYTHON_OBS): Add py-bploc.o > (SUBDIR_PYTHON_SRCS): Add python/py-bploc.c > Add build rule for this file. > * breakpoint.h (struct bploc_object): Forward declaration. > (struct bp_location): Add py_bploc_obj. > * python/py-bploc.c: New file. > * python/py-breakpoint.c (bppy_locations): New function. > (breakpoint_object_methods): New method binding: locations(). > * python/python-internal.h (bploc_object): New typedef. > (bplocation_to_bplocation_object): New prototype. > (gdbpy_initialize_bplocation): Likewise. > > doc/ > Add bp_location to Python interface > * gdb.texinfo (Breakpoints In Python): Document > gdb.Breakpoint.locations and gdb.BpLocation. > > > testsuite/ > Add bp_location to Python interface > * gdb.python/py-breakpoint.exp: Test gdb.BpLocation. Thanks for this, Cheers Phil