From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SfsDCnGj2mP0XCcAWB0awg (envelope-from ) for ; Wed, 01 Feb 2023 12:37:53 -0500 Received: by simark.ca (Postfix, from userid 112) id 1E14C1E128; Wed, 1 Feb 2023 12:37:53 -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=HnZwpBnZ; 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=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 B7F801E0D3 for ; Wed, 1 Feb 2023 12:37:52 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 206083858D37 for ; Wed, 1 Feb 2023 17:37:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 206083858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675273072; bh=GSZbNAwA6owoDyc+qZdAUUeY+oRIWun/6XE3Yo27cvQ=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=HnZwpBnZxjXElZc1IomRpL+xUNrc3CFTzSq1inLx5kPimAHaCJe8YUUVrIce1RbZS 9t0GgCRJmLcR1LJ+ptNqu3JyLW1YqSwBjQhHhOCMNws+rEub3q4dxtQWxUKp37kRi0 V0PxbxEgb3L59G0KRbCgKa2RHkTkpyQL6nxw/GPk= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 1D5583858D33 for ; Wed, 1 Feb 2023 17:37:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D5583858D33 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8F7AB1E0D3; Wed, 1 Feb 2023 12:37:31 -0500 (EST) Message-ID: Date: Wed, 1 Feb 2023 12:37:31 -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 5/8] gdbserver: Transmit target description ID in thread list and stop reply To: Andrew Burgess , Thiago Jung Bauermann via Gdb-patches Cc: Thiago Jung Bauermann , Simon Marchi References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-6-thiago.bauermann@linaro.org> <87lelhtwqv.fsf@redhat.com> Content-Language: en-US In-Reply-To: <87lelhtwqv.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2/1/23 07:07, Andrew Burgess via Gdb-patches wrote: > Thiago Jung Bauermann via Gdb-patches > writes: > >> Now that an inferior thread can have a different target description than >> its process, there needs to be a way to communicate this target >> description to GDB. So add the concept of a target description ID to the >> remote protocol, which is used to reference them and allows them to be >> transferred only once over the wire. >> >> The ID is an unsigned integer, and is sent in the 'T AA n1:r1;n2:r2;...' >> stop reply packet as a new 'n:r' pair, where n is "tdesc" and "r" is an >> unsigned integer containing the ID. >> >> It is also sent in the threads list XML in the response of a >> qXfer:threads:read request. The ID is sent as a new "tdesc" attribute of >> the node. >> >> To request the target description XML of a given ID, GDB sends the >> qXfer:features:read request with "target-id-%u.xml" as the annex, where %u >> is the target description ID. > > Luis already commented that in some locations the ID is hex, while in > others it is not explicitly stated if the value is hex or decimal. I'd > like to second that feedback, and suggest that we pick one, and use that > consistently throughout. > > My thinking is that it will be easier to understand remote packet traces > if target descriptions are requested using an ID in the safe format as > was sent to GDB, and if IDs in different packets match up. > > Thus, I would suggest we switch to using 'target-id-%x.xml' here, and > send the ID as hex in the threads reply packet. Not that I disagree with you, but I just wanted to note that this decimal / hexadecimal mismatch already exists for the core field. It's hex in stop replies, decimal in XML. The thread id, however, is always hex (the special thread-id syntax). Regardless how this new field is formatted, it would be nice to be explicit about the core field too. Simon