aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc/python.texi
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2021-11-30 14:35:44 +0000
committerAndrew Burgess <aburgess@redhat.com>2022-03-07 19:42:08 +0000
commit551b380fbdad4082bc8520b1b61de883e8e4bf49 (patch)
tree4eb1dabf6d52207193b92660ec85e4edebdad32e /gdb/doc/python.texi
parentee6a3d9e9496d469986a192aa374a43dffa83f96 (diff)
downloadgdb-551b380fbdad4082bc8520b1b61de883e8e4bf49.zip
gdb-551b380fbdad4082bc8520b1b61de883e8e4bf49.tar.gz
gdb-551b380fbdad4082bc8520b1b61de883e8e4bf49.tar.bz2
gdb/python: add Type.is_signed property
Add a new read-only property, Type.is_signed, which is True for signed types, and False otherwise. This property should only be read on types for which Type.is_scalar is true, attempting to read this property for non-scalar types will raise a ValueError. I chose 'is_signed' rather than 'is_unsigned' in order to match the existing Architecture.integer_type method, which takes a 'signed' parameter. As far as I could find, that was the only existing signed/unsigned selector in the Python API, so it seemed reasonable to stay consistent.
Diffstat (limited to 'gdb/doc/python.texi')
-rw-r--r--gdb/doc/python.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 2a7a4e8..b6acda4 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -1269,6 +1269,16 @@ this property is @code{False}. Examples of non-scalar types include
structures, unions, and classes.
@end defvar
+@defvar Type.is_signed
+For scalar types (those for which @code{Type.is_scalar} is
+@code{True}), this property is @code{True} if the type is signed,
+otherwise this property is @code{False}.
+
+Attempting to read this property for a non-scalar type (a type for
+which @code{Type.is_scalar} is @code{False}), will raise a
+@code{ValueError}.
+@end defvar
+
The following methods are provided:
@defun Type.fields ()