From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x232.google.com with SMTP id 20so1843532oix.5 for ; Thu, 02 Feb 2023 13:44:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=HLa10zTYCZLpOJBfJoatK12Gx6JfmueBDnUZ8I+oQVo=; b=I5cQPN1JuojiPj2QgyGqMFcGfuALjO6CPQqDNvVPhf6tgfoHMni+orxjPwZRlxHdEI 4jCqAafquNjfSWp6HAp0IfHBa7gEljqq7tV5+vlqLebs0r26HoJxS0WGk00LqzH6z1eT 49uZgJ3JvNXzFv/1E1WwsB+NDT4NuTjEVvhXMhLtgptpwiV1VA9D/CI+CL5+MwwxXzPr KEuivxLVdhwd8m7K1yjugGQhbpGhcLZcTzD/KwS5nO8Fpa051fRwaKq43yiawebPY4K7 Vs3zpW+XEwweKeqrzPUhvkFxgT62shn5nezM450HdOSQqPOJJjNWjChic5Nat3kMCB0x K8Kw== 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 From: Thiago Jung Bauermann 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-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: 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