diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-20 17:23:40 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-20 17:23:45 -0600 |
commit | 7b249e470a82063605c3789f4b2d0378400423de (patch) | |
tree | 748b61bd197aa3beff13a90cea71bd40da24e052 /gdb/dbxread.c | |
parent | d1eef86d12f5aa2f8461add1180df9db4b59a39d (diff) | |
download | gdb-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/dbxread.c')
-rw-r--r-- | gdb/dbxread.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index e0cc259..a6f44d5 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -298,8 +298,8 @@ static void add_old_header_file (const char *, int); static void add_this_object_header_file (int); -static legacy_psymtab *start_psymtab (struct objfile *, const char *, - CORE_ADDR, int); +static legacy_psymtab *start_psymtab (psymtab_storage *, struct objfile *, + const char *, CORE_ADDR, int); /* Free up old header file tables. */ @@ -1291,7 +1291,7 @@ read_dbx_symtab (minimal_symbol_reader &reader, if (!pst) { - pst = start_psymtab (objfile, + pst = start_psymtab (partial_symtabs, objfile, namestring, valu, first_so_symnum * symbol_size); pst->dirname = dirname_nso; @@ -1467,7 +1467,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, VAR_DOMAIN, LOC_STATIC, data_sect_index, psymbol_placement::STATIC, - nlist.n_value, psymtab_language, objfile); + nlist.n_value, psymtab_language, + partial_symtabs, objfile); continue; case 'G': @@ -1477,7 +1478,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, VAR_DOMAIN, LOC_STATIC, data_sect_index, psymbol_placement::GLOBAL, - nlist.n_value, psymtab_language, objfile); + nlist.n_value, psymtab_language, + partial_symtabs, objfile); continue; case 'T': @@ -1494,14 +1496,16 @@ read_dbx_symtab (minimal_symbol_reader &reader, pst->add_psymbol (gdb::string_view (sym_name, sym_len), true, STRUCT_DOMAIN, LOC_TYPEDEF, -1, psymbol_placement::STATIC, - 0, psymtab_language, objfile); + 0, psymtab_language, + partial_symtabs, objfile); if (p[2] == 't') { /* Also a typedef with the same name. */ pst->add_psymbol (gdb::string_view (sym_name, sym_len), true, VAR_DOMAIN, LOC_TYPEDEF, -1, psymbol_placement::STATIC, - 0, psymtab_language, objfile); + 0, psymtab_language, + partial_symtabs, objfile); p += 1; } } @@ -1513,7 +1517,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, pst->add_psymbol (gdb::string_view (sym_name, sym_len), true, VAR_DOMAIN, LOC_TYPEDEF, -1, psymbol_placement::STATIC, - 0, psymtab_language, objfile); + 0, psymtab_language, + partial_symtabs, objfile); } check_enum: /* If this is an enumerated type, we need to @@ -1574,7 +1579,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, pst->add_psymbol (gdb::string_view (p, q - p), true, VAR_DOMAIN, LOC_CONST, -1, psymbol_placement::STATIC, 0, - psymtab_language, objfile); + psymtab_language, + partial_symtabs, objfile); /* Point past the name. */ p = q; /* Skip over the value. */ @@ -1592,7 +1598,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, pst->add_psymbol (gdb::string_view (sym_name, sym_len), true, VAR_DOMAIN, LOC_CONST, -1, psymbol_placement::STATIC, 0, - psymtab_language, objfile); + psymtab_language, + partial_symtabs, objfile); continue; case 'f': @@ -1648,7 +1655,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, VAR_DOMAIN, LOC_BLOCK, SECT_OFF_TEXT (objfile), psymbol_placement::STATIC, - nlist.n_value, psymtab_language, objfile); + nlist.n_value, psymtab_language, + partial_symtabs, objfile); continue; /* Global functions were ignored here, but now they @@ -1707,7 +1715,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, VAR_DOMAIN, LOC_BLOCK, SECT_OFF_TEXT (objfile), psymbol_placement::GLOBAL, - nlist.n_value, psymtab_language, objfile); + nlist.n_value, psymtab_language, + partial_symtabs, objfile); continue; /* Two things show up here (hopefully); static symbols of @@ -1902,10 +1911,11 @@ read_dbx_symtab (minimal_symbol_reader &reader, (normal). */ static legacy_psymtab * -start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow, - int ldsymoff) +start_psymtab (psymtab_storage *partial_symtabs, struct objfile *objfile, + const char *filename, CORE_ADDR textlow, int ldsymoff) { - legacy_psymtab *result = new legacy_psymtab (filename, objfile, textlow); + legacy_psymtab *result = new legacy_psymtab (filename, partial_symtabs, + objfile, textlow); result->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct symloc); @@ -2028,7 +2038,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, for (i = 0; i < num_includes; i++) { legacy_psymtab *subpst = - new legacy_psymtab (include_list[i], objfile); + new legacy_psymtab (include_list[i], partial_symtabs, objfile); subpst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, struct symloc); |