summaryrefslogtreecommitdiff
path: root/gdb/ui-out.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2003-06-28 16:19:07 +0000
committerDaniel Jacobowitz <dan@debian.org>2003-06-28 16:19:07 +0000
commit32e7795df13f21e5c6bae9fb4142d4d9f0eae18d (patch)
tree68b30cd6c12eddb8afe29493e38fed510c921268 /gdb/ui-out.c
parente39f2cb3ee39e75dfec5c6401687e0a6d0f190a0 (diff)
downloadgdb-32e7795df13f21e5c6bae9fb4142d4d9f0eae18d.tar.gz
./
* cli/cli-logging.c: New file. * cli-out.c (struct ui_out_data): Add original_stream. (cli_redirect): New function. (cli_ui_out_impl): Add cli_redirect. (cli_out_new): Initialize original_stream. * ui-out.c (default_ui_out_impl): Add NULL for redirect member. (uo_redirect, ui_out_redirect): New. * ui-out.h (struct ui_out_impl): Add redirect member. (redirect_ftype): New. (ui_out_redirect): Add prototype. * Makefile.in: Add rules for cli-logging.c. * NEWS: Mention "set logging". mi/ * mi-out.c (mi_ui_out_impl): Add NULL for redirect member. tui/ * tui-out.c (tui_ui_out_impl): Add NULL for redirect member. doc/ * gdb.texinfo (Logging output): New chapter.
Diffstat (limited to 'gdb/ui-out.c')
-rw-r--r--gdb/ui-out.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ui-out.c b/gdb/ui-out.c
index 71e6d6ac070..5fb8eaa69e8 100644
--- a/gdb/ui-out.c
+++ b/gdb/ui-out.c
@@ -206,6 +206,7 @@ struct ui_out_impl default_ui_out_impl =
default_message,
default_wrap_hint,
default_flush,
+ NULL,
0, /* Does not need MI hacks. */
};
@@ -254,6 +255,7 @@ static void uo_message (struct ui_out *uiout, int verbosity,
const char *format, va_list args);
static void uo_wrap_hint (struct ui_out *uiout, char *identstring);
static void uo_flush (struct ui_out *uiout);
+static int uo_redirect (struct ui_out *uiout, struct ui_file *outstream);
/* Prototypes for local functions */
@@ -638,6 +640,12 @@ ui_out_flush (struct ui_out *uiout)
uo_flush (uiout);
}
+int
+ui_out_redirect (struct ui_out *uiout, struct ui_file *outstream)
+{
+ return uo_redirect (uiout, outstream);
+}
+
/* set the flags specified by the mask given */
int
ui_out_set_flags (struct ui_out *uiout, int mask)
@@ -981,6 +989,15 @@ uo_flush (struct ui_out *uiout)
uiout->impl->flush (uiout);
}
+int
+uo_redirect (struct ui_out *uiout, struct ui_file *outstream)
+{
+ if (!uiout->impl->redirect)
+ return -1;
+ uiout->impl->redirect (uiout, outstream);
+ return 0;
+}
+
/* local functions */
/* list of column headers manipulation routines */