From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2080.outbound.protection.outlook.com [40.107.7.80]) by sourceware.org (Postfix) with ESMTPS id A5F803858D20 for ; Fri, 3 Feb 2023 11:31:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5F803858D20 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=87DuqCi+m9BqqdXb0ecU8ylkPAEztOFfBzwLeL2VWSY=; b=qEp+P1JeAOZb5GDTGXSlos1ypwvYI/mEPXRV4qtmrjr7Le1lavT8LG2yUl8tE3hDzQz6t3zPvuj7APd8MZaUIxm/H2pd6cftRb7gIDJejTtZm+N4E46dHqbHRcAzuWOsrPA7oY6yfEkMOSIZ4HAq8keSwXD+jaMO9fNd3yKzxus= Received: from AM6P192CA0082.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::23) by GV2PR08MB9879.eurprd08.prod.outlook.com (2603:10a6:150:de::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Fri, 3 Feb 2023 11:31:48 +0000 Received: from AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::b) by AM6P192CA0082.outlook.office365.com (2603:10a6:209:8d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.29 via Frontend Transport; Fri, 3 Feb 2023 11:31:48 +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 AM7EUR03FT043.mail.protection.outlook.com (100.127.140.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31 via Frontend Transport; Fri, 3 Feb 2023 11:31:47 +0000 Received: ("Tessian outbound 3ad958cd7492:v132"); Fri, 03 Feb 2023 11:31:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c41d008f8012ef86 X-CR-MTA-TID: 64aa7808 Received: from a2ba2d4b91dc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9C4EC58E-1AFF-41BF-BE63-21853035971E.1; Fri, 03 Feb 2023 11:31:40 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a2ba2d4b91dc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 03 Feb 2023 11:31:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UHhXxi7AbCLGlmAUMtdegge+XsEh4t5WAzTd9zVFBu+qZ6myCWPP9/Ibse05HKJqdGk5AFp/HnJ5uFOk6HTLB2jr5Ts9zeWRANiKjihQ/EKIdWajAVFEjvNWBedIkAfBsHF4mXgwigPxsc/lNF6SmGIQCvZ0hdvgV+/MmTm+oeoLYz26gLKtLz9Ft7Bxm3MLbSUUbSegQyQ1WhxJjv/joyGr40xBrxSOrVz7GeUWvaGVMh2j1L/vZfZF2cLnLdiSkS+PVa80aMHhICMJJdloP3v5LFUY29umq/nLPaU2wjGj2w4Tnh7JO5+JgCl2e80l7f0Q4Ysn99tQKh2BlT34uw== 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=87DuqCi+m9BqqdXb0ecU8ylkPAEztOFfBzwLeL2VWSY=; b=auXwwGiQcmP9u5KVkgoa2j+7LkieGbbZfzZYnWuwGOnTj9fxOhzqF9KvjGNntyvoQjZOQztn2OIzPxumbAhDFFhe1U7nnFSsST+/6OLy/Raidfw6Oq0Awtewf0vfvO09Uo7XfiReby9JpBgF5dQam+GdgXPyYwol9e9GiU8kMqndkWkc8TLRfSD6wjikqrdp+7WLXZkoLdLwfuw1JDOEV5Y6U0pXfM54nScnuJSKt2ED99BLwrFBLqqvVgrNS7q3fxSXv5ChBHgMq0xesH7PW3gQoWOWh2+XwCdpmI8PHi2K2MA2354X1L3aPC/SPCXz53iajR+tf7MGWrpTioHlzw== 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=87DuqCi+m9BqqdXb0ecU8ylkPAEztOFfBzwLeL2VWSY=; b=qEp+P1JeAOZb5GDTGXSlos1ypwvYI/mEPXRV4qtmrjr7Le1lavT8LG2yUl8tE3hDzQz6t3zPvuj7APd8MZaUIxm/H2pd6cftRb7gIDJejTtZm+N4E46dHqbHRcAzuWOsrPA7oY6yfEkMOSIZ4HAq8keSwXD+jaMO9fNd3yKzxus= 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 DB9PR08MB6587.eurprd08.prod.outlook.com (2603:10a6:10:251::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31; Fri, 3 Feb 2023 11:31:39 +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.6064.028; Fri, 3 Feb 2023 11:31:39 +0000 Message-ID: Date: Fri, 3 Feb 2023 11:31:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 7/8] gdb/aarch64: Detect vector length changes when debugging remotely 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-8-thiago.bauermann@linaro.org> <878rhhtnis.fsf@redhat.com> <70edf893-10e4-f55d-dd2d-c57747e01def@simark.ca> From: Luis Machado In-Reply-To: <70edf893-10e4-f55d-dd2d-c57747e01def@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0072.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:153::23) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB9PR08MB6587:EE_|AM7EUR03FT043:EE_|GV2PR08MB9879:EE_ X-MS-Office365-Filtering-Correlation-Id: 66fd9a24-cc73-4a45-6ce5-08db05da3c76 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: fCb2a214/ghcBAL6K7gBitGzYDyqsrDMgrPgdVqM8MFmZMO7qScLS0tqEcyg/fGTiO+gQlJZYABOP3XqEuf4vEm3BRrK3xQZAgCfmbwLevejC+v5fkaehUylZ0ghWkANZvKbwsZYZ4jPuh1zI4zEWcf+zS+WNSqiJFBXB1ctDGnkGPtaAjhuz2ygKokDSy9Gyq/iqgO3r0wIzG4ljWsEHNwZYlmECZ82qns5VP9E8LGcp7AMi8qmPTBi2nnSfnXjfkBhZu9eiwKjVHKsLXEWsmApVgF6Iz+70vqrH7roR+zcn6xaG0chlwl0VyNw7leYIFqshgedj7XszuwNz+bRCRRHk75KOHYgnjpvjYVLBIetNNLdYSvmzTbVlDvhtUc3FxU5FrCgfaCHMvA3vQsxZpJDIC0dU5f+ic7nthfO6KAvoMMPY3zSUKOTm4wMEcPmpjYrpg4OssXVA7pAuOcH41HRNevFO1d8H+VA0glJKjwEqssLQ6pkpw1ng2lDv2lRtibtRsz5NFcKMWkjse2s6RdeFl4+OJOPZ3gtj8lo0Y4pAcF7sWP76QCcJtinDqMTGC9vbTNAR2hhyP/LgiWLs+tgEu1PTfPPvSNkRlhg5ePDIYJqbu74IShrkFva18ZCtd1HUAPHG3BZV9F5juzNpHCjZvcW2joeRq/D9Vy3mEQdZ1Kc8ozmcWaiWngfx4KKIigVz7nMQH1bb7nzgTVK+DJizAuHEy+UymPpAGOzQdY= 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)(136003)(39860400002)(396003)(376002)(366004)(346002)(451199018)(36756003)(44832011)(8936002)(5660300002)(66946007)(4326008)(8676002)(66556008)(83380400001)(66476007)(316002)(110136005)(41300700001)(26005)(186003)(31696002)(6512007)(86362001)(31686004)(53546011)(6506007)(2906002)(478600001)(6486002)(2616005)(38100700002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6587 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: AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 123edbf6-f1cb-4cf7-0f8d-08db05da36e7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Li43N46M45g9juqt00ox5xeKmpnpjM8HFnaZp981BK6tvnN0JvCVISfJXiD37Ib/BKloYF7NVbmFDyRhI5OaWLuWS0pAEAOBxWZagcqG/GTOjpeFSfRtgJ4ihHVd8abywR7Wps4mbEbJ11I07Lnl8/t5Ot8TrqgVJmNZ5FaKaSGYE67W5u0GCkfPIIuTSeivpqZEhYlYb8DyTFrV/pPZ6k2zavRmETjfeLQSRrm+Z/xYopqlUO5OJcom3q7poAjk78GzjvFCbuYbzlTXtswJAcgm1hgPrykUSWW2KVYRrO1gPavRP3kx0LbJIechHiYjDgIt/ACPoSaeb9k7O8w4nLjwPI7n/Obr06J2xUNlgHLnbwMZM1zBB585+meyFCUxTJjAZZcccbfD4Aai+jGwEUaDRU5Q54XFvf6pgepTHVJ7YTppUM4BToK1QaCdTEYQzlBakdHCwpwT+J8zBpcAyoBcrVOpHuTBPssx6wKR21hihWiplcw8lixS+b6zXjtU3DW/mJmf4Gs3Ds8M6mH9u4WoIzpAjjvHnmjDNPzgxlX8pPBRPFBZUGNMnSs2IotZ0sVBKpFpXxPzdflW/IjYWY9PsCdqdDcp2LReUnVy1xGptfKu48vAgT1iZyNnSeNHqWINUXbXNS5Xwyp/UMYlhd0U+XpBzTbu8CezKPss1SMUC4YoDITxNn762sp3ywfPz1L1Ip34TeO3q5Hh2tyqOZ33dC4cVkLyEVa+xhCVolQ= 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)(136003)(346002)(376002)(39860400002)(396003)(451199018)(40470700004)(36840700001)(46966006)(70586007)(36860700001)(40460700003)(8676002)(6506007)(6486002)(478600001)(26005)(110136005)(53546011)(6512007)(36756003)(316002)(186003)(82310400005)(5660300002)(86362001)(2906002)(44832011)(70206006)(41300700001)(31696002)(8936002)(107886003)(4326008)(40480700001)(336012)(2616005)(83380400001)(47076005)(356005)(81166007)(31686004)(82740400003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 11:31:47.7835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66fd9a24-cc73-4a45-6ce5-08db05da3c76 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: AM7EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9879 X-Spam-Status: No, score=-6.1 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=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 2/1/23 20:20, Simon Marchi via Gdb-patches wrote: >> I guess the point I'm driving towards is that maybe instead of a new >> gdbarch method we should add something like gdbarch_from_tdesc into >> arch-utils.c (like we have gdbarch_from_bfd and gdbarch_find_by_info), >> which just does a lookup from tdesc. > > One thing I would like to add: I presume that this process > (gdbarch_find_by_info) is somewhat expensive. Is there an easy way to > short-circuit things earlier? Maybe if we detect that a thread has the We already do it in gdb/aarch64-tdep.c:aarch64_gdbarch_init by checking if we have something that can be reused: /* If there is already a candidate, use it. */ for (gdbarch_list *best_arch = gdbarch_list_lookup_by_info (arches, &info); best_arch != nullptr; best_arch = gdbarch_list_lookup_by_info (best_arch->next, &info)) { aarch64_gdbarch_tdep *tdep = gdbarch_tdep (best_arch->gdbarch); if (tdep && tdep->vq == vq) return best_arch->gdbarch; } It is indeed an expensive process. > same target desc id as before, we can avoid recomputing the gdbarch? > Or, we can cache the gdbarch in the remote_target. The > remote_target::m_tdescs would hold both the target desc and > corresponding gdbarch as values, instead of just the target desc. > Actually, maybe the remote target wouldn't need to hold the target_desc > at all, once it has the gdbarch. Other than maybe for lifetime reasons, > which are discussed with the previous patch. > > Simon >