From 7b249e470a82063605c3789f4b2d0378400423de Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 20 Mar 2021 17:23:40 -0600 Subject: Add partial_symtabs parameter to psymtab construction functions This adds a partial_symtabs parameter to the psymtab constructors and to add_psymbol. This helps with the overall project of removing the partial symtabs from the objfile. gdb/ChangeLog 2021-03-20 Tom Tromey * xcoffread.c (xcoff_start_psymtab): Add partial_symtabs parameter. (xcoff_end_psymtab, scan_xcoff_symtab): Update. * psymtab.c (partial_symtab::partial_symtab): Add partial_symtabs parameter. (add_psymbol_to_bcache): Remove. (partial_symtab::add_psymbol): Add partial_symtabs parameter. (partial_symtab::add_psymbol, partial_symtab::partial_symtab): Likewise. * psympriv.h (partial_symtab): Add partial_symtabs parameter. : Likewise. (standard_psymtab, legacy_psymtab): Likewise. * mdebugread.c (parse_partial_symbols): Update. (handle_psymbol_enumerators): Add partial_symtabs parameter. (handle_psymbol_enumerators): Update. (new_psymtab): Add partial_symtabs parameter. * dwarf2/read.h (dwarf2_psymtab): Add partial_symtabs parameter. * dwarf2/read.c (dwarf2_include_psymtab): Add partial_symtabs parameter. (dwarf2_create_include_psymtab): Add partial_symtabs parameter. (create_partial_symtab, add_partial_symbol, dwarf_decode_lines): Update. * dbxread.c (read_dbx_symtab): Update. (start_psymtab): Add partial_symtabs parameter. (dbx_end_psymtab): Update. * ctfread.c (struct ctf_context) : New member. (ctf_psymtab): Add partial_symtabs parameter. (create_partial_symtab, ctf_psymtab_type_cb, ctf_psymtab_var_cb): Update. (scan_partial_symbols): Add partial_symtabs parameter. (scan_partial_symbols, elfctf_build_psymtabs) (ctf_psymtab_add_enums): Update. --- gdb/psympriv.h | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'gdb/psympriv.h') diff --git a/gdb/psympriv.h b/gdb/psympriv.h index b1b8027..8717bd2 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -117,14 +117,18 @@ struct partial_symtab partial symtab will also be installed using psymtab_storage::install. */ - partial_symtab (const char *filename, struct objfile *objfile) + partial_symtab (const char *filename, + psymtab_storage *partial_symtabs, + struct objfile *objfile) ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3); /* Like the above, but also sets the initial text low and text high from the ADDR argument, and sets the global- and static-offsets. */ - partial_symtab (const char *filename, struct objfile *objfile, + partial_symtab (const char *filename, + psymtab_storage *partial_symtabs, + struct objfile *objfile, CORE_ADDR addr) ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3); @@ -236,6 +240,7 @@ struct partial_symtab psymbol_placement where, CORE_ADDR coreaddr, enum language language, + psymtab_storage *partial_symtabs, struct objfile *objfile); /* Add a symbol to this partial symbol table of OBJFILE. The psymbol @@ -244,6 +249,7 @@ struct partial_symtab void add_psymbol (const partial_symbol &psym, psymbol_placement where, + psymtab_storage *partial_symtabs, struct objfile *objfile); @@ -361,14 +367,18 @@ struct partial_symtab object. */ struct standard_psymtab : public partial_symtab { - standard_psymtab (const char *filename, struct objfile *objfile) - : partial_symtab (filename, objfile) + standard_psymtab (const char *filename, + psymtab_storage *partial_symtabs, + struct objfile *objfile) + : partial_symtab (filename, partial_symtabs, objfile) { } - standard_psymtab (const char *filename, struct objfile *objfile, + standard_psymtab (const char *filename, + psymtab_storage *partial_symtabs, + struct objfile *objfile, CORE_ADDR addr) - : partial_symtab (filename, objfile, addr) + : partial_symtab (filename, partial_symtabs, objfile, addr) { } @@ -399,14 +409,18 @@ struct standard_psymtab : public partial_symtab struct legacy_psymtab : public standard_psymtab { - legacy_psymtab (const char *filename, struct objfile *objfile) - : standard_psymtab (filename, objfile) + legacy_psymtab (const char *filename, + psymtab_storage *partial_symtabs, + struct objfile *objfile) + : standard_psymtab (filename, partial_symtabs, objfile) { } - legacy_psymtab (const char *filename, struct objfile *objfile, + legacy_psymtab (const char *filename, + psymtab_storage *partial_symtabs, + struct objfile *objfile, CORE_ADDR addr) - : standard_psymtab (filename, objfile, addr) + : standard_psymtab (filename, partial_symtabs, objfile, addr) { } -- cgit v1.1