diff options
author | Tom Tromey <tromey@adacore.com> | 2023-09-05 12:29:23 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-19 13:28:42 -0600 |
commit | 76fc0f62138e0fa1ec1feeefed7e603d52e83af7 (patch) | |
tree | b423516f220f355dc08b7a7c6a802addae61efc5 /gdb/valarith.c | |
parent | 26733fc7477ac675df9215b46bf3f3af1dd80186 (diff) | |
download | binutils-76fc0f62138e0fa1ec1feeefed7e603d52e83af7.zip binutils-76fc0f62138e0fa1ec1feeefed7e603d52e83af7.tar.gz binutils-76fc0f62138e0fa1ec1feeefed7e603d52e83af7.tar.bz2 |
Give a language to a type
This changes main_type to hold a language, and updates the debug
readers to set this field. This is done by adding the language to the
type-allocator object.
Note that the non-DWARF readers are changed on a "best effort" basis.
This patch also reimplements type::is_array_like to use the type's
language, and it adds a new type::is_string_like as well. This in
turn lets us change the Python implementation of these methods to
simply defer to the type.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r-- | gdb/valarith.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c index ef376f0..f3acf98 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -262,10 +262,8 @@ value_to_array (struct value *val) if (type->is_array_like ()) { - if (HAVE_GNAT_AUX_INFO (type)) - return ada_coerce_to_simple_array (val); - if (HAVE_RUST_SPECIFIC (type)) - return rust_slice_to_array (val); + const language_defn *defn = language_def (type->language ()); + return defn->to_array (val); } return nullptr; } |