aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-05-30 17:34:18 +0000
committerTom Tromey <tromey@redhat.com>2013-05-30 17:34:18 +0000
commit57cee33aeea77d8c6760ae27162b627f9687c32c (patch)
tree37c52f54a6a388e9038410b2b456be38d4c756d3
parent795d915c9b6efeea3d6d5574cecbaec3e16c763b (diff)
downloadgdb-57cee33aeea77d8c6760ae27162b627f9687c32c.zip
gdb-57cee33aeea77d8c6760ae27162b627f9687c32c.tar.gz
gdb-57cee33aeea77d8c6760ae27162b627f9687c32c.tar.bz2
fix dbxread.c
This is a stylistic change to make some code in dbxread.c analyzable by the checker. * dbxread.c (dbx_read_symtab): Declare 'back_to' in a more inner scope. Unconditionally call do_cleanups.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dbxread.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 080275e..96c19fa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-05-30 Tom Tromey <tromey@redhat.com>
+ * dbxread.c (dbx_read_symtab): Declare 'back_to' in a more
+ inner scope. Unconditionally call do_cleanups.
+
+2013-05-30 Tom Tromey <tromey@redhat.com>
+
* source.c (find_and_open_source): Call do_cleanups.
2013-05-30 Tom Tromey <tromey@redhat.com>
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 8134f13..c0fe2b6 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2449,7 +2449,6 @@ static void
dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
{
bfd *sym_bfd;
- struct cleanup *back_to = NULL;
if (self->readin)
{
@@ -2461,6 +2460,8 @@ dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
if (LDSYMLEN (self) || self->number_of_dependencies)
{
+ struct cleanup *back_to;
+
/* Print the message now, before reading the string table,
to avoid disconcerting pauses. */
if (info_verbose)
@@ -2473,6 +2474,8 @@ dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
next_symbol_text_func = dbx_next_symbol_text;
+ back_to = make_cleanup (null_cleanup, NULL);
+
if (DBX_STAB_SECTION (objfile))
{
stabs_data
@@ -2481,14 +2484,12 @@ dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
NULL);
if (stabs_data)
- back_to = make_cleanup (free_current_contents,
- (void *) &stabs_data);
+ make_cleanup (free_current_contents, (void *) &stabs_data);
}
dbx_psymtab_to_symtab_1 (objfile, self);
- if (back_to)
- do_cleanups (back_to);
+ do_cleanups (back_to);
/* Match with global symbols. This only needs to be done once,
after all of the symtabs and dependencies have been read in. */