diff options
author | Tom Tromey <tom@tromey.com> | 2020-05-27 11:13:48 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-27 11:13:48 -0400 |
commit | 5717c425a62c8e15a5936acdfa2bac2732aeb9b4 (patch) | |
tree | 86cb17e5e89da416acd4bc0addb8e13bca248c5d /gdb/psympriv.h | |
parent | 45940949265417e8a21b5936e906cf24a3177001 (diff) | |
download | gdb-5717c425a62c8e15a5936acdfa2bac2732aeb9b4.zip gdb-5717c425a62c8e15a5936acdfa2bac2732aeb9b4.tar.gz gdb-5717c425a62c8e15a5936acdfa2bac2732aeb9b4.tar.bz2 |
Add "objfile" parameter to two partial_symtab methods
This series will cause partial symtabs to be shared across objfiles.
However, full symtabs and symbols will still be objfile-dependent, so
will be expanded separately for each objfile. So, a debug info reader
will need to know which objfile to consult when expanding a partial
symtab.
This patch adds an objfile parameter to the two relevant methods of
partial_symtab. Current implementations simply ignore them.
gdb/ChangeLog:
* psymtab.c (partial_map_expand_apply)
(psym_find_pc_sect_compunit_symtab, psym_lookup_symbol)
(psym_lookup_global_symbol_language)
(psymtab_to_symtab, psym_find_last_source_symtab, dump_psymtab)
(psym_print_stats, psym_expand_symtabs_for_function)
(psym_map_symbol_filenames, psym_map_matching_symbols)
(psym_expand_symtabs_matching)
(partial_symtab::read_dependencies, maintenance_info_psymtabs)
(maintenance_check_psymtabs): Update.
* psympriv.h (struct partial_symtab) <readin_p,
get_compunit_symtab>: Add objfile parameter.
(struct standard_psymtab) <readin_p, get_compunit_symtab>:
Likewise.
* dwarf2/read.c (struct dwarf2_include_psymtab) <readin_p,
get_compunit_symtab>: Likewise.
(dwarf2_psymtab::expand_psymtab): Pass objfile argument.
Change-Id: I3f0b26787c3e78f7fb78b9fc011d91fb8690f3a0
Diffstat (limited to 'gdb/psympriv.h')
-rw-r--r-- | gdb/psympriv.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 6f0307e..4622be3 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -147,13 +147,16 @@ struct partial_symtab void expand_dependencies (struct objfile *); /* Return true if the symtab corresponding to this psymtab has been - readin. */ - virtual bool readin_p () const = 0; + read in in the context of this objfile. */ + virtual bool readin_p (struct objfile *) const = 0; - /* Return a pointer to the compunit allocated for this source file. - Return nullptr if !readin or if there was no symtab. */ - virtual struct compunit_symtab *get_compunit_symtab () const = 0; + /* Return a pointer to the compunit allocated for this source file + in the context of this objfile. + Return nullptr if the compunit was not read in or if there was no + symtab. */ + virtual struct compunit_symtab *get_compunit_symtab + (struct objfile *) const = 0; /* Return the raw low text address of this partial_symtab. */ CORE_ADDR raw_text_low () const @@ -319,14 +322,12 @@ struct standard_psymtab : public partial_symtab { } - bool readin_p () const override + bool readin_p (struct objfile *) const override { return readin; } - /* Return a pointer to the compunit allocated for this source file. - Return nullptr if !readin or if there was no symtab. */ - struct compunit_symtab *get_compunit_symtab () const override + struct compunit_symtab *get_compunit_symtab (struct objfile *) const override { return compunit_symtab; } |