This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb/python: Introduce gdb.lookup_all_static_symbols
- From: Simon Marchi <simark at simark dot ca>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: Christian Biesinger <cbiesinger at google dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Mon, 4 Nov 2019 13:28:39 -0500
- Subject: Re: [PATCH] gdb/python: Introduce gdb.lookup_all_static_symbols
- References: <20191015141515.GW4962@embecosm.com> <20191015164647.1837-1-andrew.burgess@embecosm.com> <32eba92d-55a9-5694-cec5-80001d8ff1ae@simark.ca> <CAPTJ0XEAtJRp=zCLWzvtMidZSXNnDkdy-OxafHeNSA3SuOVQ5w@mail.gmail.com> <20191023191354.GH4962@embecosm.com> <CAPTJ0XHC2jb3H1Ffkm=trE8S4G62w10p+wA91_dWbwg704+gzg@mail.gmail.com> <20191101115304.GR4962@embecosm.com> <d67273ab-3707-d57d-4afa-e8c4bb38bb4e@simark.ca> <20191104171204.GB11037@embecosm.com>
On 2019-11-04 12:12 p.m., Andrew Burgess wrote:
> How about I merged patches #1 and #2, but drop #3 for now? This would
> give:
>
> lookup_static_symbol - returns the global static symbol for the
> current compilation unit, or whatever else GDB can find if
> there's nothing in the current CU. This is basically inline
> with what we get from 'print symbol_name' at the CLI (if we
> limit symbol_name to just global static things).
>
> AND,
>
> lookup_static_symbols - returns the list of all global static
> symbols.
>
> We no longer have a block parameter passed to 'lookup_static_symbol',
> so hopefully and confusion can be avoided. If/when we later add a
> Python wrapper for CU we can _extend_ the API for lookup_static_symbol
> to also take a CU and so provide the "look over there" type behaviour
> in a clearer way.
>
> Would everyone be happy with this?
I certainly would, I think that brings us back to the same place we were before
it was suggested to add the block parameter, doesn't it?
But it's Christian who initially wanted to add these functions, he probably had
a particular use case in mind. It would be up to him to say if that covers that
use case or not.
Simon