From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id 9E4823858D33; Thu, 16 Feb 2023 17:12:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E4823858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676567564; bh=nj5FHkwUXfddwBdmBXP5YSfbHKLv6ABDaW8X+YXIovA=; h=From:To:Subject:Date:From; b=NSsfo8KJ43I8c/Chf5ONdOhEYnm3DaVKIc0ml89IPZuUgSK6lQObMqjG07KukwBMU GKBtVPsBD+ivuMR9fmT5lwp3CAZez2pXa9JoyMkkqrbuYcepS39P/Go+XBOfhg52cr kz3kZ2hUcqlklzcI7ccyVopCLhqy0Us4+rz1dyTo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Update the 'g' packet documentation X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 9fe129a4105bb59398f73ce96938a94f19265b79 X-Git-Newrev: 16b84b6599dba01abc00954d0bc80ddf0c2373e3 Message-Id: <20230216171244.9E4823858D33@sourceware.org> Date: Thu, 16 Feb 2023 17:12:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D16b84b6599db= a01abc00954d0bc80ddf0c2373e3 commit 16b84b6599dba01abc00954d0bc80ddf0c2373e3 Author: Tom Tromey Date: Wed Jan 11 11:37:25 2023 -0700 Update the 'g' packet documentation =20 The 'g' packet documentation references a macro that no longer exists, and it also claims that the 'x' response for an unavailable register is limited to trace frames. This patch updates the documentation to reflect what I think is currently correct. =20 Co-Authored-By: Pedro Alves Approved-By: Eli Zaretskii Change-Id: I863baa3b9293059cfd4aa3d534602cbcb693ba87 Diff: --- gdb/doc/gdb.texinfo | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 8c2cd23df18..3642828eb0e 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -41770,17 +41770,27 @@ Reply: Each byte of register data is described by two hex digits. The bytes with the register are transmitted in target byte order. The size of each register and their position within the @samp{g} packet are -determined by the @value{GDBN} internal gdbarch functions -@code{DEPRECATED_REGISTER_RAW_SIZE} and @code{gdbarch_register_name}. - -When reading registers from a trace frame (@pxref{Analyze Collected -Data,,Using the Collected Data}), the stub may also return a string of -literal @samp{x}'s in place of the register data digits, to indicate -that the corresponding register has not been collected, thus its value -is unavailable. For example, for an architecture with 4 registers of +determined by the target description (@pxref{Target Descriptions}); in +the absence of a target description, this is done using code internal +to @value{GDBN}; typically this is some customary register layout for +the architecture in question. + +When reading registers, the stub may also return a string of literal +@samp{x}'s in place of the register data digits, to indicate that the +corresponding register's value is unavailable. For example, when +reading registers from a trace frame (@pxref{Analyze Collected +Data,,Using the Collected Data}), this means that the register has not +been collected in the trace frame. When reading registers from a live +program, this indicates that the stub has no means to access the +register contents, even though the corresponding register is known to +exist. Note that if a register truly does not exist on the target, +then it is better to not include it in the target description in the +first place. + +For example, for an architecture with 4 registers of 4 bytes each, the following reply indicates to @value{GDBN} that -registers 0 and 2 have not been collected, while registers 1 and 3 -have been collected, and both have zero value: +registers 0 and 2 are unavailable, while registers 1 and 3 +are available, and both have zero value: =20 @smallexample -> @code{g}