From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 55AEF3858D37 for ; Wed, 1 Feb 2023 20:20:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55AEF3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C756C1E112; Wed, 1 Feb 2023 15:20:00 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1675282801; bh=s38e1DXseaiPUM+cpsZKcw3ksMjErvi+dVxvgTy5ffM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PsLJZX55aVYczf6gS4HaL9dQBjxSQMV982SaEnE78+x8GUswtkm0WrGElVpkbcFxc OiP6zIwsHbZTMTXqYLfaFbTinF8lhxOOTYP3YwVPEwg4BE4ckvEfNIYRZ3z6IRpCm5 vW4ng6SktHkjV7C7cEAtDclATMS4CCi0Q/DSB+Ow= Message-ID: <70edf893-10e4-f55d-dd2d-c57747e01def@simark.ca> Date: Wed, 1 Feb 2023 15:20:00 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 7/8] gdb/aarch64: Detect vector length changes when debugging remotely Content-Language: en-US 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> From: Simon Marchi In-Reply-To: <878rhhtnis.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP 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: > 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. 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