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]

Re: [PATCH 1/4] GDB: inferior standard I/O redirection


> From: Cleber Rosa <crosa@redhat.com>
> Cc: areis@redhat.com, palves@redhat.com, Cleber Rosa <crosa@redhat.com>
> Date: Mon,  5 Oct 2015 08:46:54 -0300
> 
> This introduces a set of commands:
> 
>  * set inferior-stdin (aliased as stdin)
>  * set inferior-stdout (aliased as stdout)
>  * set inferior-stderr (aliased as stderr)

Thanks.

> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -42,6 +42,21 @@ set remote multiprocess-extensions-packet
>  show remote multiprocess-extensions-packet
>    Set/show the use of the remote protocol multiprocess extensions.
>  
> +set inferior-stdin
> +stdin
> +show inferior-stdin
> +  Set/show the standard input for the program being debugged.
> +
> +set inferior-stdout
> +stdout
> +show inferior-stdout
> +  Set/show the standard output for the program being debugged.
> +
> +set inferior-stderr
> +stderr
> +show inferior-stderr
> +  Set/show the standard error for the program being debugged.
> +

This part is OK.

> +When you use the @code{tty} command or redirect input using either
> +@code{stdin}/@code{stdout}/@code{stderr} or the @code{run} command,
> +only the input @emph{for your program} is affected.  The input for
> +@value{GDBN} still comes from your terminal and from the original
> +standard I/O channels.  @code{tty} is an alias for @code{set
> +inferior-tty}.

It is strange to talk about redirecting input, when the description
also includes stdout and stderr.  Did you really mean only input here?

> +  add_setshow_filename_cmd ("inferior-stdin", class_run,
> +			    &inferior_io_std_scratch[0], _("\
> +Set standard input for future runs of program being debugged."), _("\

This correctly says that the effect of these commands is only for
_future_ runs of the inferior, but the text in the manual completely
omits this important detail, so the reader could think we have some
magical way of redirecting I/O of an already running program.

The documentation is OK with those gotchas fixed.

Thanks.


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