From patchwork Mon Aug 22 14:57:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 14847 Received: (qmail 120390 invoked by alias); 22 Aug 2016 14:57:42 -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 120380 invoked by uid 89); 22 Aug 2016 14:57:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pf0-f195.google.com Received: from mail-pf0-f195.google.com (HELO mail-pf0-f195.google.com) (209.85.192.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Aug 2016 14:57:31 +0000 Received: by mail-pf0-f195.google.com with SMTP id y134so6497307pfg.3 for ; Mon, 22 Aug 2016 07:57:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=U4WPC6jnNCNdgTbzBRgw7lhfLsVpa+J1uIipgaj2G5Y=; b=aSubpB7ue2EZWsCzBcHkLyK6NG6q2e3Yeyi9iK2q+ky1GicmIwnqYDukQshmC+4qMB 5dBj6Ys/vqx2wBz3Dv80jKk+TiCr5nYufrA+kSRQuJtinNIIh5QaKzWaptUCfMlL937S F8HIWQ/Y+26QgSSQ2qa7AJtwy7eIxHaqMVpnfCaLcTT7cS82SDXx/mLuC8vI9LnGvDfW D1vSnWxayKWUvGdQ1bCIanbZMxEdaQK+JqRpbbpjNETEV4h4QInLPK9seRDC6lXSZlJC Y+4m1VatViitysCza2c1CAVtyF72+7UTxKtFJslOXDzvZtpgebExG0tYeCtTiB0QctkQ rEtQ== X-Gm-Message-State: AEkoousXR0n7cxQriHenQUTahDGke1cC6sq0f3WC3EH35n8LaD9uVqR0XFNwy+WmoJV/Pw== X-Received: by 10.98.149.22 with SMTP id p22mr43321374pfd.88.1471877850320; Mon, 22 Aug 2016 07:57:30 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc115.osuosl.org. [140.211.9.73]) by smtp.gmail.com with ESMTPSA id 72sm27947830pfs.51.2016.08.22.07.57.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Aug 2016 07:57:29 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] gdbserver_spawn "" rather than gdbserver_spawn ${binfile} Date: Mon, 22 Aug 2016 15:57:25 +0100 Message-Id: <1471877845-1158-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Hi, I happen to see gdbserver is spawned like this in gdb.log, spawn /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2346 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.s erver/connect-stopped-target/connect-stopped-target /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/connect-stopped-target/connect-stopped-t arget spawn /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/../../gdb/gdbserver/gdbserver --once :2347 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.s erver/connect-stopped-target/connect-stopped-target /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.server/connect-stopped-target/connect-stopped-t arget as we can see, there are two instances of connect-stopped-target or connect-stopped-target in the command line spawning gdbserver, but none of these gets parameters from command line. In these two tests, gdbserver is spawned via "gdbserver_spawn ${binfile}". However, the argument of gdbserver_spawn is the argument passed the child inferior, not the program itself. # Start a gdbserver process running SERVER_EXEC, and connect GDB # to it. CHILD_ARGS are passed to the inferior. # # Returns the target protocol and socket to connect to. proc gdbserver_spawn { child_args } { set target_exec [gdbserver_download_current_prog] GDBserver gets the program via last_loaded_file, which is set by gdb_file_cmd. In each test, we don't need to pass ${binfile}. gdb/testsuite: 2016-08-22 Yao Qi * gdb.server/connect-stopped-target.exp (do_test): Pass "" to gdbserver_spawn. * gdb.server/connect-without-multi-process.exp (do_test): Likewise. --- gdb/testsuite/gdb.server/connect-stopped-target.exp | 2 +- gdb/testsuite/gdb.server/connect-without-multi-process.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.server/connect-stopped-target.exp b/gdb/testsuite/gdb.server/connect-stopped-target.exp index b083d89..9e445b0 100644 --- a/gdb/testsuite/gdb.server/connect-stopped-target.exp +++ b/gdb/testsuite/gdb.server/connect-stopped-target.exp @@ -44,7 +44,7 @@ proc do_test {nonstop} { gdb_test "set non-stop $nonstop" - set res [gdbserver_spawn ${binfile}] + set res [gdbserver_spawn ""] set gdbserver_protocol [lindex $res 0] set gdbserver_gdbport [lindex $res 1] diff --git a/gdb/testsuite/gdb.server/connect-without-multi-process.exp b/gdb/testsuite/gdb.server/connect-without-multi-process.exp index 79d7d72..2e9769b 100644 --- a/gdb/testsuite/gdb.server/connect-without-multi-process.exp +++ b/gdb/testsuite/gdb.server/connect-without-multi-process.exp @@ -41,7 +41,7 @@ proc do_test {multiprocess} { gdb_test_no_output "set remote multiprocess-feature $multiprocess" - set res [gdbserver_spawn ${binfile}] + set res [gdbserver_spawn ""] set gdbserver_protocol [lindex $res 0] set gdbserver_gdbport [lindex $res 1]