aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-08-07 06:35:51 -0600
committerTom Tromey <tromey@adacore.com>2023-09-05 11:03:00 -0600
commit84914f598e5d48b78243b7e523804a28a4baf1eb (patch)
tree6e94a4e9e76cd3e358c051df710dc6a63ebb6922 /gdb/gdbtypes.h
parentcf1eca3cbbfe8b2092d867023df7dac4d00fa4ec (diff)
downloadgdb-84914f598e5d48b78243b7e523804a28a4baf1eb.zip
gdb-84914f598e5d48b78243b7e523804a28a4baf1eb.tar.gz
gdb-84914f598e5d48b78243b7e523804a28a4baf1eb.tar.bz2
Introduce type::is_array_like and value_to_array
This adds the type::is_array_like method and the value_to_array function. The former can be used to see whether a given type is known to be "array-like". This is the currently the case for certain compiler-generated structure types; in particular both the Ada and Rust compilers do this.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r--gdb/gdbtypes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 4668fba..f667b10 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1430,6 +1430,11 @@ struct type
return this->code () == TYPE_CODE_PTR || TYPE_IS_REFERENCE (this);
}
+ /* Return true if this type is "array-like". This includes arrays,
+ but also some forms of structure type that are recognized as
+ representations of arrays by the type's language. */
+ bool is_array_like ();
+
/* * Type that is a pointer to this type.
NULL if no such pointer-to type is known yet.
The debugger may add the address of such a type