This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: mi tty commands
On Sun, Jul 10, 2005 at 11:08:12PM +0200, Mark Kettenis wrote:
> Date: Wed, 6 Jul 2005 10:54:49 -0400
> From: Bob Rossi <bob@brasko.net>
>
> On Sun, Jul 03, 2005 at 02:43:25PM -0400, Daniel Jacobowitz wrote:
> > On Sat, Jun 18, 2005 at 08:29:21AM -0400, Bob Rossi wrote:
> > > Index: gdb/ChangeLog
> > > + * fork-child.c (fork-inferior): Use accessor function for
> > > + inferior_io_terminal.
> > > + * infcmd.c (inferior_io_terminal): Make static.
> > > + (set_inferior_io_terminal): New function.
> > > + (get_inferior_io_terminal): Ditto.
> > > + (tty_command): Use accessor function.
> > > + (_initialize_infcmd): Add inferior_tty setshow variable.
> > > + (_initialize_infcmd): Remove tty command.
> > > + (_initialize_infcmd): Add a tty command that is an alias.
> > > + * inferior.h (set_inferior_io_terminal): New prototype.
> > > + (get_inferior_io_terminal): Ditto.
> > > + (new_tty_prefork): Add const qualifier to parameter.
> > > + * inflow.c (inferior_thisrun_terminal): Add const qualifier.
> > > + (new_tty_prefork): Add const qualifier to parameter.
> > > + * nto-procfs (procfs_create_inferior): Use accessor function.
> > > + (procfs_create_inferior): Add const qualifier to locals.
> > > + * win32-nat.c (child_create_inferior): Ditto.
> > > + * mi/mi-cmd-env.c (mi_cmd_inferior_tty_set): New function.
> > > + (mi_cmd_inferior_tty_set): Ditto.
> > > + * mi/mi-cmds.c (mi_cmds): Add inferior-tty-set and inferior-tty-show
> > > + * mi/mi-cmds.h (mi_cmd_inferior_tty_set): Add prototype.
> > > + (mi_cmd_inferior_tty_show): Ditto.
> > >
> > > Index: gdb/doc/ChangeLog
> > > + * gdb.texinfo (GDB/MI Miscellaneous Commands): Add -inferior-tty-set
> > > + and -inferior-tty-show.
> > > + (Input/Output): Document "set/show inferior-tty" and tty alias.
> > >
> > > Index: gdb/testsuite/ChangeLog
> > > + * gdb.mi/mi-basics.exp (test_setshow_inferior_tty): Test MI tty
> > > + command.
> >
> > This is almost completely OK now! Two minor fixes:
>
> Thanks very much! Committed. Now the interesting patches are coming :)
>
> Bob, please make sure there are no regressions from your patch before
> you check things in. I now get:
>
> FAIL: gdb.base/default.exp: tty
> FAIL: gdb.base/help.exp: help tty
>
> because the output of the tty command changed. In the past we had:
>
> (gdb) tty
> Argument required (terminal name for running target process).
>
> whereas now we have
>
> (gdb) tty
> Argument required (filename to set it to.).
>
> I don't really consider this an improvement...
Does anyone know why the "tty" command gives the "default" message when
I have,
/* add the filename of the terminal connected to inferior I/O */
add_setshow_filename_cmd ("inferior-tty", class_run,
&inferior_io_terminal, _("\
Set terminal for future runs of program being debugged."), _("\
Show terminal for future runs of program being debugged."), _("\
Usage: set inferior-tty /dev/pts/1"), NULL, NULL, &setlist, &showlist);
add_com_alias ("tty", "set inferior-tty", class_alias, 0);
I would expect the alias to take on the usage note from the command it
points to. Either that, or allow me to explicitly give it a usage note.
Any suggestions?
Thanks,
Bob Rossi