This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Logging for MI


This patch extends GDB's logging support to the MI. It's a little messy because the MI creates additional ui-file objects (the "consoles") that need to have their underlying ui-files changed to either a tee or the open log file, depending on redirection mode. So I added a new interpreter proc that hooks into the logging enable/disable, and an MI-specific function to change the console's "raw" ui-file.

Although the patch seems straightforward, it entailed quite a bit of trial-and-error, and I've probably missed a few cases in the tangled tubing that is GDB's ui-file system; comments welcome. I plan to commit this in a few days if no flaws come to light.

Stan
stan@codesourcery.com

2012-06-24 Stan Shebs <stan@codesourcery.com>

    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.

Attachment: milog-patch-1
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]