1 Feb 2012 09:31
Re: RFA: fix PR python/13599
Kevin Pouget <kevin.pouget <at> gmail.com>
2012-02-01 08:31:40 GMT
2012-02-01 08:31:40 GMT
On Wed, Feb 1, 2012 at 12:22 AM, Doug Evans <dje <at> google.com> wrote: > On Tue, Jan 31, 2012 at 2:01 PM, Tom Tromey <tromey <at> 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 <at> 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(Continue reading)
Joel> Thanks a lot for the patch. I agree that the patch looks correct,
Joel> but I'm a little confused by the name of the new function (the _full
Joel> suffix suggests that the lookup is always a full search).
Joel> Traditionally, we've used a _1 suffix instead, which is very
Joel> unimaginative and yet so convenient. I was going to change
Joel> your patch this way, but in the end, I'm just thinking I should
Joel> just add the parameter and update all callers. There are not that
Joel> many. I suspect you might have thought about this too, only to
Joel> just try the minimum change.
Joel> Would it be OK with you if I made that change instead?
I will do it, it is no big deal.
Tom
RSS Feed