From patchwork Thu Oct 12 22:10:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23519 Received: (qmail 12384 invoked by alias); 12 Oct 2017 22:10:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 12373 invoked by uid 89); 12 Oct 2017 22:10:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 12 Oct 2017 22:10:15 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82651C04D2B3 for ; Thu, 12 Oct 2017 22:10:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 82651C04D2B3 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 112E860635 for ; Thu, 12 Oct 2017 22:10:13 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Make gdb.base/auvx.exp work with --target_board=native-extended-gdbserver Date: Thu, 12 Oct 2017 23:10:13 +0100 Message-Id: <1507846213-11892-1-git-send-email-palves@redhat.com> Currently we get: Running .../src/gdb/testsuite/gdb.base/auxv.exp ... WARNING: can't generate a core file - core tests suppressed - check ulimit -c After this commit we get all the same PASSes as when native testing. The problem is that the testcase wants to create a core dump in a temporary directory and it is using the "cd" command to start the inferior with that directory as current directory, but that command only affects the inferior's cwd when native debugging. Fix it by using using the new "set cwd" command instead, which works with gdbserver as well. This still won't work with stub-like targets, because with those when we connect the inferior is already running. It'd be possible to make it work by making the inferior itself change dirs, but we'll need to make the native-gdbserver board no longer set is_remote first. gdb/testsuite/ChangeLog: 2017-10-12 Pedro Alves * gdb.base/auvx.exp (coredir): Update comment. (top level) : Use "set cwd" command instead of "cd" command. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/auxv.exp | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3d2df7d..de9a852 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,10 @@ 2017-10-12 Pedro Alves + + * gdb.base/auvx.exp (coredir): Update comment. + (top level) : Use "set cwd" command instead of "cd" + command. + +2017-10-12 Pedro Alves Simon Marchi * gdb.base/catch-fork-static.exp: No longer skip on is_remote diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp index 833a1fd..bc70b85 100644 --- a/gdb/testsuite/gdb.base/auxv.exp +++ b/gdb/testsuite/gdb.base/auxv.exp @@ -38,7 +38,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ } # Use a fresh directory to confine the native core dumps. -# Make it the working directory for gdb and its child. +# Make it the working directory for the inferior. set coredir [standard_output_file coredir.[getpid]] file mkdir $coredir set core_works [expr [isnative] && ! [is_remote target]] @@ -50,8 +50,8 @@ gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set width 0" if {$core_works} { - if {[gdb_test "cd $coredir" ".*Working directory .*" \ - "cd to temporary directory for core dumps"]} { + if {[gdb_test_no_output "set cwd $coredir" \ + "set cwd to temporary directory for core dumps"]} { set core_works 0 } }