diff options
author | Christian Biesinger <cbiesinger@google.com> | 2019-06-25 15:45:41 -0500 |
---|---|---|
committer | Christian Biesinger <cbiesinger@google.com> | 2019-07-24 19:02:50 -0500 |
commit | 442853af244e0352956a5d91ad5e169a85b58710 (patch) | |
tree | 96e61428ae50146e38826671e4c25becf679c298 /gdb/symtab.c | |
parent | 75b493d0f95c6037753e0d250e1ecc6fe8d46c38 (diff) | |
download | gdb-442853af244e0352956a5d91ad5e169a85b58710.zip gdb-442853af244e0352956a5d91ad5e169a85b58710.tar.gz gdb-442853af244e0352956a5d91ad5e169a85b58710.tar.bz2 |
Allow passing a block to lookup_global_symbol_from_objfile
This has no behavior change in itself, but allows a future patch
to add a function to the Python API to look up symbols in the
static block.
gdb/ChangeLog:
2019-07-24 Christian Biesinger <cbiesinger@google.com>
* compile/compile-object-load.c (compile_object_load): Pass GLOBAL_SCOPE.
* solib-spu.c (spu_lookup_lib_symbol): Pass GLOBAL_SCOPE.
* solib-svr4.c (elf_lookup_lib_symbol): Pass GLOBAL_SCOPE.
* symtab.c (lookup_global_symbol_from_objfile): Add a scope parameter.
* symtab.h (lookup_global_symbol_from_objfile): Likewise.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 5b8bfc1..87a0c8e 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2224,15 +2224,18 @@ lookup_symbol_in_block (const char *name, symbol_name_match_type match_type, struct block_symbol lookup_global_symbol_from_objfile (struct objfile *main_objfile, + enum block_enum block_index, const char *name, const domain_enum domain) { + gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK); + for (objfile *objfile : main_objfile->separate_debug_objfiles ()) { struct block_symbol result - = lookup_symbol_in_objfile (objfile, GLOBAL_BLOCK, name, domain); + = lookup_symbol_in_objfile (objfile, block_index, name, domain); - if (result.symbol != NULL) + if (result.symbol != nullptr) return result; } |