From 1c7d9f96cb5c91e43d6ed9fb9081b9c94d06e548 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Dec 2024 17:36:09 -0700 Subject: Use 'flags' when expanding symtabs in gdbpy_lookup_static_symbols This changes gdbpy_lookup_static_symbols to pass the 'flags' parameter to expand_symtabs_matching. This should refine the search somewhat. Note this is "just" a performance improvement, as the loop over symtabs already checks 'flags'. v2 also removes 'SEARCH_GLOBAL_BLOCK' and updates py-symbol.exp to verify that this works properly. Thanks to Tom for this insight. Co-Authored-By: Tom de Vries --- gdb/testsuite/gdb.python/py-symbol-3.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gdb/testsuite/gdb.python/py-symbol-3.c (limited to 'gdb/testsuite/gdb.python/py-symbol-3.c') diff --git a/gdb/testsuite/gdb.python/py-symbol-3.c b/gdb/testsuite/gdb.python/py-symbol-3.c new file mode 100644 index 0000000..6a95193 --- /dev/null +++ b/gdb/testsuite/gdb.python/py-symbol-3.c @@ -0,0 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2024 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* A global 'rr' -- used for testing that lookup_static_symbols does + not find it. */ +int __attribute__ ((used)) rr = 107; -- cgit v1.1