diff options
author | Doug Evans <xdje42@gmail.com> | 2014-11-18 08:08:00 -0800 |
---|---|---|
committer | Doug Evans <xdje42@gmail.com> | 2014-11-18 08:08:00 -0800 |
commit | f194fefb5e345e8c3b55de1d957bc6d7b95667ad (patch) | |
tree | dcf1e5db1ae8b7e731859f490e23f06155c666d0 /gdb/dwarf2read.c | |
parent | 6937bb54a9c3ddc7ba330bc18af76f8dbe856ac3 (diff) | |
download | gdb-f194fefb5e345e8c3b55de1d957bc6d7b95667ad.zip gdb-f194fefb5e345e8c3b55de1d957bc6d7b95667ad.tar.gz gdb-f194fefb5e345e8c3b55de1d957bc6d7b95667ad.tar.bz2 |
The result of symtab expansion is always a primary symtab.
gdb/ChangeLog:
* dwarf2read.c (dw2_instantiate_symtab): Add assert.
(dw2_lookup_symbol): Remove unnecessary test for primary symbol table.
* psymtab.c (lookup_symbol_aux_psymtabs): Ditto.
(psymtab_to_symtab): Add comment and assert.
(map_matching_symbols_psymtab): Remove unnecessary test for
non-primary symtab.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9762d98..d929017 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2660,6 +2660,10 @@ dw2_instantiate_symtab (struct dwarf2_per_cu_data *per_cu) process_cu_includes (); do_cleanups (back_to); } + + /* The result of symtab expansion is always the primary symtab. */ + gdb_assert (per_cu->v.quick->symtab->primary); + return per_cu->v.quick->symtab; } @@ -3611,17 +3615,13 @@ dw2_lookup_symbol (struct objfile *objfile, int block_index, { struct symbol *sym = NULL; struct symtab *stab = dw2_instantiate_symtab (per_cu); + const struct blockvector *bv = BLOCKVECTOR (stab); + struct block *block = BLOCKVECTOR_BLOCK (bv, block_index); /* Some caution must be observed with overloaded functions and methods, since the index will not contain any overload information (but NAME might contain it). */ - if (stab->primary) - { - const struct blockvector *bv = BLOCKVECTOR (stab); - struct block *block = BLOCKVECTOR_BLOCK (bv, block_index); - - sym = block_lookup_symbol (block, name, domain); - } + sym = block_lookup_symbol (block, name, domain); if (sym && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0) { |