From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24407 invoked by alias); 22 Sep 2017 10:47:20 -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 24397 invoked by uid 89); 22 Sep 2017 10:47:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3416 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; Fri, 22 Sep 2017 10:47:18 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBAAC806AC for ; Fri, 22 Sep 2017 10:47:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBAAC806AC Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id B720B62679; Fri, 22 Sep 2017 10:47:13 +0000 (UTC) Subject: Re: [PATCH v2 5/5] Extend "set cwd" to work on gdbserver To: Sergio Durigan Junior References: <20170912042325.14927-1-sergiodj@redhat.com> <20170919042842.9210-1-sergiodj@redhat.com> <20170919042842.9210-6-sergiodj@redhat.com> <2a0b74f9-d0e8-cd82-dfcc-9b2459a79c53@redhat.com> <87shfh3p8y.fsf@redhat.com> Cc: GDB Patches From: Pedro Alves Message-ID: Date: Fri, 22 Sep 2017 10:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87shfh3p8y.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00668.txt.bz2 On 09/21/2017 12:49 AM, Sergio Durigan Junior wrote: > On Wednesday, September 20 2017, Pedro Alves wrote: >> This all looks stale to me. > > Indeed, sorry about this mistake. I will rewrite the entry as follows: > > * New features in the GDB remote stub, GDBserver > > ** GDBserver is now able to enter a directory before starting an > inferior. > > The user can set the desired working directory to be used by the > remote inferior on GDB, using the new "set cwd" command, which > will instruct GDB to tell GDBserver about this directory change > the next time an inferior is run. I still think this is talking too much in terms of implementation detail, but I'll reply again to v3. >>> --- a/gdb/testsuite/gdb.base/set-cwd.exp >>> +++ b/gdb/testsuite/gdb.base/set-cwd.exp >>> @@ -15,10 +15,16 @@ >>> # You should have received a copy of the GNU General Public License >>> # along with this program. If not, see . >>> >>> -if { ![isnative] || [is_remote target] || [is_remote host] >>> - || [target_info gdb_protocol] == "extended-remote" } then { >>> - untested "not implemented on gdbserver" >>> - return >>> +if { [target_info exists gdb_protocol] } { >>> + if { [target_info gdb_protocol] == "remote" } { >>> + untested "not implemented on native-gdbserver" >>> + return >>> + } >>> + >>> + load_lib gdbserver-support.exp >>> + if { [skip_gdbserver_tests] } { >>> + return >>> + } >>> } >> >> This drops the is_remote host and target checks, but the test is >> using "$::env(HOME)", so it really can't work when >> remote-host/target testing, because that is accessing HOME in the >> build machine (where dejagnu runs) not of the host machine >> (where gdb runs) or the target machine (where gdbserver runs): >> >> proc test_tilde_expansion { } { >> if { [info exists ::env(HOME)] } { >> with_test_prefix "test tilde expansion" { >> set home $::env(HOME) > > OK, that makes sense, but I wasn't aware that there is a problem between > "host" and "build" machines. This is becoming absurdly confuse to me, > sorry. We've discussed this off list already. > > In this case, I'd have to check for ![is_remote host], is that right? > >> I don't understand the explicit check for gdbserver in >> skip_gdbserver_tests. > > I was thinking of the following scenario: > > - The users wants to skip gdbserver tests > > - He runs the test as "make check-gdb TESTS=gdb.base/set-cwd.exp" > > - Because of the unconditional call to "skip_gdbserver_tests", the test > doesn't run at all, even though the test *should* run because the user > hasn't specified any remote board, etc. And that's what I don't understand at all. skip_gdbserver_tests is useful for the gdb.server/ tests that spawn gdbserver even if testing with the local/unix board, i.e., the native target. But this testcase isn't spawning gdbserver manually, unlike e.g., the gdb.server/ tests. It just runs against whatever target is specified by --target_board. > >> Seems to me that instead of that, and the "remote" check we should skip >> the test if use_gdb_stub, because that's what indicates that when you >> connect to a target, you're already debugging something, like with >> plain remote debugging. > > OK, so a simple check to "[use_gdb_stub]" would suffice, you say? That > doesn't solve the problem with calling ::env above, right? Thanks, Pedro Alves