From 2dd2cd1c92d09ad96b643d2574d0dc6cd7e4841a Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 6 Nov 2014 17:27:55 -0800 Subject: [PATCH] Use ALL_PRIMARY_SYMTABS instead of ALL_SYMTABS in some places. Non-primary symtabs share the block vector with their primary symtabs. In these cases there's no need to use ALL_SYMTABS. gdb/ChangeLog: * ada-lang.c (ada_make_symbol_completion_list): Use ALL_PRIMARY_SYMTABS instead of ALL_SYMTABS. * symtab.c (lookup_objfile_from_block): Ditto. --- gdb/ChangeLog | 6 ++++++ gdb/ada-lang.c | 8 +++++--- gdb/symtab.c | 6 ++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index eb227f6866..89937e25ca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-11-06 Doug Evans + + * ada-lang.c (ada_make_symbol_completion_list): Use + ALL_PRIMARY_SYMTABS instead of ALL_SYMTABS. + * symtab.c (lookup_objfile_from_block): Ditto. + 2014-11-06 Doug Evans * gdbtypes.h (TYPE_CODE_CLASS): Delete. All uses changed to use diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 5793cd2b38..4320eec27a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -6212,9 +6212,11 @@ ada_make_symbol_completion_list (const char *text0, const char *word, } /* Go through the symtabs and check the externs and statics for - symbols which match. */ + symbols which match. + Non-primary symtabs share the block vector with their primary symtabs + so we use ALL_PRIMARY_SYMTABS here instead of ALL_SYMTABS. */ - ALL_SYMTABS (objfile, s) + ALL_PRIMARY_SYMTABS (objfile, s) { QUIT; b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK); @@ -6226,7 +6228,7 @@ ada_make_symbol_completion_list (const char *text0, const char *word, } } - ALL_SYMTABS (objfile, s) + ALL_PRIMARY_SYMTABS (objfile, s) { QUIT; b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); diff --git a/gdb/symtab.c b/gdb/symtab.c index 01ddb91f6e..e9f37bc6c3 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1549,8 +1549,10 @@ lookup_objfile_from_block (const struct block *block) return NULL; block = block_global_block (block); - /* Go through SYMTABS. */ - ALL_SYMTABS (obj, s) + /* Go through SYMTABS. + Non-primary symtabs share the block vector with their primary symtabs + so we use ALL_PRIMARY_SYMTABS here instead of ALL_SYMTABS. */ + ALL_PRIMARY_SYMTABS (obj, s) if (block == BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK)) { if (obj->separate_debug_objfile_backlink)