diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-10 16:23:55 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-01-10 07:08:14 -0700 |
commit | a9342b62885d5119593fa4330924e031e14c6406 (patch) | |
tree | c118820ae9c1187d770d85c1a44fca80dcccb60a /gdb/xcoffread.c | |
parent | 5af70966484d6b26fa7824c0cda110140cd4959b (diff) | |
download | gdb-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/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 50da078..e93a34b 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2075,9 +2075,8 @@ xcoff_end_psymtab (struct objfile *objfile, struct partial_symtab *pst, pst->number_of_dependencies = number_dependencies; if (number_dependencies) { - pst->dependencies = XOBNEWVEC (&objfile->objfile_obstack, - struct partial_symtab *, - number_dependencies); + pst->dependencies + = objfile->partial_symtabs->allocate_dependencies (number_dependencies); memcpy (pst->dependencies, dependency_list, number_dependencies * sizeof (struct partial_symtab *)); } @@ -2096,7 +2095,7 @@ xcoff_end_psymtab (struct objfile *objfile, struct partial_symtab *pst, /* We could save slight bits of space by only making one of these, shared by the entire set of include files. FIXME-someday. */ subpst->dependencies = - XOBNEW (&objfile->objfile_obstack, struct partial_symtab *); + objfile->partial_symtabs->allocate_dependencies (1); subpst->dependencies[0] = pst; subpst->number_of_dependencies = 1; |