diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-10-15 16:18:26 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-11-10 21:35:32 +0000 |
commit | 086baaf1346f07acfb6708e8c6cb79274241488b (patch) | |
tree | 0dff00a4c5da670a23ed348dd13c5475bd342289 /gdb/python/python.c | |
parent | 09ff83af3c8558594bd31bfaf4ed7daadf4f707d (diff) | |
download | binutils-086baaf1346f07acfb6708e8c6cb79274241488b.zip binutils-086baaf1346f07acfb6708e8c6cb79274241488b.tar.gz binutils-086baaf1346f07acfb6708e8c6cb79274241488b.tar.bz2 |
gdb/python: Introduce gdb.lookup_static_symbols
If gdb.lookup_static_symbol is going to return a single symbol then it
makes sense (I think) for it to return a context sensitive choice of
symbol, that is the global static symbol that would be visible to the
program at that point.
However, if the user of the python API wants to instead get a
consistent set of global static symbols, no matter where they stop,
then they have to instead consider all global static symbols with a
given name - there could be many. That is what this new API function
offers, it returns a list (possibly empty) of all global static
symbols matching a given name (and optionally a given symbol domain).
gdb/ChangeLog:
* python/py-symbol.c (gdbpy_lookup_static_symbols): New
function.
* python/python-internal.h (gdbpy_lookup_static_symbols):
Declare new function.
* python/python.c (python_GdbMethods): Add
gdb.lookup_static_symbols method.
* NEWS: Mention gdb.lookup_static_symbols.
gdb/testsuite/ChangeLog:
* gdb.python/py-symbol.exp: Add test for
gdb.lookup_static_symbols.
gdb/doc/ChangeLog:
* python.texi (Symbols In Python): Add documentation for
gdb.lookup_static_symbols.
Change-Id: I1153b0ae5bcbc43b3dcf139043c7a48bf791e1a3
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r-- | gdb/python/python.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index ddf0e72..f94214e 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1994,6 +1994,10 @@ Return the symbol corresponding to the given name (or None)." }, METH_VARARGS | METH_KEYWORDS, "lookup_static_symbol (name [, domain]) -> symbol\n\ Return the static-linkage symbol corresponding to the given name (or None)." }, + { "lookup_static_symbols", (PyCFunction) gdbpy_lookup_static_symbols, + METH_VARARGS | METH_KEYWORDS, + "lookup_static_symbols (name [, domain]) -> symbol\n\ +Return a list of all static-linkage symbols corresponding to the given name." }, { "lookup_objfile", (PyCFunction) gdbpy_lookup_objfile, METH_VARARGS | METH_KEYWORDS, |