From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63609 invoked by alias); 3 Jan 2017 20:48:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 63596 invoked by uid 89); 3 Jan 2017 20:48:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=qualification, DOS, remotely, @cindex X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Jan 2017 20:48:28 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19C9920264; Tue, 3 Jan 2017 20:48:28 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v03KmRxl002198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 3 Jan 2017 15:48:27 -0500 From: Sergio Durigan Junior To: Eli Zaretskii Cc: gdb-patches@sourceware.org, palves@redhat.com Subject: Re: [PATCH 6/6] Implement proper "startup-with-shell" support on gdbserver References: <1482464361-4068-1-git-send-email-sergiodj@redhat.com> <1482464361-4068-7-git-send-email-sergiodj@redhat.com> <83y3z7ysq2.fsf@gnu.org> X-URL: http://blog.sergiodj.net Date: Tue, 03 Jan 2017 20:48:00 -0000 In-Reply-To: <83y3z7ysq2.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Dec 2016 10:06:45 +0200") Message-ID: <87pok3q38l.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00028.txt.bz2 Thanks for the review, Eli. Comments below. On Friday, December 23 2016, Eli Zaretskii wrote: >> From: Sergio Durigan Junior >> Cc: palves@redhat.com, Sergio Durigan Junior >> Date: Thu, 22 Dec 2016 22:39:21 -0500 >> >> gdb/doc/ChangeLog: >> 2016-12-22 Sergio Durigan Junior >> >> * gdb.texinfo (startup-with-shell): Add note mentioning that the >> setting is also used by remote targets. >> (set remote startup-shell): New item. > > The text in parentheses should be the name of the node where you make > the change. If you want to refer to specific symbols within the node, > either mention them as part of the text or put them in <..>, like > this: > > * gdb.texinfo (Starting) : Add note ... Ops, thanks for pointing that out. I'll fix it. >> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >> index a0de7d1..3250cae 100644 >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -2174,6 +2174,10 @@ initialization file---such as @file{.cshrc} for C-shell, >> $@file{.zshenv} for the Z shell, or the file specified in the >> @samp{BASH_ENV} environment variable for BASH. >> >> +This setting is also used by @code{target extended-remote} to >> +determine whether the target system will start the inferior using the >> +shell (@pxref{set remote startup-shell}). > > I would add here a qualification: only on Unix-like target systems. > (Is it true that this is a necessary condition for the applicability > of that feature?) The target must be able to start the inferior using a shell. Of all the non-UNIX-like systems that GDB supports, I am not aware of any that can do it, so I think this is a fair qualification. >> +@item set remote startup-shell @var{shell} >> +@itemx show remote startup-shell >> +@anchor{set remote startup-shell} >> +@cindex startup shell, for remote target >> +Set the shell that is going to be used to start the inferior with >> +@code{target extended-remote}. This should be set to a valid shell on >> +the target system, and is only effective when >> +@code{startup-with-shell} is on. If it is not set, the target system >> +will use the shell pointed by the @code{SHELL} environment variable. > > Three comments on this: > > . What is a "valid shell" in this context? Is the DOS command.com a > valid shell, for example (probably not)? I think we should be > more explicit about which shells are acceptable. Right. "Valid shells" are shells that are present on the target system (i.e., they are installed there), and that can be used to start the inferior. I know almost nothing about command.com, but ISTR that it cannot be used to start programs. I will explain it better in the text. > . What exactly is the value supposed to be? Is it a full absolute > file name of the shell executable? We should say so explicitly, > IMO. It all depends on what is in the $PATH. But you're right, I'll mention that explicitly. > . Does it really make sense to require that both this option and > startup-with-shell be on? They don't need to be both on. The only setting that needs to be on is the startup-with-shell. The 'remote startup-shell' option only needs to be set if the user wants to explicitly specify which shell to use. > Why cannot the user set only this > option to achieve that effect, with some special value standing > for "use $SHELL"? The "special value", in this case, is an empty value. I.e., if the user doesn't touch the 'remote startup-shell' option and the startup-with-shell option is on, the target will use $SHELL to start the inferior. Now, it is questionable whether to > Also, is it possible that a user will want > remote targets to use a shell, while avoiding that for native > debugging, in the same session? Yeah, I thought about that. My first thought was to add a 'set/show remote startup-with-shell' option, but I thought this was going to be too much for the user. Maybe not. With this new setting, we'd have: - startup-with-shell: Used only locally, default on. Instructs GDB to start the inferior using the shell. - remote startup-with-shell: Used only remotely, default on. Instructs gdbserver to start the inferior using the shell. - remote startup-shell: Used only remotely (if remote startup-with-shell is on), default "" (empty). Tells which shell to be used by gdbserver to start the inferior. If empty, use $SHELL. WDYT? > A minor nit: environment variables should have the @env markup, not > @code. Will fix. > I think this warrants a NEWS entry. Will write. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/