From patchwork Fri Oct 13 09:37:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23529 Received: (qmail 123789 invoked by alias); 13 Oct 2017 09:37:04 -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 123239 invoked by uid 89); 13 Oct 2017 09:37:04 -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; Fri, 13 Oct 2017 09:37:03 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDD4881DF8 for ; Fri, 13 Oct 2017 09:37:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BDD4881DF8 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.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 2733C612A2 for ; Fri, 13 Oct 2017 09:37:00 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Make gdb.base/solib-nodir.exp work with --target_board=native-extended-gdbserver Date: Fri, 13 Oct 2017 10:37:00 +0100 Message-Id: <1507887420-9230-1-git-send-email-palves@redhat.com> Fixes: Running .../src/gdb/testsuite/gdb.base/solib-nodir.exp ... FAIL: gdb.base/solib-nodir.exp: library loaded ... by using the new "set cwd" command. gdb/testsuite/ChangeLog: 2017-10-13 Pedro Alves Simon Marchi * gdb.base/solib-nodir.exp: Split is_remote and skip_shlib_tests calls and add comments. Skip test if use_gdb_stub is set. (top level): Use "set cwd" command instead of "cd" command. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.base/solib-nodir.exp | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9aac613..b37da2a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,11 @@ 2017-10-13 Pedro Alves + Simon Marchi + + * gdb.base/solib-nodir.exp: Split is_remote and skip_shlib_tests + calls and add comments. Skip test if use_gdb_stub is set. + (top level): Use "set cwd" command instead of "cd" command. + +2017-10-13 Pedro Alves * gdb.base/shlib-call.exp (top level): Use gdb_run_cmd and remove is_remote target check. diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp index 9cb682e..15673d1 100644 --- a/gdb/testsuite/gdb.base/solib-nodir.exp +++ b/gdb/testsuite/gdb.base/solib-nodir.exp @@ -13,8 +13,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . */ -# are we on a target board -if {[is_remote target] || [skip_shlib_tests]} { +if [skip_shlib_tests] { + return +} + +# The testcase assumes the target can access the OBJDIR. +if [is_remote target] { + return +} + +# We need to be able to influence the target's environment and working +# directory. Can't do that if when we connect the inferior is already +# running. +if [target_info exists use_gdb_stub] { return } @@ -44,7 +55,8 @@ clean_restart $executable gdb_load_shlib ${binlibfile} gdb_test_no_output "set env LD_LIBRARY_PATH=:" -gdb_test "cd ${binlibfiledir}" "Working directory [string_to_regexp ${binlibfiledir}]\\." "cd OBJDIR/${subdir}" +gdb_test_no_output "set cwd ${binlibfiledir}" \ + "set cwd OBJDIR/${subdir}" set test "library loaded" if [runto_main] {