From 3b31d625f3b05256b22c245c144e7e228e20f079 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Mon, 3 Feb 2003 01:18:37 +0000 Subject: 2003-02-02 Elena Zannoni Fix PR gdb/742 gdb/743 * disasm.c (dump_insns): Use make_cleanup_ui_out_tuple_begin_end. (do_mixed_source_and_assembly): Use make_cleanup_ui_out_tuple_begin_end and make_cleanup_ui_out_tuple_begin_end. (do_mixed_source_and_assembly): Ditto. * thread.c (do_captured_list_thread_ids): Ditto. * ui-out.h (ui_out_table_begin, ui_out_list_begin, ui_out_tuple_begin, ui_out_table_end, ui_out_list_end, ui_out_tuple_end): Delete prototypes. * ui-out.c (ui_out_list_begin, ui_out_tuple_begin, ui_out_list_end, ui_out_tuple_end): Delete. From Kevin Buettner : * ui-out.h (make_cleanup_ui_out_table_begin_end): New function. * ui-out.c (make_cleanup_ui_out_table_begin_end) (do_cleanup_table_end): New functions. * breakpoint.c (print_it_typical, print_one_breakpoint, mention): Use cleanups to invoke_ui_out_tuple_end(). (breakpoint_1): Use cleanup to invoke ui_out_table_end(). * cli/cli-setshow.c (cmd_show_list): Use make_cleanup_ui_out_tuple_begin_end. --- gdb/cli/cli-setshow.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'gdb/cli/cli-setshow.c') diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 6fe2ff0..1d68ae4 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -1,6 +1,6 @@ /* Handle set and show GDB commands. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -353,28 +353,35 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c) void cmd_show_list (struct cmd_list_element *list, int from_tty, char *prefix) { - ui_out_tuple_begin (uiout, "showlist"); + struct cleanup *showlist_chain; + + showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist"); for (; list != NULL; list = list->next) { /* If we find a prefix, run its list, prefixing our output by its prefix (with "show " skipped). */ if (list->prefixlist && !list->abbrev_flag) { - ui_out_tuple_begin (uiout, "optionlist"); + struct cleanup *optionlist_chain + = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist"); ui_out_field_string (uiout, "prefix", list->prefixname + 5); cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5); - ui_out_tuple_end (uiout); + /* Close the tuple. */ + do_cleanups (optionlist_chain); } if (list->type == show_cmd) { - ui_out_tuple_begin (uiout, "option"); + struct cleanup *option_chain + = make_cleanup_ui_out_tuple_begin_end (uiout, "option"); ui_out_text (uiout, prefix); ui_out_field_string (uiout, "name", list->name); ui_out_text (uiout, ": "); do_setshow_command ((char *) NULL, from_tty, list); - ui_out_tuple_end (uiout); + /* Close the tuple. */ + do_cleanups (option_chain); } } - ui_out_tuple_end (uiout); + /* Close the tuple. */ + do_cleanups (showlist_chain); } -- cgit v1.1