This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][gdb/python] Add interface to access minimal_symbols
- From: Matt Rice <ratmice at gmail dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>
- Cc: tdevries at suse dot de, Simon Marchi <simon dot marchi at ericsson dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Phil Muldoon <pmuldoon at redhat dot com>, Tom Tromey <tom at tromey dot com>
- Date: Tue, 27 Nov 2018 10:10:04 -0800
- Subject: Re: [PATCH][gdb/python] Add interface to access minimal_symbols
- References: <20181004211115.GA31056@delia> <39c4336d-c749-6f79-5a29-0b764fc4935e@ericsson.com> <211c4746-389a-93b7-faf9-c8f9b6245541@suse.de> <583cbe68c00a387d0664f918f078e9a8@polymtl.ca>
On Mon, Nov 26, 2018 at 1:31 PM Simon Marchi <simon.marchi@polymtl.ca> wrote:
>
> On 2018-10-31 12:59, Tom de Vries wrote:
> > AFAIU, the purpose of repr is to print a unique representation, and
> > distinct symbols can have the same name, so I went for:
> > ...
> > <gdb.MinSymbol name=%s filename=%s objfile=%s>
> > ...
> > for local symbols, dropping the filename=%s part for local symbols.
>
> Thanks, that make sense.
>
> The patch looks good to me, but since adding some new Python API is kind
> of a big deal (we are stuck with it after), I'd really like if Phil
> and/or Tom could give their opinions. Especially since I remember Phil
> mentioning he had other plans for minimal symbols...
has been a long time since i've looked at the edge cases of minsym
filenames, and objfiles.
but I seem to recall the filename component being basically useless,
and the objfile is not necessarily correct,
and lacking the ODR/one definition rule, the name/filename/objfile is
not even necessarily unique.
perhaps a better uniqueness would be the address of the symbol?
i.e. even though the objfile may be wrong, the offset from the
previous objfile should still be unique
Anyhow if all of this is still the case, it gives me some pause that
exposing python seems a bit scary.
there were odd symbols in gdb associated with the wrong objfile coming
from libdecnumber,
of this sort last time saw it, or perhaps it was it the library linked
after libdecnumber?