Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Doug Evans <dje@google.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: RFA: fix PR python/13599
Date: Wed, 01 Feb 2012 11:50:00 -0000	[thread overview]
Message-ID: <4F2926E6.5090609@redhat.com> (raw)
In-Reply-To: <CADPb22RaFYaB0XGxCiftTAshX1S2PGVuYaAvB6Ky45MFz6cg6Q@mail.gmail.com>

On 01/31/2012 11:22 PM, Doug Evans wrote:
> On Tue, Jan 31, 2012 at 2:01 PM, Tom Tromey<tromey@redhat.com>  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<tromey@redhat.com>
>>
>>         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


  parent reply	other threads:[~2012-02-01 11:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 22:04 Tom Tromey
     [not found] ` <CADPb22RaFYaB0XGxCiftTAshX1S2PGVuYaAvB6Ky45MFz6cg6Q@mail.gmail.com>
2012-02-01  8:32   ` Kevin Pouget
2012-02-01 16:08     ` Tom Tromey
2012-02-01 11:50   ` Phil Muldoon [this message]
2012-02-07 18:05 ` Tom Tromey
2012-02-07 18:47   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F2926E6.5090609@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox