From 2906593ffecef89f8d64e0f1ca21494be71d0ebd Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Tue, 30 Jul 2019 11:04:37 -0500 Subject: [PR/24474] Add gdb.lookup_static_symbol to the python API Similar to lookup_global_symbol, except that it checks the STATIC_SCOPE. gdb/ChangeLog: 2019-07-30 Christian Biesinger PR/24474: Add a function to lookup static variables. * NEWS: Mention this new function. * python/py-symbol.c (gdbpy_lookup_static_symbol): New function. * python/python-internal.h (gdbpy_lookup_static_symbol): New function. * python/python.c (python_GdbMethods): Add new function. gdb/doc/ChangeLog: 2019-07-30 Christian Biesinger * python.texi (Symbols In Python): Document new function gdb.lookup_static_symbol. gdb/testsuite/ChangeLog: 2019-07-30 Christian Biesinger * gdb.python/py-symbol.c: Add a static variable and one in an anonymous namespace. * gdb.python/py-symbol.exp: Test gdb.lookup_static_symbol. --- gdb/python/python.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index 96bee7c..162470d 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1978,6 +1978,10 @@ a boolean indicating if name is a field of the current implied argument\n\ METH_VARARGS | METH_KEYWORDS, "lookup_global_symbol (name [, domain]) -> symbol\n\ Return the symbol corresponding to the given name (or None)." }, + { "lookup_static_symbol", (PyCFunction) gdbpy_lookup_static_symbol, + METH_VARARGS | METH_KEYWORDS, + "lookup_static_symbol (name [, domain]) -> symbol\n\ +Return the static-linkage symbol corresponding to the given name (or None)." }, { "lookup_objfile", (PyCFunction) gdbpy_lookup_objfile, METH_VARARGS | METH_KEYWORDS, -- cgit v1.1