From patchwork Fri Oct 13 11:16:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 23532 Received: (qmail 120160 invoked by alias); 13 Oct 2017 11:16:27 -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 119605 invoked by uid 89); 13 Oct 2017 11:16:26 -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 11:16:25 +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 4F81D4B70C for ; Fri, 13 Oct 2017 11:16:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4F81D4B70C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.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 B175718E4C for ; Fri, 13 Oct 2017 11:16:23 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Tweak gdb.base/corefile.exp is_remote check Date: Fri, 13 Oct 2017 12:16:22 +0100 Message-Id: <1507893382-17646-1-git-send-email-palves@redhat.com> 1. Otherwise, when we make native-gdbserver board no longer is_remote, we get: Running .../src/gdb/testsuite/gdb.base/corefile.exp ... ERROR: tcl error sourcing .../src/gdb/testsuite/gdb.base/corefile.exp. ERROR: gdbserver does not support attach 9327 without extended-remote while executing "error "gdbserver does not support $command without extended-remote"" That's fixed by using can_spawn_for_attach instead. 2. The gdb_protocol check fixes this current problem with --target_board=extended-remote-gdbserver: Running .../src/gdb/testsuite/gdb.base/corefile.exp ... FAIL: gdb.base/corefile.exp: run: with core FAIL: gdb.base/corefile.exp: run: core file is cleared FAIL: gdb.base/corefile.exp: attach: with core FAIL: gdb.base/corefile.exp: attach: core file is cleared gdb.log: (...) attach 10859 Don't know how to attach. Try "help target". (...) The fix for #2 alone would fix #1 too, but can_spawn_for_attach expresses the requirement directly, so I still left it there. gdb/testsuite/ChangeLog: 2017-10-13 Pedro Alves * gdb.base/corefile.exp (corefile_test_run): Skip if gdb_protocol is set. (corefile_test_attach): Likewise. Check can_spawn_for_attach instead of is_remote. --- gdb/testsuite/ChangeLog | 7 +++++++ gdb/testsuite/gdb.base/corefile.exp | 20 +++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 117ab9b..3532ed3 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2017-10-13 Pedro Alves + * gdb.base/corefile.exp (corefile_test_run): Skip if gdb_protocol + is set. + (corefile_test_attach): Likewise. Check can_spawn_for_attach + instead of is_remote. + +2017-10-13 Pedro Alves + * gdb.base/remote.exp: Check gdb_protocol instead of is_remote. (top level): Add comment. diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index 21b974f..9be4aef 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -188,6 +188,15 @@ gdb_test "core" "No core file now." proc corefile_test_run {} { global corefile gdb_prompt + # This test is trying to check whether the "run" command finds the + # default run target when already debugging a core, so it would + # fail on boards that set auto-connect-native-target off. Since + # there's no real point in running the test but with the native + # target, it's easier to just skip elsewhere. + if {[target_info gdb_protocol] != ""} { + return + } + gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again" gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file" @@ -244,7 +253,16 @@ gdb_exit proc corefile_test_attach {} { global binfile corefile gdb_prompt - if ![is_remote target] { + # This test is checking whether the "attach" command finds the + # default run target when already debugging a core, so it would + # fail on boards that set auto-connect-native-target off. Since + # there's no real point in running the test but with the native + # target, it's easier to just skip elsewhere. + if {[target_info gdb_protocol] != ""} { + return + } + + if [can_spawn_for_attach] { set test "attach: spawn sleep" set res [remote_spawn host "$binfile sleep"] if { $res < 0 || $res == "" } {