From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2072.outbound.protection.outlook.com [40.107.249.72]) by sourceware.org (Postfix) with ESMTPS id 922003858C5E for ; Thu, 12 Oct 2023 13:12:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 922003858C5E 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=ZrmwzLth5jZ4tvUUJhfLBz0JMHbNZdOUQiV/OCFsRZ8=; b=4vQ4z3k47apzCn9X0Xv5wNe2W8heXwUFyC1LFteioz+WbwuKw8OF4EJ2uNFKFOyUtzmeBsMDRsSCU3XxeX9jHfv0Y5ISQfOggGEaouEiRFtfg0IDP6Zrxqob4/bTcnir6KjKiMhAOv36yhJ9y4JzJ1RqNw/V2sQnSUuVfmaWC5w= Received: from AM6P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::26) by DB8PR08MB5433.eurprd08.prod.outlook.com (2603:10a6:10:118::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 13:12:06 +0000 Received: from AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::eb) by AM6P191CA0013.outlook.office365.com (2603:10a6:209:8b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.29 via Frontend Transport; Thu, 12 Oct 2023 13:12:06 +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 AM7EUR03FT065.mail.protection.outlook.com (100.127.140.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.27 via Frontend Transport; Thu, 12 Oct 2023 13:12:05 +0000 Received: ("Tessian outbound 9aeaca65ec26:v211"); Thu, 12 Oct 2023 13:12:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fc59a76323eb2fd1 X-CR-MTA-TID: 64aa7808 Received: from ef713fd2f69e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 59C669DE-B7B7-40AE-BCBB-E407781F73B1.1; Thu, 12 Oct 2023 13:11:58 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ef713fd2f69e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 12 Oct 2023 13:11:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iH24BzAsVCXa+OVnBVWM3kmFqlJEbVVh6EzioLCV/q9PmEWef7Zq/K7DHnHlhHe7q+6zdH7mhyH6qfEivSFirfjP5wqwesmbx35KQnjm8wNL1Xea158de8IgEGEDudsZtBBLH86+lKk4EXzmtzeBIC1tuFVwdlioFOQhE4ICj8SNBKydxPJRHTFLNIUv3rh+69v+SdTkKwX1JXESjhfcHPZe2ZclFWZ2nEyXeIWHb7tX/jpP5707MQD/KfQkDvEjVm8xXeKxFCXvi8vfy2ewPra0McioUFtNuh/JJbOkCag9nzT3I8mXxdoS0MJpquXMYrLlFkqPwHKbqsbQK4Clnw== 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=ZrmwzLth5jZ4tvUUJhfLBz0JMHbNZdOUQiV/OCFsRZ8=; b=SjGroMEUbuhhEpb/yzqKByVUsVbzx/m8HvAjjhpN90iacDUuDR+FlpJ8NRk4tsig3IJivCRcVRSUFwIjffdhTAtOK+xyeyn/mJUTxtDnef5mgZMHkviNF6RRr98qaz5yEpqv1ZDjxBpJU/gngSyMnZGN3Fk5ndTrDPLAiPvnwyXowR8Pn+fIKOsOVSNQtnG3JFwy1zpR0/qyjYlLeRGco+7t8O0z8W+gi5+cvB8ggEbAH6roHlXeFJ66fXJfKkatwbpF4MkuAB45LVS5V0Q+KSpj9AjY2WMYukFZqNX57D/5gjUSA18uhhnrzR8W4qoEV+xGiM54qfuHVssAMFEdwg== 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=ZrmwzLth5jZ4tvUUJhfLBz0JMHbNZdOUQiV/OCFsRZ8=; b=4vQ4z3k47apzCn9X0Xv5wNe2W8heXwUFyC1LFteioz+WbwuKw8OF4EJ2uNFKFOyUtzmeBsMDRsSCU3XxeX9jHfv0Y5ISQfOggGEaouEiRFtfg0IDP6Zrxqob4/bTcnir6KjKiMhAOv36yhJ9y4JzJ1RqNw/V2sQnSUuVfmaWC5w= 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 DBAPR08MB5558.eurprd08.prod.outlook.com (2603:10a6:10:1b3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.43; Thu, 12 Oct 2023 13:11:55 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c126:1009:20a5:195]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c126:1009:20a5:195%4]) with mapi id 15.20.6863.032; Thu, 12 Oct 2023 13:11:55 +0000 Message-ID: <897a57fb-f9dc-4a71-a05d-6c3e3b1d1f4d@arm.com> Date: Thu, 12 Oct 2023 14:11:51 +0100 User-Agent: Mozilla Thunderbird Subject: Re: Thread Specific Architectures And Python Unwinder API Content-Language: en-US To: Andrew Burgess Cc: gdb@sourceware.org References: <87bkd5czqr.fsf@redhat.com> <05568109-8df9-4a48-af04-9f784bf0e4d8@arm.com> <29fefb89-9934-4e9d-9ea0-adf40789e921@arm.com> <87wmvsat8i.fsf@redhat.com> From: Luis Machado In-Reply-To: <87wmvsat8i.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0024.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::19) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DBAPR08MB5558:EE_|AM7EUR03FT065:EE_|DB8PR08MB5433:EE_ X-MS-Office365-Filtering-Correlation-Id: 3732c0ed-f6d8-40a1-a1dd-08dbcb24d515 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: 6mC/ia45PkLfbj7vBv8ke6dri4PsZy4G3n8awLXUGJtyV8whPOsireGvNlUktJ6/uTAKUew/HGu95B0GOkeQAYA2OuQrgiHSeoEgKP/D6g94FCcbUbq8Oh/yE+NE7NccNgdIAAZcfpaVuKthqbo1SB3Ncf9A+PH7y94ZCc6EJs7EZD79ARDbPxyRT5zdl1V+1Ygsg7J+RDSaJpp/jDVoaV0gRe0MpADiiXENjNbHMwo2HqOniHuvRqYGX8rLcJMsLSeV0101Fljc3vnyVNEKnU5zejfpY4r9Y0QUrC7YIVQoaLQ5sktB1zzgKFA0gX9RVe70prkJMorzVlqV+AAZKQorz7juFuaaEVCYn16tcRb6MNUR1/tyOLB3eVDhQ9NwqtZJQHMDBUetB019ZkIYGDs8+Ao+3yXiggIRDqkiwDjVcsIYMQpeX2jban9zCSLp4Dq/szS5l71wdbXn75Di5Bh28JTW6xLo7RdFH86w50Sit6Tf0W7bPTyuI3+8W1CU/VbQSdnixlQJmxG2h3ne+IuLr2DScmNzRmLCk89BDl69NLbMcLynpWVqXu6LtykijrXDIpo3lKNKw3ZSXs+4mZJoyLWx6y9j7mfBu+kXfeT1iy8zXLryS7iSE6ioPwiRxcKOgl7UBzrtLLY2XlZvtw== 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:(13230031)(376002)(136003)(39850400004)(396003)(366004)(346002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(86362001)(31686004)(6666004)(2906002)(83380400001)(41300700001)(44832011)(5660300002)(8676002)(36756003)(8936002)(4326008)(38100700002)(66946007)(478600001)(6916009)(66476007)(6486002)(66556008)(6506007)(6512007)(53546011)(26005)(31696002)(2616005)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5558 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: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 193fabc0-26e8-4989-5c19-08dbcb24ceb8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uV/UbPRg4PXCiJxOczdZwDbIwlBuljp62X8y4cdTpzGQ7lVcgywEQNDYzKCJhBNb1ltyB8yGghh/WyqmiXX4EIF4WedNDcua3rTzvxJK3LaJf7u6pKcdXI7XlgdHrYytbykLxqUoRc53vCUStxRpK5T0gzH8Gkd+DWvrSpQTqyoJNS5veBZL40KxCTQKlzPYt8cLrDJ82Z+cdLNxkJ/MqEPOl1mGWqAQHjjh/DCcUlrwrcthssjzV2hcmdSbmy0qN3DGvwH3weHgRlgAmG9ot+kqwMoGIPZGb7i2j81U78mU3bjaCQvYlJhJ95y9DYwEyMnAX7S/fBBxHPoLEYs8ayXlhsbDRrMtuCHyPUoChfFokenhZXCP4HaxcAFiTZUG2+BzSpVyRWIZOL9VMAWZ4fZKUz2thKfNfuvDGpUG7C9g48fecl92HfFg/Jr/4kPm39NoNrEQhaxCnxWpry1nZr8b1NvkiSY7IwtWDfv372bXQKYO3yBLa9PWbrmp+RUos6t1Ytj1IoO/4a0/lRzLMAtlCCDRA413ORfPVPyyndprcrDZs3ZgjHlFAMTRLfnl61dWEQMnwJwmw5oKciIGC00B3cLy6rux6W+eEKwtns28AWVNlXHmWUq9fyDNdi3oSeZVLaHBFctt372PZ33Uq+tivDZryfe1istuobHi3yqVEoex/TfcQETjA4vVlx2OFCkeOQcakYrP+8dXKTYZQ2nnLUxZG2XkFm7DqBkpeSzHKVB6H5xqWFvlUaPSi0on4y6xFEkqL7GOzZ53d628aw== 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:(13230031)(4636009)(39860400002)(376002)(346002)(136003)(396003)(230922051799003)(1800799009)(451199024)(186009)(64100799003)(82310400011)(40470700004)(36840700001)(46966006)(6506007)(53546011)(6486002)(6512007)(70586007)(70206006)(2616005)(316002)(478600001)(31686004)(6666004)(26005)(4326008)(6862004)(8676002)(336012)(40480700001)(8936002)(36756003)(36860700001)(2906002)(81166007)(356005)(83380400001)(41300700001)(44832011)(5660300002)(86362001)(31696002)(40460700003)(47076005)(82740400003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 13:12:05.6814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3732c0ed-f6d8-40a1-a1dd-08dbcb24d515 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: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5433 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no 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 10/12/23 14:02, Andrew Burgess wrote: > Luis Machado writes: > >> On 10/11/23 11:06, Luis Machado wrote: >>> Hi Andrew, >>> >>> On 10/11/23 09:47, Andrew Burgess wrote: >>>> >>>> Hi Luis, >>>> >>>> While working on something else I was looking at the Python Unwinder API >>>> code, and I suspect that the thread-specific architectures support might >>>> (currently) break the Python Unwinder support. >>>> >>>> If it is, then I think the fix is pretty simple, but before I posted it, >>>> I wondered if you could confirm that things are indeed, currently >>>> broken. >>>> >>>> Attached at the end of this email is a Python unwinder. You'll need to >>>> supply your own test program that makes use of sve/sme, and thus uses >>>> thread-specific architectures. >>>> >>>> What you'll need to do is: >>>> >>>> $ gdb -q test_file_that_uses_sve_sme >>>> Reading symbols from .... etc ... >>>> (gdb) source ./unwinder.py >>>> (gdb) break function_where_a_thread_specific_arch_will_be_in_use >>>> Breakpoint 1 at ... etc ... >>>> (gdb) run >>>> Starting program: ... etc ... >>>> >>>> Now at this point, when you stop, you should see at least one instance >>>> of the banner: >>>> >>>> *********************************** >>>> * Have executed the test unwinder * >>>> *********************************** >>>> >>>> being printed, probably more. As you step though the function you >>>> should see more instances of the banner being printed. >>>> >>>> To reveal the bug then it is important that when GDB stops in >>>> function_where_a_thread_specific_arch_will_be_in_use, the per-thread >>>> gdbarch that it creates _must_ be different from the inferior wide, >>>> top-level gdbarch. >>>> >>>> If you don't see the banner then my suspicion is correct, and the Python >>>> Unwinder API was broken when the thread-specific architecture support >>>> was added. >> >> I've confirmed I don't see the banner. So this seems to be broken. >> >> Is the fix to set the python unwinder hook elsewhere? Or maybe save that >> information when we're trying to pick a different gdbarch? > > I'll post my patch for this later today. But I'm going to propose > changing the 'architecture_changed' observable into a 'new_architecture' > observable (which is called in a different place). As such, every new > architecture will have the Python unwinder registered correctly. > > I just need to update the commit message with some details of this issue > as justification for the change, and I'll post it -- it's a pretty small > change. I'll CC you on the new thread. Great. Thanks for the heads-up. Let me know if you need some more testing.