From a74154769cf170d40d215f3367865d1577315904 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 21 Jun 2021 15:30:20 +0200 Subject: [PATCH] [gdb/symtab] Keep track of interesting_symbols in partial_symtab --- gdb/psympriv.h | 8 ++++++++ gdb/psymtab.c | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/psympriv.h b/gdb/psympriv.h index adbced84b71..597d12084eb 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -328,6 +328,14 @@ struct partial_symtab struct partial_symtab **dependencies = nullptr; + std::set interesting_symbols; + + void note_interesting_symbol (partial_symbol *psym) + { + auto it = sect_off.find (psym); + interesting_symbols.emplace (it->second); + } + int number_of_dependencies = 0; /* Global symbol list. This list will be sorted after readin to diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 64f092150d5..635cebcde2d 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1100,7 +1100,12 @@ recursively_search_psymtabs { /* Found a match, so notify our caller. */ result = PST_SEARCHED_AND_FOUND; - keep_going = 0; + if (lazy_expand_symtab_p) + ps->note_interesting_symbol (*psym); + else + { + keep_going = 0; + } } } psym++; -- 2.47.2