From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Minor doc fix for Python Type.fields
Date: Wed, 5 Nov 2025 11:10:59 -0700 [thread overview]
Message-ID: <20251105181059.3444537-1-tromey@adacore.com> (raw)
This changes the Python Type.fields documentation in a few minor ways:
* Documents that a new sequence is always returned I've intentionally
not mentioned that it is currently a list, in case we want to change
to a tuple someday.
* Move the C++ base class note to the bullet about structure types,
where it makes more sense.
* Added a blank line before the table to make the info page easier to
read.
---
gdb/doc/python.texi | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 13ffde253d3..44a94aa34c9 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -1501,19 +1501,20 @@ The following methods are provided:
@defun Type.fields ()
-Return the fields of this type. The behavior depends on the type code:
+Return a new sequence of the fields of this type. The behavior
+depends on the type code:
@itemize @bullet
@item
-For structure and union types, this method returns the fields.
+For structure and union types, this method returns the fields. The
+base types of C@t{++} classes are also represented as fields.
@item
Enum types have one field per enum constant.
@item
-Function and method types have one field per parameter. The base types of
-C@t{++} classes are also represented as fields.
+Function and method types have one field per parameter.
@item
Array types have one field representing the array's range.
@@ -1525,6 +1526,7 @@ is raised.
@end itemize
Each field is a @code{gdb.Field} object, with some pre-defined attributes:
+
@table @code
@item bitpos
This attribute is not available for @code{enum} or @code{static}
base-commit: ce106639c2019494833b5a8388d205ba96e7b217
--
2.51.0
next reply other threads:[~2025-11-05 18:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 18:10 Tom Tromey [this message]
2025-11-05 18:29 ` Paul Koning
2025-11-05 19:05 ` Tom Tromey
2025-11-05 19:21 ` Paul Koning
2025-11-05 19:27 ` Tom Tromey
2025-11-05 19:30 ` Paul Koning
2025-11-05 19:30 ` Eli Zaretskii
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=20251105181059.3444537-1-tromey@adacore.com \
--to=tromey@adacore.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