aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.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/dbxread.c
parentebe6dbc2645081e3a166865f057e7cc9643e7e12 (diff)
downloadgdb-33c7c59df060e9952fc2f608c3a6ff0a23ecd40d.zip
gdb-33c7c59df060e9952fc2f608c3a6ff0a23ecd40d.tar.gz
gdb-33c7c59df060e9952fc2f608c3a6ff0a23ecd40d.tar.bz2
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/dbxread.c')
-rw-r--r--gdb/dbxread.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index ce00962..1618a56 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -516,7 +516,6 @@ dbx_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
{
bfd *sym_bfd;
int val;
- struct cleanup *back_to;
sym_bfd = objfile->obfd;
@@ -539,7 +538,7 @@ dbx_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
symbol_table_offset = DBX_SYMTAB_OFFSET (objfile);
free_pending_blocks ();
- back_to = make_cleanup (really_free_pendings, 0);
+ scoped_free_pendings free_pending;
minimal_symbol_reader reader (objfile);
@@ -551,8 +550,6 @@ dbx_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
minimal symbols for this objfile. */
reader.install ();
-
- do_cleanups (back_to);
}
/* Initialize anything that needs initializing when a completely new
@@ -2186,7 +2183,6 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst,
static void
dbx_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
{
- struct cleanup *old_chain;
int i;
if (pst->readin)
@@ -2220,15 +2216,13 @@ dbx_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;
file_string_table_offset = FILE_STRING_OFFSET (pst);
symbol_size = SYMBOL_SIZE (pst);
/* Read in this file's symbols. */
bfd_seek (objfile->obfd, SYMBOL_OFFSET (pst), SEEK_SET);
read_ofile_symtab (objfile, pst);
-
- do_cleanups (old_chain);
}
pst->readin = 1;