[PATCH 33/40] fix mi-cmd-stack.c

Tom Tromey
2013-05-09T18:52:45Z

mi-cmd-stack.d had a conditional cleanup, "cleanup_tuple" that
confused the checker. However, there was no need for this, since it
was only used via do_cleanups at the end of the function, just before
another call to do_cleanups.

So, while this is a stylistic patch for the checker, I also consider
it a generic improvement for readers of the code.

* mi/mi-cmd-stack.c (list_arg_or_local): Remove
"cleanup_tuple".
---
gdb/mi/mi-cmd-stack.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 062cd5d..4de78ac 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -250,7 +250,6 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
enum print_values values)
{
struct cleanup *old_chain;
- struct cleanup *cleanup_tuple = NULL;
struct ui_out *uiout = current_uiout;
struct ui_file *stb;

@@ -268,7 +267,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
&& (arg->val || arg->error)));

if (values != PRINT_NO_VALUES || what == all)
- cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+ make_cleanup_ui_out_tuple_begin_end (uiout, NULL);

fputs_filtered (SYMBOL_PRINT_NAME (arg->sym), stb);
if (arg->entry_kind == print_entry_values_only)
@@ -311,8 +310,6 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
ui_out_field_stream (uiout, "value", stb);
}

- if (values != PRINT_NO_VALUES || what == all)
- do_cleanups (cleanup_tuple);
do_cleanups (old_chain);
}

--
1.8.1.4