From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 67C953858C50 for ; Fri, 10 Feb 2023 03:29:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 67C953858C50 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-ot1-x32c.google.com with SMTP id 14-20020a9d010e000000b0068bdddfa263so1208719otu.2 for ; Thu, 09 Feb 2023 19:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding: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=Fo79n5V+O7KvDJsEzfbsreT+z72arIz3mgkOtwPV5xk=; b=HG4nAdaD4xZ5CICdDVvdCgj0puvwCJQtct2W12l1eN1dGrC1/zx6bDaB5ReCRGSE61 2745of+5kzbj+Fwo4LBAgYH5SdsOsdGL5PLDS89rrjngelC+epG5JmP6tGiuYgQERbxc ZSeILZXCuGhJi6W4H9vQlud9WGDOV0W7V7jnA6pZSBrQFV8zCdHa00wUFNAbJeNBkjc0 oe8lyJEDWuP/DlJfvnXuCAIedaxgzSkcgr2bpX9jvFm2VBvKshn5MO+cE339ux10x9iJ pbYfDsJ1cuHeGLhGhhhqZx1Sr9ZGNn7+oSdNhXutgA0Ih9ca6ewLsFN26tnRDAOhtncf T+/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=Fo79n5V+O7KvDJsEzfbsreT+z72arIz3mgkOtwPV5xk=; b=wHTy9AEWa8dHdByJApPhspfa+fxStXRnNPcee0i2vFWFtuO9NeF29p+EyN8gHHZwNx RKNK3guUqN3omu9noWgCH2xijAdrHHRrK8Hf57N07Yaro3OMBwtJn1oUmFYNCNJMXOn2 UytKRf0dBFrANhtc904QJZEmeH32pufSKoScSM88bUPnSGKHDGB5JJCLC+zZXQlh7XPk w2yEGd1DArz8lkWzzPIm0n2oYMDh5Hb5tRQxAPsI9jy6XyqM+gWume1OYF1BahWaZ58o iDqIOi7Qz1z1SIXiWYLf/3094/cmi/w9eVOlFqZGLxozdD2bo+i6MCiDc7udNUsHXm9P LOUA== X-Gm-Message-State: AO0yUKVIXgwB0MDMDL0R0gouZ95E1guO+B+yWEsRl788x0xmbKYjxPTu fl7ROQFx9Qkk+t5XR5ugb0eomV0N1/C/v/t1abk= X-Google-Smtp-Source: AK7set/xnhENL4X08ecWNtlnIq+NjIMMgkuOjPiXNfpZlqyYxR0xvZRjKbSvdNh8+F9AgolquhTNPA== X-Received: by 2002:a9d:6e8c:0:b0:68d:40fd:698a with SMTP id a12-20020a9d6e8c000000b0068d40fd698amr7832470otr.12.1675999753619; Thu, 09 Feb 2023 19:29:13 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:1449:5096:2f6a:7e5a]) by smtp.gmail.com with ESMTPSA id t5-20020a05683014c500b006864c8043e0sm1555838otq.61.2023.02.09.19.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 19:29:13 -0800 (PST) References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-5-thiago.bauermann@linaro.org> <87pmattzjw.fsf@redhat.com> <7970ac03-1123-d5f6-7b17-808832d43be6@simark.ca> <9a85e2fe-078a-e2ee-7e49-53fe0ceef492@arm.com> <87y1pgaib6.fsf@linaro.org> <3f4e3603-59e3-a896-72e4-d692646c4e44@palves.net> <87v8kd9odi.fsf@linaro.org> User-agent: mu4e 1.8.13; emacs 28.2 From: Thiago Jung Bauermann To: Simon Marchi Cc: Pedro Alves , Luis Machado , Andrew Burgess , Thiago Jung Bauermann via Gdb-patches Subject: Re: [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description In-reply-to: Date: Fri, 10 Feb 2023 03:29:10 +0000 Message-ID: <87cz6i2o6x.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.3 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: >> That is, assuming we continue with the thread-specific tdesc approach >> rather than the one which expands tdescs to allow describing one >> register's type in terms of another one. I'll revisit my notes and think >> more about this. > > Can we expand about this idea? I think I like it, but I don't see 100% > how it would work. Sorry, I can't expand much on it. I like it too, and as I mentioned in another email I spent some time investigating how it could be done but I wasn't able to make progress so I decided to do the per-thread tdesc implementation instead. I would be willing to try again but I would need help with high-level design. > I can imagine a vector of registers whose size > depends directly on the value of some other register that comes before, > like: > > > > Here, "some_other_register" would be a scalar register that comes before > "vec", and whose value dictates directly the number of elements of > "vec". But if you wanted to say that the number of elements in "vec" is > the value of some_other_register, times 2? I guess we could write: > > > > .. but then we get in the realm of defining a grammar, building a > parser / evaluator, etc. We could rein complexity in by supporting only the simplest of expressions, e.g. only a very rigid form such as =E2=80=9C =E2=80=9D where is one of the basic arithmetic operations. If that turns out to not be enough then we can increasingly support more complex operations. > The type of the vector elements needs to be dynamic too, how do > we define that? This is the part where I got stuck, especially on how to make GDB's type system allow expressing such a type. > If the number of possibilities is known and static, we could have some > kind of "variant" type, where we list all the possible types, and select > among them at runtime based on the value of a preceding register. Yes, in the case of SVE it's known and static. The maximum vector length is an architectural feature of the processor, and GDB/gdbserver can get it via ptrace in the NT_ARM_SVE regset. And it's always a multiple of 16. It's an interesting idea. Perhaps it's enough, at least for SVE? > If I understand correctly, all of this makes it so the size of the > response to the g packet will be dynamic too? We /could/ set the size of the g packet to always correspond to the largest vector length possible but it would be a big overhead, especially if there are many threads involved. So in practice yes, it will be dynamic if we can help it. --=20 Thiago