From patchwork Wed Mar 27 16:40:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 32009 Received: (qmail 127157 invoked by alias); 27 Mar 2019 16:40:36 -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 127148 invoked by uid 89); 27 Mar 2019 16:40:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=connecting, drops, listening, reduces X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr130070.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (40.107.13.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Mar 2019 16:40:34 +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=BEuVflLZt93rKQONaTacRy7G2ripO1bqA1UwQAkKTUg=; b=o+2trIk6RFGbNnTdcFZRjjUBJz3aeDfjdfRsJB/A3CL/F1BszzJKGsk8zjSW1gykZVP3+1grKw+gD+3Kg7bupxp7ULIbUbacTB6D0Tbr1ugp/K+3qWBiOIdFMLj4nuC5P3h+X1R20mEGdkB0fF0UYegN3Qd5D9rEkTy3KythU1k= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2280.eurprd08.prod.outlook.com (10.172.225.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Wed, 27 Mar 2019 16:40:31 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::d122:4a29:4ae4:790c]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::d122:4a29:4ae4:790c%10]) with mapi id 15.20.1750.014; Wed, 27 Mar 2019 16:40:31 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [RFC/PATCH] Testsuite: set sysroot when using gdbserver Date: Wed, 27 Mar 2019 16:40:30 +0000 Message-ID: <20190327164025.48105-1-alan.hayward@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; 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 testing using native-gdbserver and native-extended-gdbserver, the sysroot is not set. This results in a warning from GDB and files are sent via the remote protocol, which can be slow. On Ubuntu 18.04 (unlike most distros) the debug versions of the standard libraries are included by default in /usr/lib/debug/ Example log of a test on Ubuntu 18.04 AArch64: Listening on port 2346 target remote localhost:2346 Remote debugging using localhost:2346 Reading /lib/ld-linux-aarch64.so.1 from remote target... warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead. Reading /lib/ld-linux-aarch64.so.1 from remote target... Reading symbols from target:/lib/ld-linux-aarch64.so.1... Reading /lib/ld-2.27.so from remote target... Reading /lib/.debug/ld-2.27.so from remote target... Reading /usr/lib/debug//lib/ld-2.27.so from remote target... Reading /usr/lib/debug/lib//ld-2.27.so from remote target... Reading target:/usr/lib/debug/lib//ld-2.27.so from remote target... (No debugging symbols found in target:/lib/ld-linux-aarch64.so.1) 0x0000ffffbf6d31c0 in ?? () from target:/lib/ld-linux-aarch64.so.1 (gdb) continue Continuing. Reading /lib/aarch64-linux-gnu/libc.so.6 from remote target... Reading /lib/aarch64-linux-gnu/libc-2.27.so from remote target... Reading /lib/aarch64-linux-gnu/.debug/libc-2.27.so from remote target... Reading /usr/lib/debug//lib/aarch64-linux-gnu/libc-2.27.so from remote target... Reading /usr/lib/debug//lib/aarch64-linux-gnu/libc-2.27.so from remote target... These file reads are causing a complete native-gdbserver run on the AArch64 buildbot slave to timeout after 2.5 hours. This is also causing the builds to back up on the slave. The solution is to ensure the sysroot is set to / immediately after connecting. This drastically reduces the time of a test. For example, gdb.base/sigall.exp drops from 23 seconds to 4 seconds. A full native-gdbserver run on the AArch64 slave now takes 8 minutes. However, I'm not sure if putting the sysroot into gdbserver_start will break other remote setups. In addition, I don't think gdb_test is the correct function to call within the library - for the mi tests this causes a timeout as it expect to use mi_gdb_test. gdb/testsuite/ChangeLog: 2019-03-27 Alan Hayward * lib/gdbserver-support.exp (gdbserver_start): Set sysroot. --- gdb/testsuite/lib/gdbserver-support.exp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index dbd885aa22..065946eb8d 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -336,6 +336,9 @@ proc gdbserver_start { options arguments } { break } + # Set sysroot to ensure files are read locally instead of via the remote protocol + gdb_test "set sysroot /" "" + return [list $protocol [$get_remote_address $debughost $portnum]] }