From patchwork Tue May 14 15:12:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 32683 Received: (qmail 60844 invoked by alias); 14 May 2019 15:13:01 -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 60763 invoked by uid 89); 14 May 2019 15:13:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MIME_BASE64_BLANKS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=16646 X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-eopbgr150077.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (40.107.15.77) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 May 2019 15:12:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=75bkIgSXQ4mBeGRp99XX/UoWILf+0qSLo+y4HFTFpE8=; b=nXDaSzQB39QKK3YM+zZDRdGOEBXAwfs9AY0u3G1lXD/HCLw7H5k/bWanximeGUc8Lo3xf2nkp4MBHzZoWkB6+loH0nSd1OWt8hPUA2WcfSfNL3fEQRHjBXSbauTvCUPGlZu92ElZxynZVnph84ijHQtusp/XvkjfzM/ysmkq7Hc= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2535.eurprd08.prod.outlook.com (10.172.251.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.24; Tue, 14 May 2019 15:12:47 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::8c26:bb4b:6c93:9d40]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::8c26:bb4b:6c93:9d40%2]) with mapi id 15.20.1878.024; Tue, 14 May 2019 15:12:47 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH 6/9] testsuite: Create .cmd files for gdb and gdbserver Date: Tue, 14 May 2019 15:12:47 +0000 Message-ID: <20190514151238.8765-7-alan.hayward@arm.com> References: <20190514151238.8765-1-alan.hayward@arm.com> In-Reply-To: <20190514151238.8765-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-oob-tlc-oobclassifiers: OLM:7691; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-IsSubscribed: yes When spawning gdb or gdbserver create a .cmd file in the test output directory containing the full command line, ensuring the current gdb instance is appened to the files so that they can be quickly matched to the corresponding gdb.in file. gdb/testsuite/ChangeLog: 2019-05-14 Alan Hayward * lib/gdb.exp (default_gdb_spawn): Call gdb_write_cmd_file. (gdb_write_cmd_file): New procedure. * lib/gdbserver-support.exp (gdbserver_start): Call gdbserver_write_cmd_file. (gdbserver_write_cmd_file): New proedure. --- gdb/testsuite/lib/gdb.exp | 10 ++++++++++ gdb/testsuite/lib/gdbserver-support.exp | 11 +++++++++++ 2 files changed, 21 insertions(+) -- 2.20.1 (Apple Git-117) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3815f86ffc8..cbf8d29ec12 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1664,6 +1664,7 @@ proc default_gdb_spawn { } { set use_gdb_stub [target_info exists use_gdb_stub] verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS" + gdb_write_cmd_file "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS" if [info exists gdb_spawn_id] { return 0 @@ -6540,5 +6541,14 @@ proc gdb_stdin_log_write { message {type standard} } { puts -nonewline $in_file "$message" } +# Write the command line used to invocate gdb to the cmd file. + +proc gdb_write_cmd_file { cmdline } { + set logfile [standard_output_file_with_gdb_instance gdb.cmd] + set cmd_file [open $logfile w] + puts $cmd_file $cmdline + catch "close $cmd_file" +} + # Always load compatibility stuff. load_lib future.exp diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 164a1d1d3cd..54aa55771c1 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -319,6 +319,8 @@ proc gdbserver_start { options arguments } { append gdbserver_command " $arguments" } + gdbserver_write_cmd_file $gdbserver_command + global server_spawn_id set server_spawn_id [remote_spawn target $gdbserver_command] @@ -597,3 +599,12 @@ proc gdbserver_debug_enabled { } { return [expr { $gdbserverdebug == "debug" || $gdbserverdebug == "remote" || $gdbserverdebug == "all" }] } + +# Write the command line used to invocate gdbserver to the cmd file. + +proc gdbserver_write_cmd_file { cmdline } { + set logfile [standard_output_file_with_gdb_instance gdbserver.cmd] + set cmd_file [open $logfile w] + puts $cmd_file $cmdline + catch "close $cmd_file" +}