aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-20 17:23:40 -0600
committerTom Tromey <tom@tromey.com>2021-03-20 17:23:45 -0600
commit7b249e470a82063605c3789f4b2d0378400423de (patch)
tree748b61bd197aa3beff13a90cea71bd40da24e052 /gdb/dwarf2
parentd1eef86d12f5aa2f8461add1180df9db4b59a39d (diff)
downloadgdb-7b249e470a82063605c3789f4b2d0378400423de.zip
gdb-7b249e470a82063605c3789f4b2d0378400423de.tar.gz
gdb-7b249e470a82063605c3789f4b2d0378400423de.tar.bz2
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 <tom@tromey.com> * 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. <add_psymbol>: 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) <partial_symtabs>: 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.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c26
-rw-r--r--gdb/dwarf2/read.h6
2 files changed, 22 insertions, 10 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index c4acf29..4271398 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -6237,8 +6237,10 @@ read_abbrev_offset (dwarf2_per_objfile *per_objfile,
/* A partial symtab that is used only for include files. */
struct dwarf2_include_psymtab : public partial_symtab
{
- dwarf2_include_psymtab (const char *filename, struct objfile *objfile)
- : partial_symtab (filename, objfile)
+ dwarf2_include_psymtab (const char *filename,
+ psymtab_storage *partial_symtabs,
+ struct objfile *objfile)
+ : partial_symtab (filename, partial_symtabs, objfile)
{
}
@@ -6291,10 +6293,13 @@ private:
static void
dwarf2_create_include_psymtab (dwarf2_per_bfd *per_bfd,
- const char *name, dwarf2_psymtab *pst,
+ const char *name,
+ dwarf2_psymtab *pst,
+ psymtab_storage *partial_symtabs,
struct objfile *objfile)
{
- dwarf2_include_psymtab *subpst = new dwarf2_include_psymtab (name, objfile);
+ dwarf2_include_psymtab *subpst
+ = new dwarf2_include_psymtab (name, partial_symtabs, objfile);
if (!IS_ABSOLUTE_PATH (subpst->filename))
subpst->dirname = pst->dirname;
@@ -7549,7 +7554,8 @@ create_partial_symtab (dwarf2_per_cu_data *per_cu,
struct objfile *objfile = per_objfile->objfile;
dwarf2_psymtab *pst;
- pst = new dwarf2_psymtab (name, objfile, per_cu);
+ pst = new dwarf2_psymtab (name, per_objfile->per_bfd->partial_symtabs.get (),
+ objfile, per_cu);
pst->psymtabs_addrmap_supported = true;
@@ -8663,7 +8669,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
&objfile->objfile_obstack);
psymbol.ginfo.set_linkage_name (pdi->linkage_name);
}
- cu->per_cu->v.psymtab->add_psymbol (psymbol, *where, objfile);
+ cu->per_cu->v.psymtab->add_psymbol
+ (psymbol, *where, per_objfile->per_bfd->partial_symtabs.get (),
+ objfile);
}
}
@@ -21972,8 +21980,10 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
psymtab_include_file_name (lh, file_entry, pst,
comp_dir, &name_holder);
if (include_name != NULL)
- dwarf2_create_include_psymtab (cu->per_objfile->per_bfd,
- include_name, pst, objfile);
+ dwarf2_create_include_psymtab
+ (cu->per_objfile->per_bfd, include_name, pst,
+ cu->per_objfile->per_bfd->partial_symtabs.get (),
+ objfile);
}
}
else
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 6cfbee9..82ab387 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -406,9 +406,11 @@ dwarf2_per_objfile *get_dwarf2_per_objfile (struct objfile *objfile);
/* A partial symtab specialized for DWARF. */
struct dwarf2_psymtab : public partial_symtab
{
- dwarf2_psymtab (const char *filename, struct objfile *objfile,
+ dwarf2_psymtab (const char *filename,
+ psymtab_storage *partial_symtabs,
+ struct objfile *objfile,
dwarf2_per_cu_data *per_cu)
- : partial_symtab (filename, objfile, 0),
+ : partial_symtab (filename, partial_symtabs, objfile, 0),
per_cu_data (per_cu)
{
}