summaryrefslogtreecommitdiff
path: root/gdb/xcoffread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-10-20 09:30:48 -0600
committerTom Tromey <tom@tromey.com>2017-11-04 10:27:15 -0600
commit33c7c59df060e9952fc2f608c3a6ff0a23ecd40d (patch)
treeeb6725ca4c4c70e816584cd479bc76a34e97031a /gdb/xcoffread.c
parentebe6dbc2645081e3a166865f057e7cc9643e7e12 (diff)
Replace really_free_pendings with a scoped_ class
This introduces scoped_free_pendings, and changes users of really_free_pendings to use it instead, removing some clenaups. I tried to examine the affected code to ensure there aren't dangling cleanups in the vicinity. gdb/ChangeLog 2017-11-04 Tom Tromey <tom@tromey.com> * dwarf2read.c (process_full_comp_unit, process_full_type_unit): Use scoped_free_pendings. * dbxread.c (dbx_symfile_read, dbx_psymtab_to_symtab_1): Use scoped_free_pendings. * xcoffread.c (xcoff_psymtab_to_symtab_1): Use scoped_free_pendings. (xcoff_initial_scan): Likewise. * buildsym.c (reset_symtab_globals): Update comment. (scoped_free_pendings): Rename from really_free_pendings. (prepare_for_building): Update comment. (buildsym_init): Likewise. * buildsym.h (class scoped_free_pendings): New class. (really_free_pendings): Don't declare.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r--gdb/xcoffread.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index ea11b3f966..2e4f30f291 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1833,7 +1833,6 @@ find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
static void
xcoff_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
{
- struct cleanup *old_chain;
int i;
if (!pst)
@@ -1870,11 +1869,9 @@ xcoff_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
/* Init stuff necessary for reading in symbols. */
stabsread_init ();
buildsym_init ();
- old_chain = make_cleanup (really_free_pendings, 0);
+ scoped_free_pendings free_pending;
read_xcoff_symtab (objfile, pst);
-
- do_cleanups (old_chain);
}
pst->readin = 1;
@@ -2950,7 +2947,6 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
{
bfd *abfd;
int val;
- struct cleanup *back_to;
int num_symbols; /* # of symbols */
file_ptr symtab_offset; /* symbol table and */
file_ptr stringtab_offset; /* string table file offsets */
@@ -3027,8 +3023,8 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
init_psymbol_list (objfile, num_symbols);
free_pending_blocks ();
- back_to = make_cleanup (really_free_pendings, 0);
+ scoped_free_pendings free_pending;
minimal_symbol_reader reader (objfile);
/* Now that the symbol table data of the executable file are all in core,
@@ -3047,8 +3043,6 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
dwarf2_build_psymtabs (objfile);
dwarf2_build_frame_info (objfile);
-
- do_cleanups (back_to);
}
static void