From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MM6xIrYu3GP7ZCgAWB0awg (envelope-from ) for ; Thu, 02 Feb 2023 16:44:22 -0500 Received: by simark.ca (Postfix, from userid 112) id 8A5A41E128; Thu, 2 Feb 2023 16:44:22 -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=kltzNdkt; 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=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable 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 0EABD1E110 for ; Thu, 2 Feb 2023 16:44:22 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 637BA385842C for ; Thu, 2 Feb 2023 21:44:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 637BA385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675374261; bh=HLa10zTYCZLpOJBfJoatK12Gx6JfmueBDnUZ8I+oQVo=; h=References:To:Cc:Subject:In-reply-to:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=kltzNdkt5QR5nx7o3eZapHBzf8zQ4Nc/cuGPoqaw5Lob+loFZhen8lyo9kW2vpPzV NfxC/1AK7aIky33bhrNocv2Vq3+OBB7HS5FqgpyxwcCip4Jezk4XG5EO0TOyUNjPVw cXeBkT+E4eEQPINxr+tTXmNg+h/Sw1DpwlqjhDLs= Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 6B3DE3858C52 for ; Thu, 2 Feb 2023 21:44:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B3DE3858C52 Received: by mail-oi1-x232.google.com with SMTP id 20so1843532oix.5 for ; Thu, 02 Feb 2023 13:44:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HLa10zTYCZLpOJBfJoatK12Gx6JfmueBDnUZ8I+oQVo=; b=jy9RBZc38LM54RwyOMXA5kk2UsU91fCsobuogY1OSQoT94gH6oWVczPe0qtshM8MF1 ptEvJmeC1a8AkMyU2/Kulg3q1hEjRevTafq9tAjheJkb8wVyNQSamaw04un476z2JV5Z UhXoku898WXgqd9sKyMqUmxmK/7pfcRyv1AkuLhj2Bpp6vUDfNnS38pdX7e8Ahr08Q5L BRVjqOgEFgtwVEfqXvVW/EcO31kaM9z+Mal2ISxGFp6Cwrxj50yTrs6Fs5zWrYth7KUO G2Gd/Jpifg/lUf/rPuCvnR5Ez3DR6MPpcHtpcnIsGCYcY9wl4FU1cjI59KBmi+D70eaX c9aw== X-Gm-Message-State: AO0yUKUbr73PqZbwKIBNBqmWq5yN12fbgsDkXrFGTiP8JQcuVF6BThJW /nVhiSOY9V98YF/e7voxfaV157LmTmUhSd1L X-Google-Smtp-Source: AK7set+Gl9p2vizlRV6nsN4vGuPVCLbjaA0oz+0djl3N+YHJHr0rdiuZFh8d0U6ZA+fL3Cvx+H+FeA== X-Received: by 2002:a05:6808:628f:b0:35b:ae91:db53 with SMTP id du15-20020a056808628f00b0035bae91db53mr3603293oib.42.1675374240769; Thu, 02 Feb 2023 13:44:00 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:7132:fbe:2b2e:ae3e]) by smtp.gmail.com with ESMTPSA id eu15-20020a056808288f00b00364a415f0bbsm137298oib.39.2023.02.02.13.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 13:44:00 -0800 (PST) References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-6-thiago.bauermann@linaro.org> <87lelhtwqv.fsf@redhat.com> <4ee73f43-ae93-ebf1-41ea-6cf68649fb2b@simark.ca> User-agent: mu4e 1.8.13; emacs 28.2 To: Simon Marchi Cc: Andrew Burgess , Thiago Jung Bauermann via Gdb-patches , Simon Marchi Subject: Re: [PATCH v3 5/8] gdbserver: Transmit target description ID in thread list and stop reply In-reply-to: <4ee73f43-ae93-ebf1-41ea-6cf68649fb2b@simark.ca> Date: Thu, 02 Feb 2023 21:43:58 +0000 Message-ID: <87ilgjagkh.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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: Thiago Jung Bauermann via Gdb-patches Reply-To: Thiago Jung Bauermann Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Simon Marchi writes: > On 2/1/23 07:07, Andrew Burgess via Gdb-patches wrote: >> Additionally, I think it would be worth adding a new feature to the >> qSupported packet, maybe 'per-thread-tdesc'. With this added, GDB would >> be able to tell gdbserver that it supports this feature, and gdbserver >> will be able to confirm that the feature is supported. >> >> I'm not 100% sure what we'd want to do if it turns out GDB doesn't >> support the feature? Is it better to push on with GDB using the wrong >> target description? Or would it be better if gdbserver exits with an >> error suggesting the GDB needs updating? In some ways, _what_ we do >> doesn't really matter to me, but I think having the feature will allow >> us to pick a suitable error handling solution later if needed. >> >> I'd be happy if adding the feature was done as a separate patch in this >> series, but I do think it should be part of this series. > > I forgot to comment on that part. Just to think out loud: I tested the two cases you mentioned below. > - If GDB supports the new feature but GDBserver doesn't, I guess that > debugging works exactly like today? What happens today if a remote > thread changes its SVE vector size, the registers that GDB shows will > simply not reflect the reality, they might have bogus values, but > debugging will otherwise work? Yes, that's exactly what happens. > - If GDB does not support the new feature but GDBserver does, I guess it > is problematic, because GDBserver will assume that GDB will have > adjusted its expectations about the length (and layout) of the g > packet response, since it told GDB about the thread-specific tdesc. > But since GDB doesn't know about thread-specific tdescs, it will try > to interpret the g packet response with the register layout of the > process-wide tdesc, possibly leading to the infamous "Remote 'g' > packet reply is too long", if the received response is longer than > expected. This too. > So, I agree that we need some feature flag for this. Ok, I will add it for the next version of the patches. -- Thiago