From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SnolFmxb3WPjISkAWB0awg (envelope-from ) for ; Fri, 03 Feb 2023 14:07:24 -0500 Received: by simark.ca (Postfix, from userid 112) id 4CACF1E128; Fri, 3 Feb 2023 14:07:24 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=XFrE1FgR; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 644F71E110 for ; Fri, 3 Feb 2023 14:07:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5ACFE385840D for ; Fri, 3 Feb 2023 19:07:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5ACFE385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675451242; bh=xe8S/J9QvIQumtYTq/3CV2wQOzfj/CNQRHLPQWSBN4c=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=XFrE1FgRdMZv4IR0bs+BkQDL4BYBg4YvIEIMRdM6p0fa1NOVACZonwBKFjJodeaFd 9bEU/C26USvqiJ6LYSN62cWllBM5QMgYExy85hGLWSuEGGm/df8SCBGrNq8IQApuSs q0Hb7YjO3gsHtjRut9f6jySG/HXrtBod0xBMVop8= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4889C385843A for ; Fri, 3 Feb 2023 19:07:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4889C385843A Received: from [172.16.0.192] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B19601E110; Fri, 3 Feb 2023 14:07:01 -0500 (EST) Message-ID: <8bf3989d-64b5-4de8-7ae4-e69280ec6313@simark.ca> Date: Fri, 3 Feb 2023 14:07:01 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v3 7/8] gdb/aarch64: Detect vector length changes when debugging remotely Content-Language: fr To: 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> <87pmaqr9fm.fsf@redhat.com> In-Reply-To: <87pmaqr9fm.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2/3/23 11:38, Andrew Burgess wrote: > Simon Marchi writes: > >>> 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 >> same target desc id as before, we can avoid recomputing the gdbarch? >> Or, we can cache the gdbarch in the remote_target. > > Or could we cache the gdbarch in the tdesc itself? As you pointed out > for the previous patch, passing the same XML string will result in the > same tdesc object. So if we had gdbarch_from_tdesc, this can do the > expensive gdbarch lookup, then store the gdbarch in the tdesc object. > > Next time we call gdbarch_from_tdesc we can just check for a cached > gdbarch within the tdesc and return that... Yeah, maybe. The gdbarch points to the tdesc already, so this would add a link in the other direction. Simon