From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2069.outbound.protection.outlook.com [40.107.105.69]) by sourceware.org (Postfix) with ESMTPS id 2A4203858D39 for ; Wed, 8 Feb 2023 13:27:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A4203858D39 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=oo4OQJy7uHIocZMvu06NBhyNeFp6yk7T+fXyBqKbfWo=; b=aaq0HosgfrSCfhqrj5om4AwdNu6lTsc5IzS5NZYp6khaZmty83DUetx0i+Wtw++X0DWOMMqO2fXGEvK8QchVFrZsR2SDbZwaX//lIPX/vQB3kBt4IaWZHWMWb5hD2lh7YJ8vlSHOYuT3dV4mtmHMl0UnIYbYU65iQGaOnsu8yhk= Received: from DB8P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::20) by AS8PR08MB6344.eurprd08.prod.outlook.com (2603:10a6:20b:319::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Wed, 8 Feb 2023 13:27:45 +0000 Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::20) by DB8P191CA0010.outlook.office365.com (2603:10a6:10:130::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17 via Frontend Transport; Wed, 8 Feb 2023 13:27:45 +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 DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17 via Frontend Transport; Wed, 8 Feb 2023 13:27:45 +0000 Received: ("Tessian outbound 333ca28169fa:v132"); Wed, 08 Feb 2023 13:27:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 16b44d12c006d325 X-CR-MTA-TID: 64aa7808 Received: from f43b90316e2c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 36E496CD-8BE0-46FD-B242-EB264FA604D3.1; Wed, 08 Feb 2023 13:27:37 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f43b90316e2c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Feb 2023 13:27:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PLLowf6nSa7rbGnLfB2GfWCV5OUuHlhiXRs5qJr4vVMwbDfNIyc1xuGWuXn/Jo6sX9omF5Jgypbqmn8aP/jgnb7bATn3YapUn31LXHpcYEqKDkkClWdgUR4DJL3J5cdL0bwVX1/LZr20E1pfRiaZ25KDvSwt5Omhf/gXSzyxMPSUFEgN7eX/aIderXhE4w+3Rz+64jzD1FA8rrxgzbuoZnQCiIhqP47I6CQ77vfm6EIfYpDWdN0sSKfRkgDmQRjzEjefFGlpjoitWBFlt04kiwGblFe/0paOQCmHUlGBaCWuTGtzkUByQfTVvLNcd7qsfIkR5gcogeZ+wi36bt6vIA== 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=oo4OQJy7uHIocZMvu06NBhyNeFp6yk7T+fXyBqKbfWo=; b=Wd704PWKF/GzdY5APgZaZvFeFUn7mEsoDrNXd1wbQmxYdojULQRnC7+DGvV+hkWL4cVRwusnT2sEW9jfughvMlm022/fr+aqKP5kcA4iVq6x9KxJGrk82QkRuzFE1iN+EK1ut2GBZ7ceb0isrNF6V5l/2Y0r8XMqkUUy07BGNtryezV4o+yf4WyRsAz5R4reLO7AlKCQNSkvI3MLU41vt3/BRO4mW5gC25E0e1q2/Q10+djKDgBCW/9naA3rthEe2NkmQTVqzgvZpqK1AmFmuub6zzZ4J79KqBqYBF92zxVxxlpUKriGwIDydcMYBRXCfXfczCRImnbkYMLgL9cZRw== 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=oo4OQJy7uHIocZMvu06NBhyNeFp6yk7T+fXyBqKbfWo=; b=aaq0HosgfrSCfhqrj5om4AwdNu6lTsc5IzS5NZYp6khaZmty83DUetx0i+Wtw++X0DWOMMqO2fXGEvK8QchVFrZsR2SDbZwaX//lIPX/vQB3kBt4IaWZHWMWb5hD2lh7YJ8vlSHOYuT3dV4mtmHMl0UnIYbYU65iQGaOnsu8yhk= 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 DBAPR08MB5655.eurprd08.prod.outlook.com (2603:10a6:10:1ab::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Wed, 8 Feb 2023 13:27:36 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%6]) with mapi id 15.20.6064.036; Wed, 8 Feb 2023 13:27:35 +0000 Message-ID: Date: Wed, 8 Feb 2023 13:27:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [pushed] [gdb/testsuite] Use maint ignore-probes in gdb.base/longjmp.exp Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20230208124652.29570-1-tdevries@suse.de> From: Luis Machado In-Reply-To: <20230208124652.29570-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0060.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::24) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DBAPR08MB5655:EE_|DBAEUR03FT052:EE_|AS8PR08MB6344:EE_ X-MS-Office365-Filtering-Correlation-Id: 663d4a1a-0f7b-478c-6f0a-08db09d84372 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: aHg5bBk44ZAnJWq4XkypPR+YMlu4m0JbVRsMbnWIuXz/oKBd9WeSQ+AOiJr5FMnaIVr+exlGfb4YJFbzbcYbEhYxZECSZdhpdiAObTA1EnEVP2uv+b7F6oykaR46uYAlwhwrvN4DQ5mAnwkmuamiYDoUdWWbiINVXouwMjLVLMAFzrwceGkMywyA2zfV7FOP2D25SYarqeSn+ZBz0n+/IRea3Dv4xQxQB/omMMOGH7cqZmqU6oM6rNLF+NScUMElASZ47S2/9ZZsfNE/nL2x0N3pY6Y1EkUIgQ5UWqeTjW+v6a0o66isO/QB8ceWDDZvy0xiUdZ1GcdnldbHoKQNPo/qtKd33H7N+GE9736WPr4rv/2yKhwyu7B1YtVbIyOZ0BxLxgl5y3pA6D3pqGBoDiwdPq2TsV23O3vw6ZHzQc99qVsPbeWZFbgdseYNTa9Ygxr4nksDiSErrtDvTrp3u0qCQZePtteOv/GBr9C4W2Yn6PfWWbJ3tL9LDR29iXwmfswaj++UxgGYwxAixqeM/JpJ8+PI1in3QrnNcorcJr/HYQ4scWxHOtYZYHlzChjqGqrJ2A8/9SiGP7EtroUdqRNTqsbANO0o/+pq9uzZbkh/I6HZHHTuegSiUGuDI5eq5813aPXO9W6aNNObHOFnKgAQ/eCkMhK/S9Lf1fzpqAnhv5RnbKd90gBkoy+0ZJglY2wGGR+ebqKSdWsyuW14L0HIuJEmwTyhAgXGGEfLUqUk+S36aVpxcggNA9DXStPU7lQYgl1EC0LO3RMXc3ZCdUBWO5TaPXvAP76vvE9ctUA= 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)(396003)(346002)(39860400002)(376002)(136003)(451199018)(8676002)(83380400001)(66476007)(66556008)(66946007)(26005)(6512007)(6486002)(53546011)(6506007)(966005)(478600001)(186003)(316002)(2616005)(31696002)(31686004)(86362001)(36756003)(30864003)(44832011)(5660300002)(8936002)(84970400001)(2906002)(38100700002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5655 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: DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 48930466-b5ee-4af2-27be-08db09d83da2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3fHX/eg2vS2HO7dDpkxcpStSuqzq3B2zbYVB1yuhYRz+9PuOzhPgwA2xaisYtfAxcj/wW3TIjTpkEADpVJDR3xddcGCbluOfW/b1XZHbXcLhtNIbi5ES4FeuKsjzrt7leuovR1OORqTQmRvFLOD1XDw8QneFx4wEuO2CPIbUbZrdWk9qUPwA4QNX8q4fmccfMgC849xr3v/93BwyZL1IuRbbr5olSpIzXcl7DUkwQvQEM1a32+ilxtGYdRZF+8B2zVeUS19bXVKAqc2E/6/lPtvLl5gycJfD0DpmE3LyjH4zlNfrAk00ncAgnyWAX9IpLCAmlg33nDn9HBn96edxnJlWIzi+ibg5yRnf+tk/voDz3GLhyV4TAceowF2m0GcEf3xtYqiFef4uKTVcsHD4Ulqk7Z7tNT4c1Zn+7IC4jg7zgVY3LubePCPrGomhhRuC0JcetzDz5twS/X3yjUEQwdcQUNXVlJrSlxCGyKpxNo4/yrZik+SqnIDidmbRyBkWM+diCw7nCknWGSTqlwcu+rrzM1oErUeUjA8wiSujh4CWC2Ne7dgxdOn1590B/bLceFl7wnhdM0MTX1R7e7DQrOZMMW3kzfuQUvwoxP0bibOJiBe7ebgLCPmTLfrGVkUntovH8R8yAC7VyFaXMfVSjviPiRdUUCBYyZvaRUJCGMjDuv//Q4ZFqxdMtdzurgPCYG/OcGUKtMyDS62CzaUELZoct+qlOXl0lWffv+PiHSK2jYLWc7M1Dum7efRO9gB74ItrIomCaqkF8rcUZCwDfNGzNzAx3m2qtVt5mCFdBpE/5ZtQD2SfX9guqORbWcWP 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)(136003)(346002)(376002)(396003)(39860400002)(451199018)(40470700004)(36840700001)(46966006)(5660300002)(44832011)(30864003)(53546011)(6506007)(26005)(82740400003)(186003)(6512007)(81166007)(36860700001)(82310400005)(336012)(83380400001)(2616005)(47076005)(70206006)(70586007)(8676002)(316002)(31696002)(40480700001)(86362001)(8936002)(36756003)(966005)(41300700001)(478600001)(6486002)(356005)(40460700003)(31686004)(2906002)(84970400001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 13:27:45.2216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 663d4a1a-0f7b-478c-6f0a-08db09d84372 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: DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6344 X-Spam-Status: No, score=-12.7 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: Hi Tom, Is the entire test supposed to PASS? I'm seeing the following on my aarch64/Ubuntu 22.04 setup: FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 2: next over call_longjmp (the program is no longer running) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 2: next over setjmp (the program is no longer running) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 2: setup: breakpoint at pattern start (got interactive prompt) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 2: setup: breakpoint at safety net (got interactive prompt) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 2: setup: continue to breakpoint at pattern start (the program exited) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 3: next over pattern (the program is no longer running) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 3: setup: breakpoint at pattern start (got interactive prompt) FAIL: gdb.base/longjmp.exp: with_probes=0: pattern 3: setup: continue to breakpoint at pattern start (the program is no longer running) Maybe something is genuinely broken for aarch64 though, or I'm missing some packages/debuginfo. This part in particular seems a bit off: (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) On 2/8/23 12:46, Tom de Vries via Gdb-patches wrote: > Test-case gdb.base/longjmp.exp handles both the case that there is a libc > longjmp probe, and the case that there isn't. > > However, it only tests one of the two cases. > > Use maint ignore-probes to test both cases, if possible. > > Tested on x86_64-linux. > --- > gdb/testsuite/gdb.base/longjmp.exp | 295 +++++++++++++++-------------- > 1 file changed, 157 insertions(+), 138 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/longjmp.exp b/gdb/testsuite/gdb.base/longjmp.exp > index 27a60bc4502..96d9c1c8059 100644 > --- a/gdb/testsuite/gdb.base/longjmp.exp > +++ b/gdb/testsuite/gdb.base/longjmp.exp > @@ -25,181 +25,200 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb > return -1 > } > > -clean_restart ${binfile} > +proc do_test { with_probes } { > + clean_restart ${::binfile} > > -if {![runto_main]} { > - return 0 > -} > + if { !$with_probes } { > + gdb_test "maint ignore-probes libc ^longjmp$" > + } > > -# With a libc with probes, all tests should pass. > -# > -# Without probes, we can still set a break on longjmp, but getting the longjmp > -# target may not work, in the following cases: > -# - gdbarch_get_longjmp_target_p (gdbarch) == 0: not implemented. > -# - gdbarch_get_longjmp_target (gdbarch) == 0: for instance on amd64 if > -# tdep->jb_pc_offset == -1. > -# - gdbarch_get_longjmp_target (gdbarch) != 0: if we have a glibc with > -# pointer mangling ( https://sourceware.org/glibc/wiki/PointerEncryption ) > -# then we retrieve a mangled longjmp target that needs to be demangled. > -# For instance on amd64 with target board unix/-m32. > -# > -# Pointer demangling is currently not implemented for any target. > -# For the amd64 case, this would require copying for instance this: > -# 48 c1 ca 11 ror $0x11,%rdx > -# 64 48 33 14 25 30 00 xor %fs:0x30,%rdx > -# into a scratch space, save the register set, set %rdx to the mangled > -# longjmp target, displaced-step through the two insn and read the > -# demangled longjmp target from %rdx, and restore the register set. > -# > -# The failure mode in the first two cases is that the next degrades into a > -# continue. The failure mode in the latter case is a failure to set a > -# breakpoint (matched by re_cannot_insert_bp) and a stop in longjmp. > -# > -# We detect the different failure modes and kfail these. > + if {![runto_main]} { > + return 0 > + } > > -set have_longjmp_probe 0 > -gdb_test_multiple "info probes stap libc ^longjmp$" "" { > - -re -wrap "No probes matched\\." { > - pass $gdb_test_name > + # With a libc with probes, all tests should pass. > + # > + # Without probes, we can still set a break on longjmp, but getting the longjmp > + # target may not work, in the following cases: > + # - gdbarch_get_longjmp_target_p (gdbarch) == 0: not implemented. > + # - gdbarch_get_longjmp_target (gdbarch) == 0: for instance on amd64 if > + # tdep->jb_pc_offset == -1. > + # - gdbarch_get_longjmp_target (gdbarch) != 0: if we have a glibc with > + # pointer mangling ( https://sourceware.org/glibc/wiki/PointerEncryption ) > + # then we retrieve a mangled longjmp target that needs to be demangled. > + # For instance on amd64 with target board unix/-m32. > + # > + # Pointer demangling is currently not implemented for any target. > + # For the amd64 case, this would require copying for instance this: > + # 48 c1 ca 11 ror $0x11,%rdx > + # 64 48 33 14 25 30 00 xor %fs:0x30,%rdx > + # into a scratch space, save the register set, set %rdx to the mangled > + # longjmp target, displaced-step through the two insn and read the > + # demangled longjmp target from %rdx, and restore the register set. > + # > + # The failure mode in the first two cases is that the next degrades into a > + # continue. The failure mode in the latter case is a failure to set a > + # breakpoint (matched by re_cannot_insert_bp) and a stop in longjmp. > + # > + # We detect the different failure modes and kfail these. > + > + set have_longjmp_probe 0 > + gdb_test_multiple "info probes stap libc ^longjmp$" "" { > + -re -wrap "No probes matched\\." { > + pass $gdb_test_name > + } > + -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { > + pass $gdb_test_name > + set have_longjmp_probe 1 > + } > } > - -re -wrap "\r\nstap\[ \t\]+libc\[ \t\]+longjmp\[ \t\]+.*" { > - pass $gdb_test_name > - set have_longjmp_probe 1 > + > + if { $with_probes } { > + if { !$have_longjmp_probe } { > + unsupported "longjmp probe required" > + return > + } > + } else { > + gdb_assert { !$have_longjmp_probe } > } > -} > > -set bp_miss_step_1 [gdb_get_line_number "miss_step_1"] > -set bp_miss_step_2 [gdb_get_line_number "miss_step_2"] > + set bp_miss_step_1 [gdb_get_line_number "miss_step_1"] > + set bp_miss_step_2 [gdb_get_line_number "miss_step_2"] > > -set bp_start_test_1 [gdb_get_line_number "patt1"] > -set bp_start_test_2 [gdb_get_line_number "patt2"] > -set bp_start_test_3 [gdb_get_line_number "patt3"] > + set bp_start_test_1 [gdb_get_line_number "patt1"] > + set bp_start_test_2 [gdb_get_line_number "patt2"] > + set bp_start_test_3 [gdb_get_line_number "patt3"] > > -set re_cannot_insert_bp \ > - [multi_line \ > - "Warning:" \ > - "Cannot insert breakpoint $decimal\\." \ > - "Cannot access memory at address $hex"] > + set re_cannot_insert_bp \ > + [multi_line \ > + "Warning:" \ > + "Cannot insert breakpoint $::decimal\\." \ > + "Cannot access memory at address $::hex"] > > -# > -# Pattern 1 - simple longjmp. > -# > + # > + # Pattern 1 - simple longjmp. > + # > > -with_test_prefix "pattern 1" { > + with_test_prefix "pattern 1" { > > - with_test_prefix setup { > - delete_breakpoints > + with_test_prefix setup { > + delete_breakpoints > > - gdb_test "break $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" > + gdb_test "break $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" \ > - "Breakpoint.*at.* file .*$srcfile, line.*$bp_miss_step_1.*" \ > - "breakpoint at safety net" > - } > + # set safe-net break > + gdb_test "break $bp_miss_step_1" \ > + "Breakpoint.*at.* file .*$::srcfile, line.*$bp_miss_step_1.*" \ > + "breakpoint at safety net" > + } > > - gdb_test "next" "longjmps\\+\\+;.*" "next over setjmp" > - gdb_test "next" "longjmp \\(env, 1\\);.*" "next to longjmp" > + gdb_test "next" "longjmps\\+\\+;.*" "next over setjmp" > + gdb_test "next" "longjmp \\(env, 1\\);.*" "next to longjmp" > > - set msg "next over longjmp" > - gdb_test_multiple "next" $msg { > - -re ".*patt1.*$gdb_prompt $" { > - pass $msg > - gdb_test "next" "resumes\\+\\+.*" "next into else block" > - gdb_test "next" "miss_step_1.*" "next into safety net" > - } > - -re "miss_step_1.*$gdb_prompt $" { > - if { $have_longjmp_probe } { > - fail $gdb_test_name > - } else { > - kfail $gdb_test_name "gdb/26967" > + set msg "next over longjmp" > + gdb_test_multiple "next" $msg { > + -re ".*patt1.*$::gdb_prompt $" { > + pass $msg > + gdb_test "next" "resumes\\+\\+.*" "next into else block" > + gdb_test "next" "miss_step_1.*" "next into safety net" > } > - } > - -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { > - if { $have_longjmp_probe } { > - fail $gdb_test_name > - } else { > - kfail $gdb_test_name "gdb/26967" > + -re "miss_step_1.*$::gdb_prompt $" { > + if { $have_longjmp_probe } { > + fail $gdb_test_name > + } else { > + kfail $gdb_test_name "gdb/26967" > + } > + } > + -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { > + if { $have_longjmp_probe } { > + fail $gdb_test_name > + } else { > + kfail $gdb_test_name "gdb/26967" > + } > } > } > } > -} > > -# > -# Pattern 2 - longjmp from an inner function. > -# > + # > + # Pattern 2 - longjmp from an inner function. > + # > > -with_test_prefix "pattern 2" { > + with_test_prefix "pattern 2" { > > - with_test_prefix setup { > - delete_breakpoints > + with_test_prefix setup { > + delete_breakpoints > > - gdb_test "break $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" > + gdb_test "break $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" \ > - "Breakpoint.*at.* file .*$srcfile, line.*$bp_miss_step_2.*" \ > - "breakpoint at safety net" > - } > + # set safe-net break > + gdb_test "break $bp_miss_step_2" \ > + "Breakpoint.*at.* file .*$::srcfile, line.*$bp_miss_step_2.*" \ > + "breakpoint at safety net" > + } > > - gdb_test "next" "call_longjmp.*" "next over setjmp" > + gdb_test "next" "call_longjmp.*" "next over setjmp" > > - set msg "next over call_longjmp" > - gdb_test_multiple "next" $msg { > - -re ".*patt2.*$gdb_prompt $" { > - pass $msg > + set msg "next over call_longjmp" > + gdb_test_multiple "next" $msg { > + -re ".*patt2.*$::gdb_prompt $" { > + pass $msg > > - gdb_test "next" "resumes\\+\\+.*" "next into else block" > - gdb_test "next" "miss_step_2.*" "next into safety net" > - } > - -re "miss_step_2.*$gdb_prompt $" { > - if { $have_longjmp_probe } { > - fail $gdb_test_name > - } else { > - kfail $gdb_test_name "gdb/26967" > + gdb_test "next" "resumes\\+\\+.*" "next into else block" > + gdb_test "next" "miss_step_2.*" "next into safety net" > } > - } > - -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { > - if { $have_longjmp_probe } { > - fail $gdb_test_name > - } else { > - kfail $gdb_test_name "gdb/26967" > + -re "miss_step_2.*$::gdb_prompt $" { > + if { $have_longjmp_probe } { > + fail $gdb_test_name > + } else { > + kfail $gdb_test_name "gdb/26967" > + } > + } > + -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { > + if { $have_longjmp_probe } { > + fail $gdb_test_name > + } else { > + kfail $gdb_test_name "gdb/26967" > + } > } > } > } > -} > > -# > -# Pattern 3 - setjmp/longjmp inside stepped-over function. > -# > + # > + # Pattern 3 - setjmp/longjmp inside stepped-over function. > + # > > -with_test_prefix "pattern 3" { > + with_test_prefix "pattern 3" { > > - with_test_prefix setup { > - delete_breakpoints > + with_test_prefix setup { > + delete_breakpoints > > - gdb_test "break $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" > - } > - > - gdb_test_multiple "next" "next over pattern" { > - -re -wrap "longjmp caught.*" { > - pass $gdb_test_name > + gdb_test "break $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" > } > - -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { > - if { $have_longjmp_probe } { > - fail $gdb_test_name > - } else { > - kfail $gdb_test_name "gdb/26967" > + > + gdb_test_multiple "next" "next over pattern" { > + -re -wrap "longjmp caught.*" { > + pass $gdb_test_name > + } > + -re -wrap "\r\n$re_cannot_insert_bp\r\n.*" { > + if { $have_longjmp_probe } { > + fail $gdb_test_name > + } else { > + kfail $gdb_test_name "gdb/26967" > + } > } > } > } > } > + > +foreach_with_prefix with_probes { 0 1 } { > + do_test $with_probes > +} > > base-commit: 0ab9328277ce12014ce05ff139eba7a6230516fd