From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150048.outbound.protection.outlook.com [40.107.15.48]) by sourceware.org (Postfix) with ESMTPS id C23873858C55 for ; Thu, 13 Oct 2022 13:11:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C23873858C55 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=E98NvJE5gY2HKN9j2OovmSSS0YULnF6p6klxdXELuK1HDN3C7cTovIAIN3ZRIvnEl6VLXDatfJcK9HwAHKbYk0WzlChXVXPYaAmdeXYYm99fvCgvUzFqjl7G6c2c6/I4Wxn3A1JkLRaCOxg7fLVrdogj60KCRqOwBa+cFQn3WJxfSMdOfktvzQsx8p4F9rd6rDLnsoTFn3SjPp/1BtB6jN6ol//LUNuu/aJhWP5gpzdQD4YpXfxjyFH6DelzSnZWNCb3sZsYut2jtxrdgwQT2RUb3kMvnMUwvqzwXtsa8gcfOGZAX64iRG+LyUXDdGF/vp/r/khdzZSgt4My0zoJQg== 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=fscneGs+1dSj6vTEDG73WfsqH7J54WWEPF3Ze7MAD1E=; b=i+djmG0t+05ZkJj65nChgZSDmORtigLC9YslLDv1MTlI7JrxFP2v8Jdxle45W3ITsZ42CL4mxyXcQYukstAoSnsCUUknocTIcUJEkNSYf91MtZAZXaauzpCqbPTG2Q3sC81qoon7hBLhq9KdBxOby6/L1mDA7kXt+3PFzEvd8wMx9KcYbQTrolRMtTBO9hEs7LHQIiS+uhVYnKz+bC2eeHQudfkLYi0+c0QEnz0H9+eVMJV7xmi3AU6UHRvPza+/OJ44Mtn/N/9e+Ooq2vB4z7IPbKb4G65CYaf+KTFSJs2Na9tkgII7u1ojc45cXC8mnmV7XcZwbU+rxKCF9HZwSw== 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] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS8P250CA0023.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::28) by DB8PR08MB5499.eurprd08.prod.outlook.com (2603:10a6:10:fa::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Thu, 13 Oct 2022 13:11:51 +0000 Received: from AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::d8) by AS8P250CA0023.outlook.office365.com (2603:10a6:20b:330::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26 via Frontend Transport; Thu, 13 Oct 2022 13:11:51 +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 AM7EUR03FT064.mail.protection.outlook.com (100.127.140.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Thu, 13 Oct 2022 13:11:51 +0000 Received: ("Tessian outbound 99ee3885c6d5:v128"); Thu, 13 Oct 2022 13:11:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3bd14f6813277dff X-CR-MTA-TID: 64aa7808 Received: from c977a06ccc9e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 152B1F39-5FB3-481A-B9E4-F9DF92E4F079.1; Thu, 13 Oct 2022 13:11:43 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c977a06ccc9e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Oct 2022 13:11:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a621TkUK+MOLvb2RcNfgnni/VgB3J6VxLSr2J1oTzPcb5DT4+l3MQZmJTACjG/L0HSWQ3OQJL5ADS/xDJZcYucL+W0CZlNG5nC+2hjgAL52TAEo8LD4V6SfiZ4wMQxa2BnR8/7tR2abutfsFpTqCuKzdK6ZtAtUuytn7YUkTNqYoHLii7Jti/+pe1YdpgN7+dnBIo41wyaowYbABX41x0zRRdu9VsIG/Up5Ab+WclideSwsOFXNmFL5AxdVRzqwskBMhwZNlAs3doPiftbMZ85A34+1IFzhYtRqiXVS5XpTlGhYAAzY6TbggGVkaEXlRX0iFHzhwhddCjAABy7+N+g== 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=fscneGs+1dSj6vTEDG73WfsqH7J54WWEPF3Ze7MAD1E=; b=IHde33xd6uUVllA/dr3Vre2NhYVxnTMdLbJvJJAzQGkV++tnaD0CC8CAvENXyC3J3jZCsVRGFd817f1udvW8BV04vZ/IpZF90yvsZICrdFBoVFKUalnACAqVMOPgjDumJYlmC0tXKPHTHFYKne/ZfWGZx7mCGj7tx1L/PXaIr90jvHqHBzXwIZ4plyGk67uCTEw2JrTORoJKHaEhDOPCUeP8yYS2Na6svbIsxpFlM4ZM1mS4zzFUhYJVfmTiwisgP2URGP1RpPnCQmlGTYHo3v/jtuJV8LZCKZw+4Obbj5aTVFQj/tzPq99vJfpzxEHVL9b6XPb2FvdJ9eweFlVbwQ== 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 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 AS2PR08MB9449.eurprd08.prod.outlook.com (2603:10a6:20b:5eb::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Thu, 13 Oct 2022 13:11:41 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bbeb:a49e:d969:5d2]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bbeb:a49e:d969:5d2%6]) with mapi id 15.20.5709.021; Thu, 13 Oct 2022 13:11:41 +0000 Message-ID: <94af9e31-5092-1b6d-8520-d58c13d02631@arm.com> Date: Thu, 13 Oct 2022 14:11:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2] gdb/arm: Stop unwinding on error, but do not assert Content-Language: en-US To: Pedro Alves , =?UTF-8?Q?Torbj=c3=b6rn_SVENSSON?= , gdb-patches@sourceware.org References: <20221013091740.645783-1-torbjorn.svensson@foss.st.com> <9cc66b68-94b4-ed24-f4b5-93a441b8a70d@palves.net> From: Luis Machado In-Reply-To: <9cc66b68-94b4-ed24-f4b5-93a441b8a70d@palves.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0127.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:193::6) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS2PR08MB9449:EE_|AM7EUR03FT064:EE_|DB8PR08MB5499:EE_ X-MS-Office365-Filtering-Correlation-Id: 60206fbf-b3ac-4acd-8ec8-08daad1c7e1a 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: 1YxNiz+0a8qxJfODaJjhtg1vtMo6s0lNUI37bFq4idL1jDzX6agPLyyPVcacZaKEiYaG+h8K4Sej7VuqjrGOy4HPtJ4Q/H5LS+lEPLgXQVlRUQ1H+l3UNdDcYmnEbfrFViLJmAASpzTLCErUXdwZmn3ClGRtcg+wiYebFJHmnlswQ4Fa2Y4bM5CyVgEinGCmHzcfr5gB65WgxbFMGL87OzhEHxIQXvixn1VzGpePBZ1UTB88+hYKp9OWGRi8rKZ+2oXO9EgnKlNCPGOESzHY6uLZjqrvqPODz9lXkddS+YKZgYeMq9gukHqftbu9vtNA5iKSfXuYXFB9ydx20SsMOP/yvwGWY7alFwBOEoTgZoDt8+xbROS25ae5GizALhpXAQ+jd7nrq6E+864KzhSeYBVubdY13W7YcuV2cix+BHHIl+Mb4J0ROPipSf1XJeCpeq1K39tCPAklwRWfE4redmD34/GskROGbO1Rne/c+1Y9+kXuhG2tl1acjL19ZUW50YbBECKAYaVGANsd5ddPfaafp15QHLQFxDq0KwNmf+NlC9R3fncHz1HaP26pxD1E7sC48MNG/IzmG29JIbd0w8vb7DQu4/Aj10hqqaeka/sgCNdWBv62CQIyg6y//Iq9sMOBxAsBefvFAwyto2ad69vCIs790JxpY1KyRJgDC0UibJt5+POY9MCVaNFD/2+67tAzBxsgohO6X+GkgYSAGn/agNPukMZujHBIwgvD+JhqL01VFHky7e58Wvh5+MwmHX8fRSUajRWG5lfe3AowhZfVW95OEBSHhj/dfsEGZH0= 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:(13230022)(4636009)(136003)(376002)(346002)(366004)(396003)(39860400002)(451199015)(31686004)(36756003)(31696002)(44832011)(5660300002)(2906002)(4001150100001)(38100700002)(2616005)(186003)(110136005)(66574015)(83380400001)(6512007)(53546011)(26005)(478600001)(6506007)(66476007)(86362001)(6486002)(316002)(66946007)(66556008)(8676002)(41300700001)(8936002)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9449 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: AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8d734848-1cfd-4afb-7b26-08daad1c77fb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RX54KPzOFSi/hZweb23m0nHxoZJrzPdfLgjVy+1O0TLdb/UoDUUxIP93tBMLGDCfjlD9NgO3T3gqlvrZcXg1aMwihqhRp5iOS8ckcniDzYfDx8hOLG28FihahjybcE0P4REzyY+YCLTl1LXJaOhRgMPuKxWygLBxXtBuuoWSmxOhTFYushK9yemqWfnZn9rtwC7BgOT3jO1fSsQiS2H2hHfioVcpMuk8smT/KJE/IGTvQgd6nDGsmQDDMqGaGQ6RjTPPG5YOOKut4v0Or0GMUPGtSAPaLNoLdY6r5rmw2FIp3QcKF/+89gay4ZluaHNErSS16cJ/mde2yaMZZr8QddJoMEvmpTYnnWfmIek8IGbcizZjhah8oxCXWBbIG5ZL8CnBL7n03a962R+6bqtVLso80aO2kZyFzCObZIBW/7DiQ+uQQW74Wc44iPBUXt5GB5/rr4TBOZtvL7pETcT3inxFZrWtY/1qxRbq3qe5KMh/huAaR7tBzrcxmyq2U4SZyp0cvgsznwS8lcNIEpmh1wTwUErUdxpd1Em+gpVajJ9LzpXgGziuM0NyqyTiunbS9gVEYzNrut7IXH4A8QSz/ZtamThTBVPIh2jv5WfAv1BJq8NtK8Qq5A94rL0jI8UH2BCysMJrPaoLmHh9K+MEpbjBN9Futds+C5qjGJqmrE3qUQn3S5nj8aU2cqp5NLAMbU0dcmejX3lJmKqRlETwKDJkqZucueDxHJAf85LnFXfmjCa2y9y7DJldRcoIBRQGlzrAr4vHjQRu0HE5JW2b/TymO5XcV4b4lKVQ7l90i5u3IfW58hwtpB9AZ5Ka/XpD 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)(39860400002)(396003)(346002)(136003)(376002)(451199015)(40470700004)(36840700001)(46966006)(6512007)(66574015)(478600001)(41300700001)(44832011)(6506007)(336012)(8936002)(110136005)(26005)(86362001)(47076005)(6486002)(40480700001)(186003)(316002)(36756003)(5660300002)(53546011)(31686004)(31696002)(2906002)(82310400005)(2616005)(36860700001)(356005)(83380400001)(81166007)(8676002)(70206006)(70586007)(82740400003)(6666004)(40460700003)(4001150100001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2022 13:11:51.2080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60206fbf-b3ac-4acd-8ec8-08daad1c7e1a 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: AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5499 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2022 13:11:56 -0000 On 10/13/22 12:21, Pedro Alves wrote: > On 2022-10-13 10:17 a.m., Torbjörn SVENSSON via Gdb-patches wrote: > >> + /* Unwind of this frame is not possible. Return outer_frame_id to stop the >> + unwinding. */ >> + if (cache == NULL) >> + { >> + *this_id = outer_frame_id; >> + return; >> + } > > Please let's not add more uses of outer_frame_id if we can avoid it. We're getting > close to eliminating it. Can a cache object still be returned, and then a frame id > be successfully computed? Sorry, is that deprecation of outer_frame_id documented somewhere? I haven't seen any warnings or comments stating it is not supposed to be used. It was even made more explicit with this commit: commit 84154d166a1a4592c70e2a8296d5df0ad7f89be9 Author: Simon Marchi Date: Mon Aug 31 13:23:12 2020 -0400 gdb: introduce explicit outer frame id kind So this is a bit confusing. > > You can stop the unwinding in some other way. For example, arm_m_exception_cache has a few > of these: > > /* Terminate any further stack unwinding by referring to self. */ > arm_cache_set_active_sp_value (cache, tdep, sp); > return cache; > > (Not sure exactly how that works.) It probably works by creating a cycle that will be detected by the unwinding machinery. > > Alternatively, you can implement a frame_unwind::stop_reason callback and return > UNWIND_OUTERMOST, which is already done in arm-tdep.c in other scenarios too. Maybe we should clarify these uses. It is nice to be able to stop unwinding gracefully, as opposed to issuing a warning like "previous frame inner to this frame (corrupt stack?)". It seems UNWIND_OUTERMOST might be able to do that.