diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2003-02-03 01:18:37 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2003-02-03 01:18:37 +0000 |
commit | 3b31d625f3b05256b22c245c144e7e228e20f079 (patch) | |
tree | 7ef7e2358a674252f8bbf5fa71ab1e031837d057 /gdb/ui-out.c | |
parent | 70a296bc46ba0532f6160caf76355c7e601a1060 (diff) | |
download | gdb-3b31d625f3b05256b22c245c144e7e228e20f079.zip gdb-3b31d625f3b05256b22c245c144e7e228e20f079.tar.gz gdb-3b31d625f3b05256b22c245c144e7e228e20f079.tar.bz2 |
2003-02-02 Elena Zannoni <ezannoni@redhat.com>
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 <kevinb@redhat.com>:
* 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.
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r-- | gdb/ui-out.c | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c index d98cf16..ed32da3 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -273,7 +273,7 @@ static void init_ui_out_state (struct ui_out *uiout); /* Mark beginning of a table */ -void +static void ui_out_table_begin (struct ui_out *uiout, int nbrofcols, int nr_rows, const char *tblid) @@ -318,7 +318,7 @@ columns."); uo_table_body (uiout); } -void +static void ui_out_table_end (struct ui_out *uiout) { if (!uiout->table.flag) @@ -351,6 +351,22 @@ and before table_body."); uo_table_header (uiout, width, alignment, col_name, colhdr); } +static void +do_cleanup_table_end (void *data) +{ + struct ui_out *ui_out = data; + + ui_out_table_end (ui_out); +} + +struct cleanup * +make_cleanup_ui_out_table_begin_end (struct ui_out *ui_out, int nr_cols, + int nr_rows, const char *tblid) +{ + ui_out_table_begin (ui_out, nr_cols, nr_rows, tblid); + return make_cleanup (do_cleanup_table_end, ui_out); +} + void ui_out_begin (struct ui_out *uiout, enum ui_out_type type, @@ -388,19 +404,6 @@ specified after table_body."); } void -ui_out_list_begin (struct ui_out *uiout, - const char *id) -{ - ui_out_begin (uiout, ui_out_type_list, id); -} - -void -ui_out_tuple_begin (struct ui_out *uiout, const char *id) -{ - ui_out_begin (uiout, ui_out_type_tuple, id); -} - -void ui_out_end (struct ui_out *uiout, enum ui_out_type type) { @@ -408,18 +411,6 @@ ui_out_end (struct ui_out *uiout, uo_end (uiout, type, old_level); } -void -ui_out_list_end (struct ui_out *uiout) -{ - ui_out_end (uiout, ui_out_type_list); -} - -void -ui_out_tuple_end (struct ui_out *uiout) -{ - ui_out_end (uiout, ui_out_type_tuple); -} - struct ui_out_end_cleanup_data { struct ui_out *uiout; @@ -458,7 +449,7 @@ struct cleanup * make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout, const char *id) { - ui_out_tuple_begin (uiout, id); + ui_out_begin (uiout, ui_out_type_tuple, id); return make_cleanup_ui_out_end (uiout, ui_out_type_tuple); } @@ -466,7 +457,7 @@ struct cleanup * make_cleanup_ui_out_list_begin_end (struct ui_out *uiout, const char *id) { - ui_out_list_begin (uiout, id); + ui_out_begin (uiout, ui_out_type_list, id); return make_cleanup_ui_out_end (uiout, ui_out_type_list); } |