aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-10 16:23:55 -0600
committerTom Tromey <tom@tromey.com>2019-01-10 07:08:14 -0700
commita9342b62885d5119593fa4330924e031e14c6406 (patch)
treec118820ae9c1187d770d85c1a44fca80dcccb60a /gdb/dwarf2read.c
parent5af70966484d6b26fa7824c0cda110140cd4959b (diff)
downloadgdb-a9342b62885d5119593fa4330924e031e14c6406.zip
gdb-a9342b62885d5119593fa4330924e031e14c6406.tar.gz
gdb-a9342b62885d5119593fa4330924e031e14c6406.tar.bz2
Add psymtab_storage::allocate_dependencies
This adds a new method to psymtab_storage to allocate storage for psymtab dependencies, then changes the symbol readers to use it. This has the effect of moving the storage to the psymtab storage obstack. gdb/ChangeLog 2019-01-10 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_end_psymtab): Use allocate_dependencies. * psymtab.h (psymtab_storage::allocate_dependencies): New method. * mdebugread.c (parse_partial_symbols): Use allocate_dependencies. * dwarf2read.c (dwarf2_create_include_psymtab): Use allocate_dependencies. (process_psymtab_comp_unit_reader) (build_type_psymtab_dependencies): Likewise. * dbxread.c (dbx_end_psymtab): Use allocate_dependencies.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 97ca341..7546c48 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6585,8 +6585,7 @@ dwarf2_create_include_psymtab (const char *name, struct partial_symtab *pst,
subpst->dirname = pst->dirname;
}
- subpst->dependencies
- = XOBNEW (&objfile->objfile_obstack, struct partial_symtab *);
+ subpst->dependencies = objfile->partial_symtabs->allocate_dependencies (1);
subpst->dependencies[0] = pst;
subpst->number_of_dependencies = 1;
@@ -8061,8 +8060,8 @@ process_psymtab_comp_unit_reader (const struct die_reader_specs *reader,
/* Fill in 'dependencies' here; we fill in 'users' in a
post-pass. */
pst->number_of_dependencies = len;
- pst->dependencies =
- XOBNEWVEC (&objfile->objfile_obstack, struct partial_symtab *, len);
+ pst->dependencies
+ = objfile->partial_symtabs->allocate_dependencies (len);
for (i = 0;
VEC_iterate (dwarf2_per_cu_ptr, cu->per_cu->imported_symtabs,
i, iter);
@@ -8315,8 +8314,7 @@ build_type_psymtab_dependencies (void **slot, void *info)
gdb_assert (IS_TYPE_UNIT_GROUP (per_cu));
pst->number_of_dependencies = len;
- pst->dependencies =
- XOBNEWVEC (&objfile->objfile_obstack, struct partial_symtab *, len);
+ pst->dependencies = objfile->partial_symtabs->allocate_dependencies (len);
for (i = 0;
VEC_iterate (sig_type_ptr, tu_group->tus, i, iter);
++i)