From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2088.outbound.protection.outlook.com [40.107.8.88]) by sourceware.org (Postfix) with ESMTPS id 403703858C53 for ; Wed, 8 Feb 2023 14:51:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 403703858C53 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=MggDV4HlFguozkHC2fkujuZvUrFbpzBcT4r/1juy3/M=; b=jkTCdKyvTc9RzfgVxVj32ecB55kw+/9BaS88RjB7AknBQRL0Q/VkmL4t++8wEkKiAkNolK6RK/9GNnxkPhfCoUSUPGjJ4Jrib4LgMh6n5WEfUFHVRg9yKdBuHIJkQYRFr8P7e4Tyy3/m/jYBtiww1gXAILBL/OfgNrYQNMDiXkE= Received: from DB6P192CA0018.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::28) by PAWPR08MB10306.eurprd08.prod.outlook.com (2603:10a6:102:366::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Wed, 8 Feb 2023 14:51:41 +0000 Received: from DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::43) by DB6P192CA0018.outlook.office365.com (2603:10a6:4:b8::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32 via Frontend Transport; Wed, 8 Feb 2023 14:51:41 +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 DBAEUR03FT049.mail.protection.outlook.com (100.127.142.192) 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 14:51:41 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Wed, 08 Feb 2023 14:51:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d91a69276c6a6aea X-CR-MTA-TID: 64aa7808 Received: from a33f5174bbf4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 12C4BEDD-6897-47DB-A46E-187F619C14B6.1; Wed, 08 Feb 2023 14:51:35 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a33f5174bbf4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Feb 2023 14:51:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BCJCLf7PHujxS6KXK02Q2xxeQ5RxuFaoFY7R8TTYW/akTGoKuJYeQVZfqYBpOmaBJH0ZnxowFmb3vRs8Pua1JYLFWcCMTztVCtStx5tGSFPvuecFK01Umm80MlKFvHMnkc00CJqmEmKEgO17IxZQaAhgV07oI67VoXgJ9gmopLUUApmWwAZwZ68C9e7Vbtc2m3o5gcXxRCY6djjL1f3fHsmPRasDG7M7q8bnIvoXLjJjPVfcwS0HfkhRiGGU+npNl9MkYMRC0NX3+H7tMSnNHv4zxT/zsttD7TxcI/dQI9k64UKMwgS2rJE1VLQwxc6xVXCh3XrPQ0CuYtFHFjk/kA== 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=MggDV4HlFguozkHC2fkujuZvUrFbpzBcT4r/1juy3/M=; b=N4QRtS7OIcali86+Ba1GQhnKuLbKO2pDuFApX903dHmfyvpLKROsDb6jslPUml2IHGO0vUlDELh0Hc49W4DS12peWI5JDPkUgyvXe0cdFgOf8we3Ievm2fMtZp41+pVMFy4Vn2T7AZyA+O2hruGULYtiGN0m+SAdg63Suq8YSCwALVWKEB0CZrfTDQV+IKG+qTfdMpSTbRzsw/thvHSu0dvdhWgjAi0G808/KX9rZREXPW5q6jeBzXiC+MPo6IhthKyl3i5BmyJy9OKtbWKyYicNUIlfKKumnwjdypD883+5An9tCX3u2tMQDzh+7v6mDzleVqDbhBoTBfooO5RE1Q== 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=MggDV4HlFguozkHC2fkujuZvUrFbpzBcT4r/1juy3/M=; b=jkTCdKyvTc9RzfgVxVj32ecB55kw+/9BaS88RjB7AknBQRL0Q/VkmL4t++8wEkKiAkNolK6RK/9GNnxkPhfCoUSUPGjJ4Jrib4LgMh6n5WEfUFHVRg9yKdBuHIJkQYRFr8P7e4Tyy3/m/jYBtiww1gXAILBL/OfgNrYQNMDiXkE= 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 VE1PR08MB5741.eurprd08.prod.outlook.com (2603:10a6:800:1b3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Wed, 8 Feb 2023 14:51:32 +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 14:51:32 +0000 Message-ID: <57277a06-0a9c-e731-beee-1f6d0e88ea6f@arm.com> Date: Wed, 8 Feb 2023 14:51:32 +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> <23f68beb-39c5-33c8-2d2d-f076192d2648@suse.de> From: Luis Machado In-Reply-To: <23f68beb-39c5-33c8-2d2d-f076192d2648@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0354.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:d::30) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|VE1PR08MB5741:EE_|DBAEUR03FT049:EE_|PAWPR08MB10306:EE_ X-MS-Office365-Filtering-Correlation-Id: edd2bd34-797a-4520-a59a-08db09e3fd39 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: EAQq5VyYi3QhBBDdP/ClDNis6cgeWxPvLeNsd2gxYwA0JSaMV/ii6oYyFL9w2+51N4hMS1RL0cmEEuKT8S7NT4z4uaI4trB6yZ8CdzJiIU6z4sjhKgtXU2nhM7Ds8wOID0qy1uUaOEs5/ug941tAVNN2DcURM9oe4sEpY0jmCdI+TxyoYe61W+GzFiH/GytrjY56jbj4MZAHgKXjFRHQX+6rZoK9pLm8Wq57jSsu2+393Of2nat8IIn4dwDcZSp5oaaQ+F8ydjp65x2T3nsvZkHSwhG6C5O0yQF+0NQbg4lEjHYvGnC6XxoL/cdmHjm+vI92d9QoSV1ISW8N0M4XI0t4P1Ct3b8mK2DRM3qdd2bp0O49MxnrVq34tOhROUlzGObG7S5VQrjFT72OpMfxKJzTWrIVss4AbzhFcdJlTpJwJLmnn6WGUMuNN8dNiu4IGowaZSVQoWl1l/s+0EjxukRpdHzCSP9MSsFGOEl83nf2Q6IPW9juR2H4jP1es11eXtdLLZx+xlzKZT5I4nyITRr4k4LSY0Ea4869K1zEPMu8ZBg+9Ri+TCTOk2FzsNtIQE/F5Ij9nD3M+NhHUa59AougRR2tgs6fnCAVS1GRrOoSCCmQg+CJVNnwVpkFyxwWjkRn2mczCyCeCZyMzqgh5hwN7XTcQyB4ndEAyKacUWtUY5m+2J5JHD/4MPm1eNLnwec2J3zAp6LzJAsMcoHEftmq4KTrvhER02e7ADDQRKwr1g/YVLnQN6KqoadWX0COF5qi7RMlTvSdUswpYean+z7Fu4A8HjMv7n10kOuqWfwjssp1zv1Xen4zT6YcIEON 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)(376002)(39860400002)(366004)(136003)(346002)(396003)(451199018)(83380400001)(316002)(66476007)(5660300002)(8936002)(8676002)(66946007)(66556008)(41300700001)(478600001)(6512007)(6506007)(26005)(53546011)(186003)(6486002)(2616005)(966005)(36756003)(86362001)(31696002)(2906002)(44832011)(38100700002)(30864003)(84970400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5741 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: DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2ca17a10-feca-40a7-25b4-08db09e3f7b8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I3QfzVb/8HMRZp5vw87YoK9jVyNyP4QVTwMN1jrF8zBPAK+n4Y+s8HXUihGqstuL+lh9bPYVgIVxIhRcy+8x+P2k50PWiXcAIFZuUCEtlM9SHfaSVw64L0L+szUsfHmp0/XyYQBbSxAGxXUtBmAYGuZodW07Wu/t/pikonCvA+6E3HpeIXU7FcjaAJQ8Bo3ZbiPU1+cPwENSBjcWHnjeEGLUNoRfLwGo+IzCNSCQzbbPfDSlMDRL/o3972WXKTx1WnY1iw6Q1V+LeqNpdGSWtJG0RhQ16YESWt/5fVk4L3jW8d6kDXwy7zm6Rio4vwxJO7sVpyUBTItMEcDj7ATs3bp7odasthw0kwFS3VN1eESUJt3th2wVVt6nYQRgtbKs7VYiuXJWZfZ533W2875J08v8iFSmEINFZRBKngSlrBLn14Dk0eybwiV6xkknypW66u6S4cfOXFMUKGu6kBdThtKj7X4YarjHC7uscfrm7sRtk2sFlAePBhbyCsZJDRKPUIocSJ9ARwbCLo4uYbK6xrmDFrE06Vjuc3ooTKcdb1FuCFW/9ErNuOPHMfUzjr1GNySwOYqefHM6fCLowaRR/D6d7UW8nqqpC5CFZZDgYXovlKEheiAMdfyUa8qfRZ+Iq08tg5+EuBcBZvwSKDDNLBdIiMBPZLp/XR8TItMlPOFHiq18WxsalsrHjiw5mL7uWBt5IiUz5fmLZZDJ5NH1TDJaFarZqLHuUwMq9RoFxznXp6Et71ZXhG5buhpSGS+cKzmYqKMvWOj/CZlaSxAS0H4LB5pcVvmLHGI4O0LX81S7s2WwjTXNaOLRQsO/N0IU 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)(39860400002)(346002)(376002)(136003)(451199018)(36840700001)(40470700004)(46966006)(5660300002)(47076005)(30864003)(36756003)(44832011)(2906002)(81166007)(83380400001)(40480700001)(2616005)(336012)(356005)(82740400003)(8676002)(36860700001)(70206006)(70586007)(8936002)(41300700001)(6512007)(186003)(53546011)(6506007)(31696002)(26005)(40460700003)(316002)(86362001)(966005)(6486002)(478600001)(82310400005)(31686004)(84970400001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2023 14:51:41.3540 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: edd2bd34-797a-4520-a59a-08db09e3fd39 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: DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10306 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,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/8/23 14:48, Tom de Vries wrote: > On 2/8/23 14:27, Luis Machado wrote: >> 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. > > Hi, > > I just ran this test-case on openSUSE Leap 15.4 aarch64, no problems found. > Alright. That's good to know. >> >> 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) >> > > I'd focus on the first FAIL.  Why is the safety net breakpoint not triggering? Yeah, it seems a bit fishy. I'll take a look. Thanks! > > Thanks, > - Tom > >> 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 >> >