From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2086.outbound.protection.outlook.com [40.107.6.86]) by sourceware.org (Postfix) with ESMTPS id 6B7383858D33 for ; Wed, 1 Feb 2023 16:32:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B7383858D33 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=F7h6GWgMSOSto7jHZ6TFVehj8uhqeuEdryHsTXbuljg=; b=cbhI+3PEaCJ6R5SchKeQEkqQuUtp5uqKYcxdixByOlVj3Kp+BQxIu0ZH0/+s4lvC6aUiJnImjCZXpu5bTEHOgZ7qvCvLwULc4Pgl9aIu/qCU0m+wx9eJ+UD1ePk7lREpESsK2L7HzOjHKcsmn27lpdTdXxMP76w9+Jln2x05fjU= Received: from AM5PR1001CA0010.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:2::23) by DB4PR08MB9864.eurprd08.prod.outlook.com (2603:10a6:10:3cf::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Wed, 1 Feb 2023 16:32:13 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:2:cafe::a6) by AM5PR1001CA0010.outlook.office365.com (2603:10a6:206:2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.22 via Frontend Transport; Wed, 1 Feb 2023 16:32:13 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Wed, 1 Feb 2023 16:32:13 +0000 Received: ("Tessian outbound 8038f0863a52:v132"); Wed, 01 Feb 2023 16:32:13 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b0b76130e7fe0f14 X-CR-MTA-TID: 64aa7808 Received: from cea60be70522.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0B790D99-FFBB-44D1-8671-99962781BFE3.1; Wed, 01 Feb 2023 16:32:07 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cea60be70522.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 01 Feb 2023 16:32:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iVfuxr7p2nS4RAufIs9FG0DA0WQJqhNAo/ybU4hReIVDB3HKDO4DQpG+9LX3bSXi+FE8eoiJ2O8GtANR+Em0XNAF5x1f2xpwb4ukSIoZrZpN28whGKFPruOnAPp6e4iFO4a4BHe/nQgZ43qHi6aGL2a1Wry4eghFBKhxnosQaPOOPj7zEPgyNnGuUfZk8YX8yragKF+RpHM7Z3GZxwA4FJUBRhposD28HS0CtajnAvDHIVGlDkmjbMNp9nBn0Y1412JwA3P9ewJNgFp2ZWUZvA70cKks5Ip9PBOXuVU+eS5D8TItAFH3+1S6+VwEOpTvYx8U3VJA5Vb5w4poreJpiA== 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=F7h6GWgMSOSto7jHZ6TFVehj8uhqeuEdryHsTXbuljg=; b=LfjVJjsKOH9QApJSAzl/sbzS+alYIWd3mct5rsDvEj3I2698vACYFURX4S7gg6hiWQ5ZkW8SrRonVYk+G6iQ0L4e9Ycbdy1YC3v8pMx9U+jfXDKp1kOoUKqT6nR+9X/Mp3nlxHfyKel1gcu7JIVujv8KnCX3qk+/l/nu38OWR0HiSbc67e4qX1UghLvNAE3Tk+o+6V6YsjM9oZ/sMSPEKVdd1EWXXqYRdrjMtqk36BMEPRqKrjHLq7/oy/xJuMukvMTnpdDoUInZ+KQvkv0hAanRvycqhTO2h4hycBQRkkCLZDgOZkrAAOiiI0QTKjn2iuN17b061N3u8PokmirnRQ== 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=F7h6GWgMSOSto7jHZ6TFVehj8uhqeuEdryHsTXbuljg=; b=cbhI+3PEaCJ6R5SchKeQEkqQuUtp5uqKYcxdixByOlVj3Kp+BQxIu0ZH0/+s4lvC6aUiJnImjCZXpu5bTEHOgZ7qvCvLwULc4Pgl9aIu/qCU0m+wx9eJ+UD1ePk7lREpESsK2L7HzOjHKcsmn27lpdTdXxMP76w9+Jln2x05fjU= 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 DB5PR08MB10312.eurprd08.prod.outlook.com (2603:10a6:10:3c1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.30; Wed, 1 Feb 2023 16:32:05 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%3]) with mapi id 15.20.6043.036; Wed, 1 Feb 2023 16:32:04 +0000 Message-ID: <9a85e2fe-078a-e2ee-7e49-53fe0ceef492@arm.com> Date: Wed, 1 Feb 2023 16:32:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description Content-Language: en-US To: Simon Marchi , Andrew Burgess , Thiago Jung Bauermann via Gdb-patches Cc: Thiago Jung Bauermann References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-5-thiago.bauermann@linaro.org> <87pmattzjw.fsf@redhat.com> <7970ac03-1123-d5f6-7b17-808832d43be6@simark.ca> From: Luis Machado In-Reply-To: <7970ac03-1123-d5f6-7b17-808832d43be6@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0079.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::19) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB5PR08MB10312:EE_|AM7EUR03FT021:EE_|DB4PR08MB9864:EE_ X-MS-Office365-Filtering-Correlation-Id: 17cec194-5179-4dbc-fde5-08db0471dfc5 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: emWD8OhIIOjudKyFM3aGAnf1pZMESq/aUIS4qZKfmTP+UIpcHq5yg7QLKWwHaGd4c/3FIWG6iLANvumoLPsI+MFMiEuZ+1HyHtLrVcvB9XZ6drN1M1+ztc22dL5I9U+J6ftZt7r3X+tJEWxTMTlAtqVyoWKGuoxh6xskjITPuy9fu8PerhHDCHnEJb2s8QC6Qzk1Sm9YXxGKkK6GUTFsuJGC1DlnKEgWTr6XrhH2T8e9uguh++BOX6eEn5IgkuXR2cj0Lkipr+7gmeFcvVSJlgfNQMk+eT+41G+hw/nbzLkHulIIOZ8IHBWUblTLj0cNpOo+kmT06/t7itbyBKhFx5zx6kEqtP6M28KIBit8ZIcaAnCUMV7Yx1J6pwClbO7iT8E6ll1BQqXWAYzGfAR6uzPTAQEo0Yyx5d6Ct9LMbLElZxDw6PvnTZo110Nq5Ym/CiTf3DRM5GruTaT72Hz3oRJNJPh6vhnTqc0EKUvyjBOAN+8RZlrkkVBiKC7wlbey5+7YSmOd4ihqX/nBDl5v9S0tNatVuB8bAW6dydriExQH+tNDIGeTPQ/ufvaqHeeQXZ2mUuQsx4Xslolmx3w3t/f4H5PSZR0/qQooLCuMJXzoQbS12LpvLbooZWL88HAjulAwrrEMsJunxBTzo+Zqm0VsPMV5Ve+r6Uq3F7oSJyDJAA9JaGQPg1tTzxLvPDqPSdIq3fc4HvOzEcXiMdwh2s5um39Lq4aUe+/nSP7CmJ4= 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(31686004)(186003)(44832011)(5660300002)(2906002)(41300700001)(86362001)(26005)(8936002)(6512007)(53546011)(6506007)(478600001)(36756003)(66946007)(66556008)(110136005)(6486002)(66476007)(31696002)(38100700002)(83380400001)(4326008)(2616005)(8676002)(316002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10312 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: AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 29390459-16d8-4398-6762-08db0471da2f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HnwOg2YQaL8XUxwf1CIVrOcViVMsSI6yOp5aSH/O7xrQJy9DRweMqoEPAAXN1IfLDk07ypDzOxm3CYFUb/ex/xX828470xpNYVwqdC3EpTFL+kcxCJ3YkxLyeiDPzf9UO0EssxxgYy7TXh5+nW2ZIUOzFXpyPe1oKUzAgwMcZmioBWvDi5ELUkeWMpAghmaUtpIaGQug9+ZCSDEnEDkqNtZR4eeMepSh+h6DUTa6K3XBsy90G3iiZsVWVcgVZ1s7hX/XQOHOMRfVEAj5/cQjPormvcrpPNz2tIsdJig/DPb3n7b10LbPWP0F8zMebX2px1h8GvQwVWAIaIOA9bYLr0eFH57ZN/fP3WnuTNqsXlo6aPcaZMzcYsWKlnpUnmZlXroiYP8nBy8M7/vL0w60DpDCo4+VINjvgDtWiiUJTjynMbBNesYtDwG3RjKJ2iTWcxm+uUONqxK3kvyr6A4NNosPU9zn8e0co2pgGv7aVgkPiDa+Swqw1nAlLAXH7OhwH09JG2QedX+bOqQKd9RUMPdw8OOrgZfKGTyZd5n+nj/GJVtLbdOGjDdmj2J7VJMeB2W3sMhN1Uf62u08mV6pGLrqymsNFBpX/Xfa2XYeRtjYprpvicD74xoOv1akyrwsUOR3akjRqrHaRsgo187lEe6gPMIFoObRYGSCXnnSHk1C8k05Vc1nU3bRAcgj/7XZU+5LPM+mNavo+DZPO6O5AMy+tgWIIuouuvhcmrON96k= 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)(376002)(396003)(39860400002)(346002)(136003)(451199018)(46966006)(36840700001)(40470700004)(44832011)(41300700001)(336012)(316002)(5660300002)(86362001)(8936002)(31696002)(36756003)(40480700001)(83380400001)(82310400005)(8676002)(47076005)(110136005)(4326008)(70586007)(70206006)(478600001)(6486002)(2616005)(81166007)(186003)(107886003)(82740400003)(26005)(6506007)(31686004)(53546011)(40460700003)(6512007)(36860700001)(356005)(2906002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 16:32:13.4542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17cec194-5179-4dbc-fde5-08db0471dfc5 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: AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB9864 X-Spam-Status: No, score=-12.1 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: On 2/1/23 16:21, Simon Marchi wrote: > >>> diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h >>> index 221de85aa2ee..b52eb23cc444 100644 >>> --- a/gdbserver/linux-low.h >>> +++ b/gdbserver/linux-low.h >>> @@ -604,6 +604,12 @@ class linux_process_target : public process_stratum_target >>> /* Architecture-specific setup for the current thread. */ >>> virtual void low_arch_setup () = 0; >>> >>> + /* Allows arch-specific code to set the thread's target description when the >>> + inferior stops. Returns nullptr if no thread-specific target description >>> + is necessary. */ >>> + virtual const struct target_desc * >>> + get_thread_tdesc (const thread_info *thread); >> >> I think the comment for this function is not correct. The function does >> not SET the thread's target description, but just GETS a target >> description suitable for `thread`. It's the caller's job to do the >> setting. > > This comment also gave me pause. How does a getter set something. I > then understood that it allowed the arch-specific code to provide a > thread-specific tdesc. I would suggest just: FWIW, I read it as "the functions *allows* arch-specific code to set". So it doesn't set on its own, but it does allow something else to do it. > > /* Return a target description for THREAD. > > Return nullptr if no thread-specific description is necessary. */ > > The other thought I had while re-reading the patch is why do we need to > return and store nullptr if the thread target description is the same as > the main one for the process. get_thread_tdesc could just return > process_info->tdesc if we don't need a separate tdesc, and we would > store that same pointer in thread_info->tdesc. And get_thread_tdesc > would just return that (in fact, get_thread_tdesc might not be necessary > then). Perhaps it makes some things more complicated down the road, but > I can't think of anything. Sounds reasonable. Moving towards thread-specific target descriptions/gdbarch would be a positive thing given the SVE precedent. The process-wide target description/gdbarch no longer reflects the correct settings for each thread on AArch64's with SVE support. > > Simon