From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7877 invoked by alias); 1 Feb 2012 11:50:16 -0000 Received: (qmail 7869 invoked by uid 22791); 1 Feb 2012 11:50:15 -0000 X-SWARE-Spam-Status: No, hits=-6.6 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; Wed, 01 Feb 2012 11:50:01 +0000 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 q11Bo0xc002744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 1 Feb 2012 06:50:00 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q11BnwH5018449; Wed, 1 Feb 2012 06:49:59 -0500 Message-ID: <4F2926E6.5090609@redhat.com> Date: Wed, 01 Feb 2012 11:50:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Doug Evans CC: Tom Tromey , gdb-patches@sourceware.org Subject: Re: RFA: fix PR python/13599 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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-02/txt/msg00005.txt.bz2 On 01/31/2012 11:22 PM, Doug Evans wrote: > On Tue, Jan 31, 2012 at 2:01 PM, Tom Tromey wrote: >> This fixes PR python/13599. >> >> The bug is that there is no way to get the line number in the source at >> which a symbol was defined, even though gdb tracks this information. >> >> This patch changes gdb.Symbol to add a new 'line' attribute. >> >> This requires a doc review. >> >> Built and regtested on x86-64 Fedora 15. >> >> Tom >> >> 2012-01-31 Tom Tromey >> >> PR python/13599: >> * python/py-symbol.c (sympy_line): New function. >> (symbol_object_getset): Add "line". > 'tis ok with me. > > One comment though. > The first thing that come to mind, as a user, is "Well, if I can get > the line number from the symbol, why do I have to look elsewhere to > get the file name?" > The reason is an internal gdb implementation detail that we expose in > python. IWBN if symbol tables were more nebulous entities - we might > want the freedom to change them a bit. [Not that we necessarily can > change things now, but I think it's something we should keep in mind.] There is no reason why we cannot export the filename as an API in the py-symbol. The 1:1 mapping of API to GDB modulefunctionality is not even a weak rule imo. If it makes sense from an API point of view, no reason why we should not export it in py-symbol regardless of where the information comes from in GDB. Cheers, Phil