[PATCH] Logging for MI

Stan Shebs stanshebs@earthlink.net
Wed Jun 27 22:24:00 GMT 2012


On 6/27/12 12:40 PM, Tom Tromey wrote:
>>>>>> "Stan" == Stan Shebs <stanshebs@earthlink.net> writes:
> Stan> Although the patch seems straightforward, it entailed quite a bit of
> Stan> trial-and-error, and I've probably missed a few cases in the tangled
> Stan> tubing that is GDB's ui-file system; comments welcome.
>
> I don't really understand all that code either.
> It is pretty light on docs; but also just convoluted.
>
> Stan> I plan to commit this in a few days if no flaws come to light.
>
> I was curious whether it did the right thing if logging is enabled and
> then the user sends a CLI command to the MI interpreter.
> I dug through the code a little but couldn't convince myself either way.
>
> Tom
>

It does in fact do the right thing, and I checked just now to be sure. 
:-)  The theory of CLI output is that gdb_stdout is set to the mi->out 
console, which prefixes random CLI text with a tilde and encloses it in 
quotes.  So changing gdb_stdout isn't sufficient, one has to reach in 
under the consoles and replace their streams with the open file or tee.

Stan



More information about the Gdb-patches mailing list