From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10443 invoked by alias); 26 Jun 2012 22:12:17 -0000 Received: (qmail 10435 invoked by uid 22791); 26 Jun 2012 22:12:16 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Jun 2012 22:12:04 +0000 Received: by vcbfl10 with SMTP id fl10so348288vcb.0 for ; Tue, 26 Jun 2012 15:12:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=iCy3mwtcZO/rkVKteYTUMoZ96AVEyEiMrYZFaoKJCm4=; b=HIPfmmWE1b8mYidygeVOKgoRWAfplB4vbkVaXhACFw/9KEjkH8rgOO6PXRbOUx6mjI eODiDsgevrbsGmVzWCGyhIQOCZlMEPuD96aiyGqmPZ7iEZZNQyj7+E9DRF0F4210wA1x w5gCmgcrT/mO2e419W8H9tZIKc6AJwUCAze74JUtEr/miEgHD4oLxQQxtmvXaK2rH0fY l4Z6/V2oXoLT/2R86TPID2u8RADF982TakUOYSnCz7ec7ZZZvHhTAApJkyTqO1Q8heZt vzBd6iIUoez9hbcRUyO7JGgJzZgJDSrsaR+tnpFocad7he/d66b40zjSekJpaa1IS3xT 92Ug== Received: by 10.220.149.148 with SMTP id t20mr12324140vcv.12.1340748722981; Tue, 26 Jun 2012 15:12:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.149.148 with SMTP id t20mr12324133vcv.12.1340748722883; Tue, 26 Jun 2012 15:12:02 -0700 (PDT) Received: by 10.52.26.132 with HTTP; Tue, 26 Jun 2012 15:12:02 -0700 (PDT) In-Reply-To: References: <87k3yzgtjo.fsf@fleche.redhat.com> Date: Tue, 26 Jun 2012 22:12:00 -0000 Message-ID: Subject: Re: [RFC - Python Scripting] Add 'end' attribute to gdb.Symtab_and_line From: Doug Evans To: Siva Chandra Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQmMT/HcrozchNEB7ULzmdk8PgRo9+tZhJYHJb51Ba333inpSwRn3JKe0X3/khrWiAPvJH3IeNPKNNrK7DDUghtugKnzDvOn4Jn+oZoghOkHQGKBGNDZNUsfN46ysIvvZyOMYXUbXssY8kc2Y2CtKiimmah3CWEoPjHhD5XlXXqiCBCYCuK55tdkyR5jtJRUjJiuQt1h 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-06/txt/msg00817.txt.bz2 On Sun, Jun 24, 2012 at 10:02 AM, Siva Chandra wro= te: > On Fri, Jun 22, 2012 at 10:42 PM, Tom Tromey wrote: >> It seems that sal->end can be =3D=3D 0. >> For example I think gdb.decode_line can create sals like this. >> In this case I think "- 1" will yield weird results. >> Perhaps a None return would be better? > > Done. The patch is attached. > > 2012-06-24 =A0Siva Chandra Reddy =A0 > > =A0 =A0 =A0 =A0New attribute 'last' for gdb.Symtab_and_line. > =A0 =A0 =A0 =A0* NEWS (Python Scripting): Add entry about the new attribu= te. > =A0 =A0 =A0 =A0* python/py-symtab.c (salpy_get_last): New function which > =A0 =A0 =A0 =A0implements the get method for the 'last' attribute of > =A0 =A0 =A0 =A0gdb.Symtab_and_line. > =A0 =A0 =A0 =A0(sal_object_getset): Add entry for the 'last' attribute. > > =A0 =A0 =A0 =A0doc/ > =A0 =A0 =A0 =A0* gdb.texinfo (Symbol Tables In Python): Add description a= bout > =A0 =A0 =A0 =A0the new 'last' attribute of gdb.Symtab_and line. > > =A0 =A0 =A0 =A0testsuite/ > =A0 =A0 =A0 =A0* gdb.python/py-symtab.exp: Add tests to test the new attr= ibute > =A0 =A0 =A0 =A0'last' of gdb.Symtab_and_line. > =A0 =A0 =A0 =A0* gdb.python/py-symbol.c: Move break point comment to enab= le > =A0 =A0 =A0 =A0testing of gdb.Symtab_and_line.last. > > Thanks, > Siva Chandra LGTM.