aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-05 12:29:23 -0600
committerTom Tromey <tromey@adacore.com>2023-09-19 13:28:42 -0600
commit76fc0f62138e0fa1ec1feeefed7e603d52e83af7 (patch)
treeb423516f220f355dc08b7a7c6a802addae61efc5 /gdb/coffread.c
parent26733fc7477ac675df9215b46bf3f3af1dd80186 (diff)
downloadgdb-76fc0f62138e0fa1ec1feeefed7e603d52e83af7.zip
gdb-76fc0f62138e0fa1ec1feeefed7e603d52e83af7.tar.gz
gdb-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/coffread.c')
-rw-r--r--gdb/coffread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index e432693..fe905e7 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -354,7 +354,7 @@ coff_alloc_type (int index)
We will fill it in later if we find out how. */
if (type == NULL)
{
- type = type_allocator (coffread_objfile).new_type ();
+ type = type_allocator (coffread_objfile, language_c).new_type ();
*type_addr = type;
}
return type;
@@ -1763,7 +1763,7 @@ decode_type (struct coff_symbol *cs, unsigned int c_type,
base_type = decode_type (cs, new_c_type, aux, objfile);
index_type = builtin_type (objfile)->builtin_int;
- type_allocator alloc (objfile);
+ type_allocator alloc (objfile, language_c);
range_type
= create_static_range_type (alloc, index_type, 0, n - 1);
type = create_array_type (alloc, base_type, range_type);