Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] cli-out.c new function
@ 2002-11-05 15:26 Elena Zannoni
  2002-11-05 19:25 ` Daniel Jacobowitz
  2002-11-05 23:00 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Elena Zannoni @ 2002-11-05 15:26 UTC (permalink / raw)
  To: fnasser, gdb-patches


This function sets the stream of the uiout file to the given
parameter.  It is used in the interpreter work. Maybe Keith or JimI
can explain this a bit better, but switching interpreters can change
the gdb_sdout.


  /* gdb_stdout could change between the time cli_uiout was initialized
     and now. Since we're probably using a different interpreter which has
     a new ui_file for gdb_stdout, use that one instead of the default.

     It is important that it gets reset everytime, since the user could
     set gdb to use a different interpreter. */
  old_stream = cli_out_set_stream (cli_uiout, gdb_stdout);

Elena


2002-11-05  Elena Zannoni  <ezannoni@redhat.com>

	From Jim Ingham  <jingham@apple.com> and
	Keith Seitz  <keiths@redhat.com>:
	* cli-out.h (cli_out_set_stream): Export.
	* cli-out.c (cli_out_set_stream): New function.

Index: cli-out.c
===================================================================
RCS file: /cvs/uberbaum/gdb/cli-out.c,v
retrieving revision 1.14
diff -u -p -r1.14 cli-out.c
--- cli-out.c	19 Mar 2002 02:51:04 -0000	1.14
+++ cli-out.c	5 Nov 2002 23:24:34 -0000
@@ -365,6 +365,16 @@ cli_out_new (struct ui_file *stream)
   return ui_out_new (&cli_ui_out_impl, data, flags);
 }
 
+/* Set the stream for UIOUT to the given ui_file STREAM.  */
+struct ui_file *
+cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
+{
+  struct ui_out_data *data = ui_out_data (uiout);
+  struct ui_file *old = data->stream;
+  data->stream = stream;
+  return old;
+}
+
 /* standard gdb initialization hook */
 void
 _initialize_cli_out (void)
Index: cli-out.h
===================================================================
RCS file: /cvs/uberbaum/gdb/cli-out.h,v
retrieving revision 1.2
diff -u -p -r1.2 cli-out.h
--- cli-out.h	6 Mar 2001 08:21:06 -0000	1.2
+++ cli-out.h	5 Nov 2002 23:24:34 -0000
@@ -23,5 +23,7 @@
 #define CLI_OUT_H
 
 extern struct ui_out *cli_out_new (struct ui_file *stream);
+extern struct ui_file *cli_out_set_stream (struct ui_out *uiout,
+					   struct ui_file *stream);
 
 #endif


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-11-06 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-05 15:26 [RFA] cli-out.c new function Elena Zannoni
2002-11-05 19:25 ` Daniel Jacobowitz
2002-11-06  1:08   ` Pierre Muller
2002-11-06 10:16     ` Elena Zannoni
2002-11-06 11:16       ` Elena Zannoni
2002-11-05 23:00 ` Eli Zaretskii
2002-11-06 11:26   ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox