From patchwork Wed Aug 14 14:06:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 34083 Received: (qmail 50087 invoked by alias); 14 Aug 2019 14:07:04 -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 50075 invoked by uid 89); 14 Aug 2019 14:07:04 -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, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr10043.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Aug 2019 14:06:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U2DvNBtumhg3Os60Aw6zTysbtd22PkXLPZcE/Tmc2pc=; b=9CZ2CsqtLU/jPjiEyHbHOwIf+ywZUtI1J2w3U5Fwuqh5LSGcNjxVgs09mFH8qz4HD98q0jVgRqm74DFuMWq1d85UnUvBBVzqrwDv0TNht9DFKsQAyYm/pspcs3IGkuMbpkFzqAknewtEIkEB0+rOZy849IvaRPFtS+9+k+bhJEE= Received: from DB6PR0802CA0025.eurprd08.prod.outlook.com (2603:10a6:4:a3::11) by HE1PR0801MB1850.eurprd08.prod.outlook.com (2603:10a6:3:86::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.21; Wed, 14 Aug 2019 14:06:49 +0000 Received: from AM5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::202) by DB6PR0802CA0025.outlook.office365.com (2603:10a6:4:a3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.15 via Frontend Transport; Wed, 14 Aug 2019 14:06:48 +0000 Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT022.mail.protection.outlook.com (10.152.16.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.18 via Frontend Transport; Wed, 14 Aug 2019 14:06:47 +0000 Received: ("Tessian outbound 578a71fe5eaa:v26"); Wed, 14 Aug 2019 14:06:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3d2e86fbdecb142e X-CR-MTA-TID: 64aa7808 Received: from 3ae9f56aef0e.2 (cr-mta-lb-1.cr-mta-net [104.47.5.58]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 706AD99E-71AA-473B-93A5-D9606A947D2A.1; Wed, 14 Aug 2019 14:06:42 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02lp2058.outbound.protection.outlook.com [104.47.5.58]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3ae9f56aef0e.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 14 Aug 2019 14:06:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GnMDt60ARS7T7vy1ibj86THcTnyzLrSeaa02c2/J6ytWBTRg0yP08e2+lGimVZC/ujmrdVG2eiU17bUlGi49S6aLnvw0JjsWtRSBPCDw/7PNGg34H6GW7/gYF53GPSWCBN88ObSE+onwpiyuqHcIiaFLQwx4GN9l6WcsxOTYYjgQu++w8YEPJJ7RKztLPlqokbmFCThCkQDdPjUE68RYHY56/y1YUaOCGq7b/giFND7jSX2ghoUFtGsRG5t1Rr6HQ50SjojGPHFrD+0/LVzXDm0RkDZ/Qw6JqPaLrgmQ7f/7qqGjwYOBrgXkVjd7n1VZH9kwCRIifD11hmVxi2rifQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U2DvNBtumhg3Os60Aw6zTysbtd22PkXLPZcE/Tmc2pc=; b=Q//Tds0xojID2riwpYty1RKMKLS/6hUEVYJY+uH568WBU3Q9AWio7z9/nkIvNUuEWn3hLqFXtH18lK5SMxHs3O3urdY1PiWRg3TTOPBJ8KGLeFRXgFDqTklod68PzuP6c3ACF645ZFp8NZ6Vm35zGnd6c/xH5rGqjN6uXUcGRTJOU0qOQEN1NGpj4/qEsrihlT6gFvJme97PP4rVr9tEWsiBVjSRPBBCwDGX3wtNYMgT96KRLkg+FL4K6sOm97G22o/4m656SXTDjWfOm7Rtfjqrde42+5GinBbt1qt+JjNT2RVUH4H8UfM9KjlxJUHJqOpOEkt66ZEh7WYEymVeeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U2DvNBtumhg3Os60Aw6zTysbtd22PkXLPZcE/Tmc2pc=; b=9CZ2CsqtLU/jPjiEyHbHOwIf+ywZUtI1J2w3U5Fwuqh5LSGcNjxVgs09mFH8qz4HD98q0jVgRqm74DFuMWq1d85UnUvBBVzqrwDv0TNht9DFKsQAyYm/pspcs3IGkuMbpkFzqAknewtEIkEB0+rOZy849IvaRPFtS+9+k+bhJEE= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2469.eurprd08.prod.outlook.com (10.172.250.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.20; Wed, 14 Aug 2019 14:06:40 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::5ce5:cf42:42dd:eda1]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::5ce5:cf42:42dd:eda1%6]) with mapi id 15.20.2157.022; Wed, 14 Aug 2019 14:06:40 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH] Fix stop-on-solib event failures Date: Wed, 14 Aug 2019 14:06:40 +0000 Message-ID: <20190814140638.15319-1-alan.hayward@arm.com> Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; X-Microsoft-Antispam-Untrusted: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB6PR0802MB2469; x-ms-exchange-transport-forked: True x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(366004)(376002)(136003)(396003)(199004)(189003)(54534003)(6116002)(2906002)(66556008)(86362001)(53936002)(64756008)(3846002)(6486002)(26005)(186003)(66946007)(14454004)(2351001)(66476007)(6506007)(478600001)(25786009)(4326008)(66446008)(102836004)(66066001)(6916009)(386003)(5660300002)(44832011)(81156014)(81166006)(71200400001)(99286004)(8676002)(256004)(486006)(476003)(1076003)(2501003)(71190400001)(305945005)(5640700003)(316002)(50226002)(52116002)(6436002)(36756003)(54906003)(6512007)(7736002)(2616005)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2469; H:DB6PR0802MB2133.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: Mu+mMbISSxEmykh2G/xYi5MRfkDwS5ZEY8/7NnVB1A2I1xFAj3Oj6Lp/1JD/2n+qVbKPFMqGtYrNcBY8kpkqiOeFH72V+i9aRjHSfS/lg6TMn8liisE96keGRA8Yx7gXcmYkhkcLGscmaEqyJ23kMZ2TUFQkfdsL9bOzZgPlnDAn/rvlDVHnUX6870XBrWM0LneyNxJjKD42YXNZw0nrucCehtOOlcHx+ZiZlkel89WNzJprHO78KlqQ82ZlYluDfP4k8y/rDT97dCJi7D9dEiQHkeS0RpYZA1l3f2STGXCS/JHYXzfl/BTTO9uw7+gGDN5utBTxFgpTcYL4X/YiTxhAbVXJOqpl/PDB5sOrTQzY1m3f/QCzpKPyrgn/v70ol19y3m1wZRrC4MMlulgmhaZlt0Lzmz2h4T+8KUiAGRc= MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; Return-Path: Alan.Hayward@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f49a57c3-cb6b-420a-41df-08d720c0a122 X-IsSubscribed: yes [ This patch replaces "[PATCH] testsuite: disable break-interp.exp for Arm buildbot". Instead of working around the issue, this fixes the issues. ] On some Arm targets (namely the buildbot Arm Docker setup) placing breakpoints on just the solib dynamic probes will cause the target process to not stop. For stop-on-solib to work, a breakpoint also needs placing at the original stop address. This is due to bad placing of the probe addresses in the linker. This prevents over 100 timeouts when running gdb.base/break-interp.exp. In addition, the gdb.base/break-interp.exp test has a extra step that is only required for ppc64 targets. However on Ubuntu X86 and AArch64, this causes the program to now be stopped in an unknown location. The fix here is to ensure the ppc64 step is only run on ppc64 targets. This fixes a long standing issue. gdb/ChangeLog: 2019-08-14 Alan Hayward * solib-svr4.c (svr4_create_solib_event_breakpoints): Always create original breakpoint. gdb/testsuite/ChangeLog: 2019-08-14 Alan Hayward * gdb.base/break-interp.exp: Only run ppc64 step on ppc64. --- gdb/solib-svr4.c | 18 ++++++++---------- gdb/testsuite/gdb.base/break-interp.exp | 9 ++++----- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index c0c505acaa..d755832bbf 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -2066,20 +2066,20 @@ svr4_create_probe_breakpoints (svr4_info *info, struct gdbarch *gdbarch, purpose of this method is to allow debuggers to set a breakpoint so they can track these changes. - Some versions of the glibc dynamic linker contain named probes - to allow more fine grained stopping. Given the address of the - original marker function, this function attempts to find these - probes, and if found, sets breakpoints on those instead. If the - probes aren't found, a single breakpoint is set on the original - marker function. */ + A single breakpoint will be placed on the given ADDRESS. + + In addition, some versions of the glibc dynamic linker contain named probes + to allow more fine grained stopping. Given the address of the original + marker function, this function attempts to find these probes, and if found, + sets breakpoints on those as well. */ static void svr4_create_solib_event_breakpoints (svr4_info *info, struct gdbarch *gdbarch, CORE_ADDR address) { - struct obj_section *os; + create_solib_event_breakpoint (gdbarch, address); - os = find_pc_section (address); + struct obj_section *os = find_pc_section (address); if (os != NULL) { int with_prefix; @@ -2143,8 +2143,6 @@ svr4_create_solib_event_breakpoints (svr4_info *info, struct gdbarch *gdbarch, return; } } - - create_solib_event_breakpoint (gdbarch, address); } /* Helper function for gdb_bfd_lookup_symbol. */ diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp index d6da653529..5caa5ecdf3 100644 --- a/gdb/testsuite/gdb.base/break-interp.exp +++ b/gdb/testsuite/gdb.base/break-interp.exp @@ -131,7 +131,8 @@ proc reach_1 {func command displacement} { set test "reach" set test_displacement "seen displacement message as $displacement" - set debug_state_count 0 + # First stop does not yet relocate the _start descriptor on ppc64. + set debug_state_count [istarget "powerpc64-*-linux*"] gdb_test_multiple $command $test { -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " { # Missing "$gdb_prompt $" is intentional. @@ -164,10 +165,8 @@ proc reach_1 {func command displacement} { } -re "Stopped due to (spurious )?shared library event.*\r\n$gdb_prompt $" { if {$func == $solib_bp} { - if {$debug_state_count == 0} { - # First stop does not yet relocate the _start function - # descriptor on ppc64. - set debug_state_count 1 + if {$debug_state_count == 1} { + set debug_state_count 0 send_gdb "continue\n" exp_continue } else {