From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2044.outbound.protection.outlook.com [40.107.7.44]) by sourceware.org (Postfix) with ESMTPS id 4BFED3858D28 for ; Fri, 10 Feb 2023 14:58:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BFED3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com 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=CHCOpTNLn7Lg3aw3/umeJ6Wxen5RmIrpPSYumnPOy84=; b=XFx9I9VORGAfgrOPH3P6AIJ83ZAUrdxxhzmqLZDpkMyk7zvLvwSkCNTUKsWlYqfrw6zYAq72QVJwKpfBovPfE/yRjS5eiYjizM65ASmSX9r7vJg9orXGdVgm7kzDDbViv5sNA4nZK87dQOUeAhqdpssjV3zQh/0oaXtPKiOkfnA= Received: from DUZPR01CA0213.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b4::27) by AS8PR08MB6181.eurprd08.prod.outlook.com (2603:10a6:20b:29a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 14:58:38 +0000 Received: from DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b4:cafe::4) by DUZPR01CA0213.outlook.office365.com (2603:10a6:10:4b4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19 via Frontend Transport; Fri, 10 Feb 2023 14:58:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT048.mail.protection.outlook.com (100.127.142.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.21 via Frontend Transport; Fri, 10 Feb 2023 14:58:38 +0000 Received: ("Tessian outbound 0d7b2ab0f13d:v132"); Fri, 10 Feb 2023 14:58:38 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6a0d986fa0dd4b86 X-CR-MTA-TID: 64aa7808 Received: from f9d5ffa5334e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 17296968-2F3C-4406-9411-30EA1C7DDA78.1; Fri, 10 Feb 2023 14:58:32 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f9d5ffa5334e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Feb 2023 14:58:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YrBQ3T8PYK59puuaM5Yn+4zNWGOSkIxfo1hY4dZ3UG+YwwRZjlKEzjV/U+VyHiemgGFhJw6LjJhOZ1ozMJDJXB5wY3pWap+hQaAoGPw5ZgJfsvQOHQDIHAWLoRSkvYDVGMFr6lvoUhYi5owxHCL3deMWMv9Ibb6jJAJmMzeM77waKbkoWAzYmPC6XUyFzl1sC1+vVJPP2dkvQv2Bv/1ObXsndbgM7Ztcq4TTdbLMSweSBvPvTnfaNBiHfo0f+s/RKzP4sGJZve8SgJ4zU98r3AKyWNEjyRlRbl8FQfIQ7vuq1Sxk9x6zO1+0jspgOTsB9c48npPh3AhaZJRGPr52qA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CHCOpTNLn7Lg3aw3/umeJ6Wxen5RmIrpPSYumnPOy84=; b=la7zk6uhGg3x6uzvmhefn/9JAgZ08WxkzZMZTkvP8acqGXRbotlQD6d+2L6ZJ1DN3NG8kRkkowVFyyEwIQ62ulLMXyCr5kyLsOh2nDsdEvihse1b940ir0oTHXAryS/Zm1k1cAAuX0pKy3Gwxj6lJhzcDmNrVulZOqvBQ/EzV5KTmpWvue6mFeucBgFFP1OuY3kyEEo9g4ga01Oxq/mX+2UI3gBntdJSMjWrnXoSCYWOiF2LhcvbU/j7+X2CBFDZj7Z+IBpGblnGPOzNAck/t9AHF9EPO3n9CkNNIXV40GbwxUzd/qCuEll73HCjlFd3iDLfJjgSYEYBBQegfQYOjg== 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=CHCOpTNLn7Lg3aw3/umeJ6Wxen5RmIrpPSYumnPOy84=; b=XFx9I9VORGAfgrOPH3P6AIJ83ZAUrdxxhzmqLZDpkMyk7zvLvwSkCNTUKsWlYqfrw6zYAq72QVJwKpfBovPfE/yRjS5eiYjizM65ASmSX9r7vJg9orXGdVgm7kzDDbViv5sNA4nZK87dQOUeAhqdpssjV3zQh/0oaXtPKiOkfnA= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by DB9PR08MB10377.eurprd08.prod.outlook.com (2603:10a6:10:3db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 14:58:29 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%7]) with mapi id 15.20.6086.019; Fri, 10 Feb 2023 14:58:29 +0000 Message-ID: <28f6a3f5-9cd0-aa04-74b9-9982217cbdf8@arm.com> Date: Fri, 10 Feb 2023 14:58:27 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] [gdb/testsuite] Fix linespec ambiguity in gdb.base/longjmp.exp Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20230210105749.2893-1-tdevries@suse.de> From: Luis Machado In-Reply-To: <20230210105749.2893-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P302CA0011.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c2::7) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB9PR08MB10377:EE_|DBAEUR03FT048:EE_|AS8PR08MB6181:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c5228b0-cab6-493c-2909-08db0b774aa8 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Q45audMk/OgUnkPaFjFQa50v6eGw5QtCkroF9+UHYNJ3+vO38ihPf2w21PcYs9eUwMkO8Xsnk+4+tL9TnuyfBdWMos3YUozozViJ7zlmLq6dyXvG7Fijx61Sqf2gtYsKdfaP4OSUZY6eB/8a7unAwC07bEyLylZ56ry7zRfhU+npkW2CucpGDJDdGBEhypgenq00DpLGyEoh3kfQpwxja+f/5KSs29hiZ63YYSeFOXsgboXFO2xFZcXR/grrJ0+HSt0RNRstAjhmB+7P8nKYpObYno93Ekmb9gpfe/5OxuTpS99LhxgjguMFVs9s6S7z/EzsKAPTffZLuSTEvSDd3NTVdcB1d7iJyxNRUNJW4lHY2hZZvETAVfi6RTc/WIo8AjCU6gCYZUeYXZZkdQpxLbC2ySStsgTdZT21P3+3sqdlLGe1+gr4/fezGApgwcVw7v+OcAw1WPP156p+jlam1MtUjuRpz+yJ/YXW7A59P2A3vd6NRx7sgH/lUkwDUGgB+AfRuQQEDxyMLvyjXhO5L+lsDqdfScGlwjvlRIxC7aqhGIoz43+fonNu5vxnpcLSr8X4fsalieZFkXh7sxWBma+rVUznAYTJYtqvSV0cbluEi7SqrHlmuiDJtPBB02Pwrsc7UXBDGDYU08xxekdWBt4MzocEKJycn91blCYKJ3ut93Gh5AxJGGlGasPX6HTEN3VXdaJ6fMOdqbSeeGC0McZpQVNY1uhKFooXb1k2z13V3uMMU8BhbP/RvomO0Opld4KGHLImdJR0rxca/yrwDLPLG65b46mZctdQLlxoApo= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(136003)(396003)(346002)(39860400002)(376002)(451199018)(5660300002)(26005)(86362001)(186003)(8936002)(2616005)(38100700002)(83380400001)(6512007)(41300700001)(66946007)(316002)(66476007)(8676002)(66556008)(6506007)(53546011)(478600001)(966005)(6486002)(31696002)(31686004)(36756003)(44832011)(2906002)(84970400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB10377 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cabface1-c53d-4467-8bb4-08db0b774540 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fQ/H3uN8Z4fRvyAmsOZMH7WpCH9pdYk+TfzYOYzymE24ogxrNR3m2b6UZRXnVTQQamBeBgkHPY3XtfKo6dfYQvaUYVYAKQDGDBDrJk/HEogLwRxbvZAfW3HV2c/L8JTFjZMOvfLpo26DoM0Iy96D16+Cr5bD6CN8VdvnApGXs9zPoUTJ4iFuzmgCUbhbM9cPtmLagFChIK+LsxbBFhwDU9PPC9FYXTRJ/R1oaVK5pVB5KwS6Rzx4harsjCSt9dj4kuUtrgePoy8qgg5e8R7LpvAD1N1INal3f/I40970Mvg/Fq+qiuBNGle7MEV7nbqw0kzs0uGNaD7g0N5GEqrYI7kP7ggWmeEfRvQQATFqTYcxA8IgWeEd0EccBYij+k8P2c2xp4wAeHVvsddukcOY9yWpBxvObk4qxtWWZQXY0/aWUqFEIUL4ErZrfpIDBc1IqB9iEIZThs/TD1ZVY0f8HeWWoKsn/lUA71YiNO60KVv47P9hD0cxQR99tVPE6wY4U/wzvUdVc00M7ZstEtxS3fhR7DSGZH6Wc6VQTvlXsqctNuXcGHzvkHjSPRt5SP0JFnDvpwzrKO1Wa1M4PhiZ7LONihIYZfboRPTV5OmxnI/3iECoNILS2f69BgDm4ERaCG/dYYtaINO80+xeEJy/VluxhE963kmSLZOh2JHaG5af8ijzMPFELxMYbimJ4eOIfeC87m/LzdjoMLmPH0imJi8WSndQ8C+Bz0ZUz++wb41majIkXGA3InG5lx2/kfwp7BLwrsBtwGWMC4vcdnJO6j5gxYBDy/ghbZufS/WNVFJfLCwEwlsnKLJEPeql4Qf+ X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199018)(40470700004)(36840700001)(46966006)(47076005)(2906002)(316002)(44832011)(81166007)(5660300002)(40480700001)(36756003)(36860700001)(82740400003)(356005)(83380400001)(82310400005)(70586007)(70206006)(41300700001)(8936002)(31696002)(8676002)(86362001)(40460700003)(84970400001)(478600001)(2616005)(6486002)(966005)(26005)(186003)(53546011)(6512007)(6506007)(31686004)(336012)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 14:58:38.4605 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c5228b0-cab6-493c-2909-08db0b774aa8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6181 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/10/23 10:57, Tom de Vries wrote: > PR testsuite/30103 reports the following failure on aarch64-linux > (ubuntu 22.04): > ... > (gdb) PASS: gdb.base/longjmp.exp: with_probes=0: pattern 1: next to longjmp > next > warning: Breakpoint address adjusted from 0x83dc305fef755015 to \ > 0xffdc305fef755015. > Warning: > Cannot insert breakpoint 0. > Cannot access memory at address 0xffdc305fef755015 > > __libc_siglongjmp (env=0xaaaaaaab1018 , val=1) at ./setjmp/longjmp.c:30 > 30 } > (gdb) KFAIL: gdb.base/longjmp.exp: with_probes=0: pattern 1: gdb/26967 \ > (PRMS: next over longjmp) > delete breakpoints > Delete all breakpoints? (y or n) y > (gdb) info breakpoints > No breakpoints or watchpoints. > (gdb) break 63 > No line 63 in the current file. > Make breakpoint pending on future shared library load? (y or [n]) n > (gdb) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 2: setup: breakpoint \ > at pattern start (got interactive prompt) > ... > > The test-case intends to set the breakpoint on line number 63 in > gdb.base/longjmp.c. > > It tries to do so by specifying "break 63", which specifies a line in the > "current source file". > > Due to the KFAIL PR, gdb stopped in __libc_siglongjmp, and because of presence > of debug info, the "current source file" becomes glibc's ./setjmp/longjmp.c. > > Consequently, setting the breakpoint fails. > > Fix this by adding a $subdir/$srcfile: prefix to the breakpoint linespecs. > > I've managed to reproduce the FAIL on x86_64/-m32, by installing the > glibc-32bit-debuginfo package. This allowed me to confirm the "current source > file" that is used: > ... > (gdb) KFAIL: gdb.base/longjmp.exp: with_probes=0: pattern 1: gdb/26967 \ > (PRMS: next over longjmp) > info source^M > Current source file is ../setjmp/longjmp.c^M > ... > > Tested on x86_64-linux, target boards unix/{-m64,-m32}. > > Reported-By: Luis Machado > > PR testsuite/30103 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30103 > --- > gdb/testsuite/gdb.base/longjmp.exp | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp > index 96d9c1c8059..f74891aa7ca 100644 > --- a/gdb/testsuite/gdb.base/longjmp.exp > +++ b/gdb/testsuite/gdb.base/longjmp.exp > @@ -82,6 +82,9 @@ proc do_test { with_probes } { > gdb_assert { !$have_longjmp_probe } > } > > + # When using these line numbers in break linespecs, prefix each of these > + # with "$subdir/$srcfile:" to avoid referring to a glibc file when stopped > + # in __libc_siglongjmp or similar. > set bp_miss_step_1 [gdb_get_line_number "miss_step_1"] > set bp_miss_step_2 [gdb_get_line_number "miss_step_2"] > > @@ -104,13 +107,13 @@ proc do_test { with_probes } { > with_test_prefix setup { > delete_breakpoints > > - gdb_test "break $bp_start_test_1" \ > + gdb_test "break $::subdir/$::srcfile:$bp_start_test_1" \ > "Breakpoint.*at.* file .*$::srcfile, line.*$bp_start_test_1.*" \ > "breakpoint at pattern start" > gdb_test "continue" "patt1.*" "continue to breakpoint at pattern start" > > # set safe-net break > - gdb_test "break $bp_miss_step_1" \ > + gdb_test "break $::subdir/$::srcfile:$bp_miss_step_1" \ > "Breakpoint.*at.* file .*$::srcfile, line.*$bp_miss_step_1.*" \ > "breakpoint at safety net" > } > @@ -151,13 +154,13 @@ proc do_test { with_probes } { > with_test_prefix setup { > delete_breakpoints > > - gdb_test "break $bp_start_test_2" \ > + gdb_test "break $::subdir/$::srcfile:$bp_start_test_2" \ > "Breakpoint.*at.* file .*$::srcfile, line.*$bp_start_test_2.*" \ > "breakpoint at pattern start" > gdb_test "continue" "patt2.*" "continue to breakpoint at pattern start" > > # set safe-net break > - gdb_test "break $bp_miss_step_2" \ > + gdb_test "break $::subdir/$::srcfile:$bp_miss_step_2" \ > "Breakpoint.*at.* file .*$::srcfile, line.*$bp_miss_step_2.*" \ > "breakpoint at safety net" > } > @@ -198,7 +201,7 @@ proc do_test { with_probes } { > with_test_prefix setup { > delete_breakpoints > > - gdb_test "break $bp_start_test_3" \ > + gdb_test "break $::subdir/$::srcfile:$bp_start_test_3" \ > "Breakpoint.*at.* file .*$::srcfile, line.*$bp_start_test_3.*" \ > "breakpoint at pattern start" > gdb_test "continue" "patt3.*" "continue to breakpoint at pattern start" > > base-commit: fe8cdc8ec145a166414fc375cf2cb65d9a8085a1 Thanks Tom. I gave this a try and it fixes the FAIL's I was seeing. Reviewed-By: Luis Machado Tested-By: Luis Machado