From f99d8bf46c55bc0192b3765e7738fd644c20619e Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 27 Mar 2012 19:08:37 +0000 Subject: 2012-03-27 Pedro Alves Eliminate struct ui_stream. * ui-out.h (struct ui_stream): Delete. (ui_out_field_stream): Adjust prototype. (ui_out_stream_new, ui_out_stream_delete) (make_cleanup_ui_out_stream_delete): Delete declarations. * ui-out.c (ui_out_field_stream): Change prototype to take a ui_file instead of a ui_stream. Adjust. (ui_out_stream_new, ui_out_stream_delete, do_stream_delete) (make_cleanup_ui_out_stream_delete): Delete. * breakpoint.c (print_breakpoint_location) (print_one_detail_ranged_breakpoint, print_it_watchpoint): Use ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new. * disasm.c (dump_insns): Ditto. (do_mixed_source_and_assembly, do_assembly_only): Adjust prototype. (gdb_disassembly): Use ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new. * infcmd.c (print_return_value): Ditto. * osdata.c (info_osdata_command): Don't allocate a local ui_stream. * stack.c (print_frame_arg, print_frame_args, print_frame): Use ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new. * tracepoint.c (print_one_static_tracepoint_marker): Don't allocate a local ui_stream. * mi/mi-cmd-stack.c (list_arg_or_local): Use ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new. (list_args_or_locals): Don't allocate a local ui_stream. * mi/mi-main.c (get_register, mi_cmd_data_evaluate_expression) (mi_cmd_data_read_memory): Use ui_file/mem_fileopen instead of ui_stream/ui_out_stream_new. * cli/cli-setshow.c (do_setshow_command): Ditto. --- gdb/stack.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'gdb/stack.c') diff --git a/gdb/stack.c b/gdb/stack.c index 22b16a5..bbd6b7f 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -210,10 +210,10 @@ print_frame_arg (const struct frame_arg *arg) struct ui_out *uiout = current_uiout; volatile struct gdb_exception except; struct cleanup *old_chain; - struct ui_stream *stb; + struct ui_file *stb; - stb = ui_out_stream_new (uiout); - old_chain = make_cleanup_ui_out_stream_delete (stb); + stb = mem_fileopen (); + old_chain = make_cleanup_ui_file_delete (stb); gdb_assert (!arg->val || !arg->error); gdb_assert (arg->entry_kind == print_entry_values_no @@ -224,21 +224,21 @@ print_frame_arg (const struct frame_arg *arg) annotate_arg_begin (); make_cleanup_ui_out_tuple_begin_end (uiout, NULL); - fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (arg->sym), + fprintf_symbol_filtered (stb, SYMBOL_PRINT_NAME (arg->sym), SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI); if (arg->entry_kind == print_entry_values_compact) { /* It is OK to provide invalid MI-like stream as with PRINT_ENTRY_VALUE_COMPACT we never use MI. */ - fputs_filtered ("=", stb->stream); + fputs_filtered ("=", stb); - fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (arg->sym), + fprintf_symbol_filtered (stb, SYMBOL_PRINT_NAME (arg->sym), SYMBOL_LANGUAGE (arg->sym), DMGL_PARAMS | DMGL_ANSI); } if (arg->entry_kind == print_entry_values_only || arg->entry_kind == print_entry_values_compact) - fputs_filtered ("@entry", stb->stream); + fputs_filtered ("@entry", stb); ui_out_field_stream (uiout, "name", stb); annotate_arg_name_end (); ui_out_text (uiout, "="); @@ -279,17 +279,17 @@ print_frame_arg (const struct frame_arg *arg) /* True in "summary" mode, false otherwise. */ opts.summary = !strcmp (print_frame_arguments, "scalars"); - common_val_print (arg->val, stb->stream, 2, &opts, language); + common_val_print (arg->val, stb, 2, &opts, language); } } if (except.message) - fprintf_filtered (stb->stream, _(""), + fprintf_filtered (stb, _(""), except.message); } ui_out_field_stream (uiout, "value", stb); - /* Aleo invoke ui_out_tuple_end. */ + /* Also invoke ui_out_tuple_end. */ do_cleanups (old_chain); annotate_arg_end (); @@ -500,14 +500,14 @@ print_frame_args (struct symbol *func, struct frame_info *frame, /* Number of ints of arguments that we have printed so far. */ int args_printed = 0; struct cleanup *old_chain, *list_chain; - struct ui_stream *stb; + struct ui_file *stb; /* True if we should print arguments, false otherwise. */ int print_args = strcmp (print_frame_arguments, "none"); /* True in "summary" mode, false otherwise. */ int summary = !strcmp (print_frame_arguments, "scalars"); - stb = ui_out_stream_new (uiout); - old_chain = make_cleanup_ui_out_stream_delete (stb); + stb = mem_fileopen (); + old_chain = make_cleanup_ui_file_delete (stb); if (func) { @@ -1103,7 +1103,7 @@ print_frame (struct frame_info *frame, int print_level, struct ui_out *uiout = current_uiout; const char *funname = NULL; enum language funlang = language_unknown; - struct ui_stream *stb; + struct ui_file *stb; struct cleanup *old_chain, *list_chain; struct value_print_options opts; struct symbol *func; @@ -1112,8 +1112,8 @@ print_frame (struct frame_info *frame, int print_level, pc_p = get_frame_pc_if_available (frame, &pc); - stb = ui_out_stream_new (uiout); - old_chain = make_cleanup_ui_out_stream_delete (stb); + stb = mem_fileopen (); + old_chain = make_cleanup_ui_file_delete (stb); find_frame_funname (frame, &funname, &funlang, &func); @@ -1143,7 +1143,7 @@ print_frame (struct frame_info *frame, int print_level, ui_out_text (uiout, " in "); } annotate_frame_function_name (); - fprintf_symbol_filtered (stb->stream, funname ? funname : "??", + fprintf_symbol_filtered (stb, funname ? funname : "??", funlang, DMGL_ANSI); ui_out_field_stream (uiout, "func", stb); ui_out_wrap_hint (uiout, " "); -- cgit v1.1