From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Allow resetting an empty inferior-tty
Date: Wed, 24 Aug 2016 15:33:00 -0000 [thread overview]
Message-ID: <02a660a4-13e9-d741-577a-0aaef7c196ae@redhat.com> (raw)
In-Reply-To: <20160824144548.19204-1-simon.marchi@ericsson.com>
On 08/24/2016 03:45 PM, Simon Marchi wrote:
> This patch allows the user to set the inferior-tty to "empty", in order
> to come back to the default behaviour of using the same tty as gdb is
> using.
LGTM. A couple nits below.
> diff --git a/gdb/infcmd.c b/gdb/infcmd.c
> index 58ba1cb..97a1e35 100644
> --- a/gdb/infcmd.c
> +++ b/gdb/infcmd.c
> @@ -151,7 +151,11 @@ void
> set_inferior_io_terminal (const char *terminal_name)
> {
> xfree (current_inferior ()->terminal);
> - current_inferior ()->terminal = terminal_name ? xstrdup (terminal_name) : 0;
> +
> + if (terminal_name != NULL && strlen (terminal_name) > 0)
Use th idiomatic empty-string check: *terminal_name != '\0'
> /* Add the filename of the terminal connected to inferior I/O. */
> - add_setshow_filename_cmd ("inferior-tty", class_run,
> - &inferior_io_terminal_scratch, _("\
> + add_setshow_optional_filename_cmd ("inferior-tty", class_run,
> + &inferior_io_terminal_scratch, _("\
> 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"),
Should we update the online help too?
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-08-24 15:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 14:52 Simon Marchi
2016-08-24 15:05 ` Eli Zaretskii
2016-08-24 15:24 ` Simon Marchi
2016-08-24 15:58 ` Eli Zaretskii
2016-08-24 15:33 ` Pedro Alves [this message]
2016-08-24 15:38 ` Simon Marchi
2016-08-24 15:41 ` Pedro Alves
2016-08-24 15:55 ` Simon Marchi
2016-08-24 16:20 ` Pedro Alves
2016-08-24 17:11 ` Simon Marchi
2016-08-24 17:22 ` Simon Marchi
2016-08-29 10:55 ` [testsuite patch+7.12] gdb.base/default.exp regression [Re: [PATCH] Allow resetting an empty inferior-tty] Jan Kratochvil
2016-08-29 12:39 ` Simon Marchi
2016-08-29 13:01 ` Pedro Alves
2016-08-29 13:22 ` [commit] " Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=02a660a4-13e9-d741-577a-0aaef7c196ae@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox