public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 2/2] gdb/doc: describe x87 registers
Date: Fri,  8 Sep 2023 11:20:58 -0400	[thread overview]
Message-ID: <20230908152102.32731-2-simon.marchi@efficios.com> (raw)
In-Reply-To: <20230908152102.32731-1-simon.marchi@efficios.com>

While investigating this [1], I initially had no idea what register
"fioff" stood for, making it difficult to map it to something in the
Intel or AMD manuals.  Similarly, I can imaging someone familiar with
x87 to want to print the "x87 last instruction address", and have no
clue that GDB makes it available as register "fioff".  The names of the
x87 state fields don't seem to be standardized, they even change between
sections of the Intel manual (between the FSAVE, FXSAVE and XSAVE area
descriptions).

Add some details to the doc to help one map GDB register names to x87
state fields.

[1] https://inbox.sourceware.org/gdb-patches/20230908022722.430741-1-simon.marchi@efficios.com/T/#u

Change-Id: I0ea1eb648358e62da4aa87eea3515ee8a09f2762
---
 gdb/doc/gdb.texinfo | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 72083fc5b64f..90d928fb295d 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -26310,6 +26310,25 @@ At this last step the value of bnd0 can be changed for investigation of bound
 violations caused along the execution of the call.  In order to know how to
 set the bound registers or bound table for the call consult the ABI.
 
+@subsubsection x87 registers
+
+GDB provides access to the x87 state through the following registers:
+
+@itemize
+
+@item @code{$st0} to @code{st7}: @code{ST(0)} to @code{ST(7)} floating-point
+registers
+@item @code{$fctrl}: control word register (@code{FCW})
+@item @code{$fstat}: status word register (@code{FSW})
+@item @code{$ftag}: tag word (@code{FTW})
+@item @code{$fiseg}: last instruction pointer segment
+@item @code{$fioff}: last instruction pointer
+@item @code{$foseg}: last data pointer segment
+@item @code{$fooff}: last data pointer
+@item @code{$fop}: last opcode
+
+@end itemize
+
 @node Alpha
 @subsection Alpha
 
-- 
2.42.0


  reply	other threads:[~2023-09-08 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-08 15:20 [PATCH 1/2] gdb/doc: rename "x86 Architecture-specific Issues" section to "x86" Simon Marchi
2023-09-08 15:20 ` Simon Marchi [this message]
2023-09-08 15:35   ` [PATCH 2/2] gdb/doc: describe x87 registers Eli Zaretskii
2023-09-08 17:03   ` Pedro Alves
2023-09-08 17:16     ` Simon Marchi
2023-09-08 15:37 ` [PATCH 1/2] gdb/doc: rename "x86 Architecture-specific Issues" section to "x86" Eli Zaretskii
2023-09-08 17:17   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230908152102.32731-2-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).