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/ui-out.c | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'gdb/ui-out.c') diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 9f24784..aa53f3f 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -501,17 +501,17 @@ ui_out_field_core_addr (struct ui_out *uiout, void ui_out_field_stream (struct ui_out *uiout, const char *fldname, - struct ui_stream *buf) + struct ui_file *stream) { long length; - char *buffer = ui_file_xstrdup (buf->stream, &length); + char *buffer = ui_file_xstrdup (stream, &length); struct cleanup *old_cleanup = make_cleanup (xfree, buffer); if (length > 0) ui_out_field_string (uiout, fldname, buffer); else ui_out_field_skip (uiout, fldname); - ui_file_rewind (buf->stream); + ui_file_rewind (stream); do_cleanups (old_cleanup); } @@ -589,37 +589,6 @@ ui_out_message (struct ui_out *uiout, int verbosity, va_end (args); } -struct ui_stream * -ui_out_stream_new (struct ui_out *uiout) -{ - struct ui_stream *tempbuf; - - tempbuf = XMALLOC (struct ui_stream); - tempbuf->uiout = uiout; - tempbuf->stream = mem_fileopen (); - return tempbuf; -} - -void -ui_out_stream_delete (struct ui_stream *buf) -{ - ui_file_delete (buf->stream); - xfree (buf); -} - -static void -do_stream_delete (void *buf) -{ - ui_out_stream_delete (buf); -} - -struct cleanup * -make_cleanup_ui_out_stream_delete (struct ui_stream *buf) -{ - return make_cleanup (do_stream_delete, buf); -} - - void ui_out_wrap_hint (struct ui_out *uiout, char *identstring) { -- cgit v1.1