From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150047.outbound.protection.outlook.com [40.107.15.47]) by sourceware.org (Postfix) with ESMTPS id 819DD3858C62 for ; Fri, 11 Nov 2022 09:32:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 819DD3858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SfFnLocOG4BBpYGjLXpZReuS8l6DitFXl3RtnI5xqHsW6ujVeiEZsVyPUbjw1NJ3Zj/g1ft7eDgwKme+1js3U3fh/xKjo5VqsxVK9Ij2G8+/8nzhkXk1hiMr7MH3d3xbsVouingIKbA0j2qGrdxPh28Y7FVe1Xu6A9y8sJQ0ugBR9GPl3Er5CbPVoh6yrBr9mPNbiC5kFt3ZGcTYgDL2H2lv4b1X+7gLls2iWi695rVrrQN/3yu3uXutQUe3mv79z+6HRQQLYE2B2LFwkclXfYiMtHLloA38pKx2eGAl1/i5068VWS3ZH33ycxMm03dWuXHie7AJ91v0z7t5sglPPQ== ARC-Message-Signature: i=2; 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=6eNmU1d7q4vzPnLUOhdCOMkS43jx6Os9LO8m/CYo9Og=; b=GBGzlzhVfE0CuTglOHSeMmAQLA3wIvqKi1CDluvdK8iN4o2rrAFWdxv9BY/KK8SzkkrZq9wYRB+dWmffzjs+Wv+4eqFWfSiYcu/3xMZl6TYe9yPCCHvr3OXEEL5S5JdgL9fLa+a/szB1gd0dsq5+ql+qnQI1FSMVof7YjIojS4C3C93G0RIU8/iz4x5ntY8npp/ZTxp8GoX7zSAx5DwjEJ605mks4ypnrrY45+39gMfYo/RSrXfnUQzGNLjOBOud7QOWgMnYhdKnHtw7sb1ZC6N+jvzm69XzSy75RXkHED3wW94eMPv9o00lsjvMJD/KcF4m2tUmgEazUwU39Cad6A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=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=6eNmU1d7q4vzPnLUOhdCOMkS43jx6Os9LO8m/CYo9Og=; b=O+tAeCt9UPVbr4L2iiRfEAuvhmY1X3gIkO6o8iLZIkP0SxeG5eJQo8vp202tXSt+irZgrUTIR0xU47Ml+RaoO2H+T5SG+TcPI/slmrpayhswy1utzCei+OXoW2A5+UbnkxNSMXhPZHUOnfvh3YMMdcRU/L2CjvuH6N7n7OdeR7I= Received: from FR3P281CA0074.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::12) by PAVPR08MB9820.eurprd08.prod.outlook.com (2603:10a6:102:2f8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 09:32:19 +0000 Received: from VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1f:cafe::1b) by FR3P281CA0074.outlook.office365.com (2603:10a6:d10:1f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.14 via Frontend Transport; Fri, 11 Nov 2022 09:32:19 +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 VI1EUR03FT023.mail.protection.outlook.com (100.127.144.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12 via Frontend Transport; Fri, 11 Nov 2022 09:32:19 +0000 Received: ("Tessian outbound 0800d254cb3b:v130"); Fri, 11 Nov 2022 09:32:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2ee502f700aab24a X-CR-MTA-TID: 64aa7808 Received: from e014236e146a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C69ADBB3-EE51-44B0-B3BE-27B8FA1EA572.1; Fri, 11 Nov 2022 09:32:12 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e014236e146a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 11 Nov 2022 09:32:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HNfllOEHpsXkqql20ghGBBXkORk9W94hMgXaKhsRLHu9vcvikxYyPMydd53EwrdesNoB8O5Cz3bhX5dqJbuGEVAKIwS4Ue18EQPJ4Pjs6LLCldnrk9Hdec80Slgm19enJKIqPMSwmAI61ZO2tTW5G0bTfmrSAPyYeZHalPa85a0YHA3HaaVlsDONRO4J7nlNcltjCXEukb6LjkgSKsuTSHj+rEXqbGQjtRfBchQylBGeoXW6cDnsgMrtdA0oJj8HB8kfaRNvvN3pT4nNBVwghAi8RvWdX6VfUnqg4bBUtQWuUce1iitbPKQM/dF6MuWc4SHriV8V51EQI8+NFqVFtg== 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=6eNmU1d7q4vzPnLUOhdCOMkS43jx6Os9LO8m/CYo9Og=; b=Tk6Tjww46T3KBBNcDVaogtqRhgK0IxoFxoJHRqHsJFWva+BhoSBcvpL0yS8FSggsyozN6Zw0yWHT4KhLC1Svp3Mxm++PucQLVFh1TWSiC4129LbNXVJFZzpw54qapbUZwIJrR1b4SiTDj8fdNCgPv0dRyUeYeAkDy5r1fP1fE88QtE+lPqUeSSAtIE1j9CYDVtUjp09FKiHtRfrGeyizASRjOynNxhfXqOXJK2GzN6yhzEgRJIzhSOAr1eHadypjNgBu9i5z/TK/EUax/rCV5D6MasHBjK+/jWAqsM5OQWQVC/mQZhfo+R6Pqya3uEeBZTZUPbB30XXVszAEgMFqBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=6eNmU1d7q4vzPnLUOhdCOMkS43jx6Os9LO8m/CYo9Og=; b=O+tAeCt9UPVbr4L2iiRfEAuvhmY1X3gIkO6o8iLZIkP0SxeG5eJQo8vp202tXSt+irZgrUTIR0xU47Ml+RaoO2H+T5SG+TcPI/slmrpayhswy1utzCei+OXoW2A5+UbnkxNSMXhPZHUOnfvh3YMMdcRU/L2CjvuH6N7n7OdeR7I= Received: from AM7PR02CA0003.eurprd02.prod.outlook.com (2603:10a6:20b:100::13) by PA4PR08MB5982.eurprd08.prod.outlook.com (2603:10a6:102:eb::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Fri, 11 Nov 2022 09:32:07 +0000 Received: from AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::90) by AM7PR02CA0003.outlook.office365.com (2603:10a6:20b:100::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22 via Frontend Transport; Fri, 11 Nov 2022 09:32:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT011.mail.protection.outlook.com (100.127.140.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5813.12 via Frontend Transport; Fri, 11 Nov 2022 09:32:07 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 11 Nov 2022 09:32:07 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 11 Nov 2022 09:32:06 +0000 Received: from e129171.arm.com (10.57.68.244) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 11 Nov 2022 09:32:06 +0000 From: Luis Machado To: CC: Subject: [PATCH,v3] [PR gdb/29272] Make sure a copy_insn_closure is available when we have a match in copy_insn_closure_by_addr Date: Fri, 11 Nov 2022 09:32:01 +0000 Message-ID: <20221111093201.747609-1-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026084100.28009-1-luis.machado@arm.com> References: <20221026084100.28009-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT011:EE_|PA4PR08MB5982:EE_|VI1EUR03FT023:EE_|PAVPR08MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a8c078d-a2a3-4e35-2ef6-08dac3c7a144 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: t9D/17qHMmT2nyJbyKm/HrHdf6b3IQ+bxZCXHRb6fUI3WzbTxnJhI2x//mHXZ25J43/vBz4yjM8QLqob+P3MQmvGdcs8FCo9BEozWpKlGaruABGrFL6UkfoeH97P2AimSRa0R8jad6D8F1AwZhVGeNrVIknJSskqTVhuAOQ0EXQrZWBQ+wlXZLXegFbDI5PXJot7QiDgsd1ofMYYrQYVrhGCPJ2wmF86trLDnJufJOW2+cjJHtzVDMYUjh/YGhbd88v+OcVIwsaz13lokdMvhGAgu9HhjuDDvjv6b2yn/2TfmiGz7ZNgg2idwMH/TfokIItAv8jC0/MGdRTc444qt5Tk1JMsAsUnOuSfgdYj1R/NiPOXWPiZp0lJ5YrDVQpfMBN1mDOrMiHcuumbiIi2Oovohyf3gGS5OTCUiFPHrNFMSgSBBeZQJeh0mkVaf4YB9kTMxFJsgBlfcjuOcg1pzvB8MpfrIKeaz55C4DSVpYe/So39J3tQVVmCptViOMSNBUVUqS82weeFP6r3sMOHuJUgIQbkQE7Psg0pEgBBRGnLOnP9WGzGs2vShTRDLZT5B9Zn4whHjNfuZf9yJI2wSr1JllP7THPHtjCaVZIWSDeLQxUqTi9Ob0KEWPiyLFkFjlCsPNUtoS8CX0notKEltq1RbGban2UXGdcpZy2V9AcSkA+hRJur23S5niqXukxHKytrBwE5N6FFK0KbxwFfICoPsYUDohMx+yk5vlcMf3++GZEivxYXCvuyAeWXFgu8YngCr6hVv0zG5gZMHKo2bfATngNGvx918y7Z23LgAPzqRszxM3356D3uifUkrAaMlz9/ablZZcZjFAcukPAGXw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199015)(46966006)(40470700004)(36840700001)(36756003)(6916009)(70586007)(5660300002)(40460700003)(316002)(70206006)(41300700001)(7696005)(81166007)(356005)(86362001)(6666004)(82740400003)(26005)(83380400001)(2616005)(47076005)(186003)(336012)(1076003)(966005)(426003)(478600001)(2906002)(4326008)(8676002)(8936002)(36860700001)(82310400005)(40480700001)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5982 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 32e7525b-7659-434f-98c1-08dac3c799fb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W//+N+y6HA9R6XTrW2GfHqxABAlu8dAYJlBD9gZlYI1dEvv0xUc6DAWcLtzBOowBNnlw6gsmnGiPljw4V5XxcjTPURg34pQUFMRm2IKSyqkHaQp88Lm9qEuxoJn9RAMDD451X/tBVJabZa22XCc12EU8q38nkTvYEeLiOl8RL0jqqWsFyfQ2u904xH6fyyghp18cwEa3oxZkbkJTTFqrDLo7xufqVX0jI42baWm7hU4LZebuLypGhCsb9cCghtBeF++/CxxH2wrdNq2xlspxmYII9nsV3q4pNhNwr8U9nBndyDD7Htc/rlgnmY9nvJaTpKTPZfg9+36Gux9vJ5Py4JDgiXDqI4DFVnLI3aHqBXBD/B0OZvxSZrbNqu6X280ztbDcB+/ix16n7uj6Z/73JtqB4ylKMjEcIfAsPM+MDkWLl33fnpCBxMRa8m9agfCDeVQ/yYOSIWntLxpDr2bwh6yie43+gvtCRPvE5nnfBkgrhIZz27WoD38uphZiKp3G3RFDs6jt13QdsxWyGfk6JJhBtPrEmDGqJ8LfwoD+E1l8UGc3ZEcao/Jy5u2xqBLzbTXoEgXhnuPiFG6udolMSbN2tMXfBQjddVisUoKRWdsAMdTSRrvsOIsrXlPTKWCxQhupT+CwPZ0YLcQgcOkzNzm8a58eEswUmbn9ASqUbtrIhlfnidKy+ZcUyKdZsCA3Qu9NiC4gVioSpaU3X4Z/CCq4z0VUc2Ab99Q2VIkzHS8rI293cc2wVxRkgVcG+7vbgILodmgjJSdltXylZPju3nB9whDXOph6AWbvUMtMq5U= 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:(13230022)(4636009)(376002)(136003)(346002)(396003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(478600001)(2906002)(966005)(107886003)(6666004)(26005)(7696005)(47076005)(6916009)(2616005)(1076003)(336012)(186003)(426003)(70586007)(70206006)(8936002)(44832011)(8676002)(5660300002)(4326008)(316002)(83380400001)(36756003)(41300700001)(82310400005)(36860700001)(81166007)(40460700003)(40480700001)(86362001)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2022 09:32:19.6761 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a8c078d-a2a3-4e35-2ef6-08dac3c7a144 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: VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9820 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,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: v2: Add try/catch block v3: Let it throw after all, and make the rollback cleaner. PR gdb/29272 Investigating PR29272, it was mentioned a particular test used to work on GDB 10, but it started failing with GDB 11 onwards. I tracked it down to some displaced stepping improvements on commit 187b041e2514827b9d86190ed2471c4c7a352874. In particular, one of the corner cases using copy_insn_closure_by_addr got silently broken. It is hard to spot because it doesn't have any good tests for it, and the situation is quite specific to the Arm target. Essentially, the change from the displaced stepping improvements made it so we could still invoke copy_insn_closure_by_addr correctly to return the pointer to a copy_insn_closure, but it always returned nullptr due to the order of the statements in displaced_step_buffer::prepare. The way it is now, we first write the address of the displaced step buffer to PC and then save the copy_insn_closure pointer. The problem is that writing to PC for the Arm target requires figuring out if the new PC is thumb mode or not. With no copy_insn_closure data, the logic to determine the thumb mode during displaced stepping doesn't work, and gives random results that are difficult to track (SIGILL, SIGSEGV etc). Fix this by reordering the PC write in displaced_step_buffer::prepare and, for safety, add an assertion to displaced_step_buffer::copy_insn_closure_by_addr so GDB stops right when it sees this invalid situation. If this gets broken again in the future, it will be easier to spot. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29272 --- gdb/displaced-stepping.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gdb/displaced-stepping.c b/gdb/displaced-stepping.c index eac2c5dab94..7dfd63d8716 100644 --- a/gdb/displaced-stepping.c +++ b/gdb/displaced-stepping.c @@ -139,15 +139,33 @@ displaced_step_buffers::prepare (thread_info *thread, CORE_ADDR &displaced_pc) return DISPLACED_STEP_PREPARE_STATUS_CANT; } - /* Resume execution at the copy. */ - regcache_write_pc (regcache, buffer->addr); - /* This marks the buffer as being in use. */ buffer->current_thread = thread; /* Save this, now that we know everything went fine. */ buffer->copy_insn_closure = std::move (copy_insn_closure); + /* Reset the displaced step buffer state if we failed to write PC. + Otherwise we will prevent this buffer from being used, as it will + always have a thread in buffer->current_thread. */ + auto reset_buffer = make_scope_exit + ([buffer] () + { + buffer->current_thread = nullptr; + buffer->copy_insn_closure.reset (); + }); + + /* Adjust the PC so it points to the displaced step buffer address that will + be used. This needs to be done after we save the copy_insn_closure, as + some architectures (Arm, for one) need that information so they can adjust + other data as needed. In particular, Arm needs to know if the instruction + being executed in the displaced step buffer is thumb or not. Without that + information, things will be very wrong in a random way. */ + regcache_write_pc (regcache, buffer->addr); + + /* PC update successful. Discard the displaced step state rollback. */ + reset_buffer.release (); + /* Tell infrun not to try preparing a displaced step again for this inferior if all buffers are taken. */ thread->inf->displaced_step_state.unavailable = true; @@ -264,7 +282,11 @@ displaced_step_buffers::copy_insn_closure_by_addr (CORE_ADDR addr) for (const displaced_step_buffer &buffer : m_buffers) { if (addr == buffer.addr) + { + /* The closure information should always be available. */ + gdb_assert (buffer.copy_insn_closure.get () != nullptr); return buffer.copy_insn_closure.get (); + } } return nullptr; -- 2.25.1