From 086baaf1346f07acfb6708e8c6cb79274241488b Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 15 Oct 2019 16:18:26 +0100 Subject: 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 --- gdb/NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/NEWS') diff --git a/gdb/NEWS b/gdb/NEWS index dc63179..96ea666 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -77,6 +77,9 @@ ** The new function gdb.lookup_static_symbol can be used to look up symbols with static linkage. + ** The new function gdb.lookup_static_symbols can be used to look up + all static symbols with static linkage. + ** gdb.Objfile has new methods 'lookup_global_symbol' and 'lookup_static_symbol' to lookup a symbol from this objfile only. -- cgit v1.1