From patchwork Wed Jul 11 17:06:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 28319 Received: (qmail 82070 invoked by alias); 11 Jul 2018 17:06:22 -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 82061 invoked by uid 89); 11 Jul 2018 17:06:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=complaining X-HELO: mail-wm0-f43.google.com Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jul 2018 17:06:20 +0000 Received: by mail-wm0-f43.google.com with SMTP id 69-v6so3295922wmf.3 for ; Wed, 11 Jul 2018 10:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id; bh=dpl36o1msh1kqq+sxVKWqPGzmfBApEvZ946f+8Ivoew=; b=VTZySndU1W0+5oTDn2E+BLmGNcXRKokg6Zoxz4Ro/wtxpMgASNCLvmzgXH5djj0pxT w5TkLV2JJPE5POSet00rpP43SF7kVhE9P7pb3LRkPc+PYIy/ETg6WeKh9cBxpGhH5Or6 zsYeFzjhck4D8mGCdBotlshJfyVZ9BHki4vTfY8vPR3rVXbnnF40c+XmMex3MhaflfIM 6dH0EEcQ94d7w2mx/ttSP6NX0fC1OclRUx7FcqLEE+l6ha60QVuhFqmtRDodSci+qFbi XXm4E8vvk4xp9AvuPNRSim6umw+Q22gSnkJ6IvbLwHuzgoftkQzFP4CSfyhVvbm2qpwc wKtw== Return-Path: Received: from localhost (host86-164-199-62.range86-164.btcentralplus.com. [86.164.199.62]) by smtp.gmail.com with ESMTPSA id t184-v6sm3003471wmf.18.2018.07.11.10.06.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 10:06:17 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH] gdb: Don't call gdb_load_shlib unless GDB is running Date: Wed, 11 Jul 2018 18:06:12 +0100 Message-Id: <20180711170612.25873-1-andrew.burgess@embecosm.com> X-IsSubscribed: yes The gdb_load_shlib function will, on remote targets, try to run some GDB commands. This obviously isn't going to work unless GDB is running. The gdb.trace/tspeed.exp test calls gdb_load_shlib before starting GDB. Don't do that. The failure that's triggered is actually DeJaGNU complaining that the variable $use_gdb_stub doesn't exist, this is only created when GDB is started. Something like this should trigger a failure: make check-gdb \ RUNTESTFLAGS="--target_board=remote-gdbserver-on-localhost \ gdb.trace/tspeed.exp" gdb/testsuite/ChangeLog: * gdb.trace/tspeed.exp: Only call gdb_load_shlib after gdb has started. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.trace/tspeed.exp | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp index ecd36d2d9bd..47a82502a00 100644 --- a/gdb/testsuite/gdb.trace/tspeed.exp +++ b/gdb/testsuite/gdb.trace/tspeed.exp @@ -19,7 +19,6 @@ standard_testfile set executable $testfile set ipalib [get_in_proc_agent] -gdb_load_shlib $ipalib if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable [concat {debug nowarnings c} shlib=$ipalib]] != "" } { @@ -41,6 +40,7 @@ proc prepare_for_trace_test {} { global executable clean_restart $executable + gdb_load_shlib $ipalib runto_main @@ -126,6 +126,8 @@ proc gdb_trace_collection_test {} { } clean_restart $executable +gdb_load_shlib $ipalib + runto_main if { ![gdb_target_supports_trace] } then {