From: Tom Tromey Date: Thu, 30 May 2013 17:37:12 +0000 (+0000) Subject: fix mi-cmd-var.c X-Git-Tag: cygwin-1_7_19-release~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45475de718b57eb446a47b773658729b24da1583;p=external%2Fbinutils.git fix mi-cmd-var.c This is a stylistic change in mi-cmd-var.c that adds outer cleanups where needed by the checker. * mi/mi-cmd-var.c (varobj_update_one): Add an outer null cleanup. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 14b51d9..620af90 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2013-05-30 Tom Tromey + * mi/mi-cmd-var.c (varobj_update_one): Add an outer null cleanup. + +2013-05-30 Tom Tromey + * cli/cli-script.c (read_command_lines_1): Use a null cleanup for 'old_chain'. Do not check 'head' before processing cleanups. diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 558454e..a069346 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -741,7 +741,6 @@ varobj_update_one (struct varobj *var, enum print_values print_values, int explicit) { struct ui_out *uiout = current_uiout; - struct cleanup *cleanup = NULL; VEC (varobj_update_result) *changes; varobj_update_result *r; int i; @@ -752,9 +751,10 @@ varobj_update_one (struct varobj *var, enum print_values print_values, { char *display_hint; int from, to; + struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); if (mi_version (uiout) > 1) - cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); + make_cleanup_ui_out_tuple_begin_end (uiout, NULL); ui_out_field_string (uiout, "name", varobj_get_objname (r->varobj)); switch (r->status) @@ -828,8 +828,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values, r->new = NULL; /* Paranoia. */ } - if (mi_version (uiout) > 1) - do_cleanups (cleanup); + do_cleanups (cleanup); } VEC_free (varobj_update_result, changes); }