From: Tom Tromey Date: Thu, 30 May 2013 17:34:18 +0000 (+0000) Subject: fix dbxread.c X-Git-Tag: cygwin-1_7_19-release~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57cee33aeea77d8c6760ae27162b627f9687c32c;p=external%2Fbinutils.git 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. --- 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 + * dbxread.c (dbx_read_symtab): Declare 'back_to' in a more + inner scope. Unconditionally call do_cleanups. + +2013-05-30 Tom Tromey + * source.c (find_and_open_source): Call do_cleanups. 2013-05-30 Tom Tromey 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. */