From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sFouISG65WPmty4AWB0awg (envelope-from ) for ; Thu, 09 Feb 2023 22:29:37 -0500 Received: by simark.ca (Postfix, from userid 112) id 8566B1E221; Thu, 9 Feb 2023 22:29:37 -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=V2KawMeC; 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=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 325261E110 for ; Thu, 9 Feb 2023 22:29:37 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2DF8E38582BC for ; Fri, 10 Feb 2023 03:29:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DF8E38582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675999776; bh=Fo79n5V+O7KvDJsEzfbsreT+z72arIz3mgkOtwPV5xk=; 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=V2KawMeCJjAJllhPuhd5+gQ6kin6lyCAGssZTBuDEcU9EB9WR6GDNYctvqWsR4hu9 kih3/B7yYrrVzf3HWOrWTEqlEiT8YARbaVqLhA+vK0Kf0fcsHUzBg/QvnmlX2XzpOx 8ICSyPbttuj1KYw2A8QQvFRJtfI0XJbS45kjrh0o= 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 Received: by mail-ot1-x32c.google.com with SMTP id 14-20020a9d010e000000b0068bdddfa263so1208719otu.2 for ; Thu, 09 Feb 2023 19:29:14 -0800 (PST) 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 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-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: >> 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