From 37ce89ebb295e6ed0fc0bf5a4eb2e718ed0fb2ee Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Thu, 28 Jun 2012 22:11:23 +0000 Subject: Make logging work for MI. * NEWS: Mention it. * interps.h (interp_set_logging_ftype): New typedef. (struct interp_procs): New field set_logging_proc. (current_interp_set_logging): Declare. * interps.c (current_interp_set_logging): New function. * cli/cli-logging.c: Include interps.h. (set_logging_redirect): Call current_interp_set_logging. (pop_output_files): Ditto. (handle_redirections): Ditto, plus skip ui-out redirect if MI. * mi/mi-console.h (mi_console_set_raw): Declare. * mi/mi-console.c (mi_console_set_raw): New function. * mi/mi-interp.c (saved_raw_stdout): New global. (mi_set_logging): New function. (_initialize_mi_interp): Add it to interp procs. * gdb.mi/mi-logging.exp: New file. --- gdb/interps.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gdb/interps.c') diff --git a/gdb/interps.c b/gdb/interps.c index 9b24c59..698e26e 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -251,6 +251,19 @@ interp_ui_out (struct interp *interp) return current_interpreter->procs->ui_out_proc (current_interpreter); } +int +current_interp_set_logging (int start_log, struct ui_file *out, + struct ui_file *logfile) +{ + if (current_interpreter == NULL + || current_interpreter->procs->set_logging_proc == NULL) + return 0; + + return current_interpreter->procs->set_logging_proc (current_interpreter, + start_log, out, + logfile); +} + /* Temporarily overrides the current interpreter. */ struct interp * interp_set_temp (const char *name) -- cgit v1.1