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/mdebugread.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/mdebugread.c')
-rw-r--r-- | gdb/mdebugread.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 9cb30ce..b515486 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1382,7 +1382,7 @@ basic_type (int bt, struct objfile *objfile) if (map_bt[bt]) return map_bt[bt]; - type_allocator alloc (objfile); + type_allocator alloc (objfile, get_current_subfile ()->language); switch (bt) { @@ -1571,7 +1571,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, } } - type_allocator alloc (mdebugread_objfile); + type_allocator alloc (mdebugread_objfile, get_current_subfile ()->language); /* Move on to next aux. */ ax++; @@ -4291,7 +4291,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, rf = rn->rfd; } - type_allocator alloc (mdebugread_objfile); + type_allocator alloc (mdebugread_objfile, get_current_subfile ()->language); /* mips cc uses a rf of -1 for opaque struct definitions. Set TYPE_STUB for these types so that check_typedef will @@ -4754,7 +4754,8 @@ new_type (char *name) { struct type *t; - t = type_allocator (mdebugread_objfile).new_type (); + t = type_allocator (mdebugread_objfile, + get_current_subfile ()->language).new_type (); t->set_name (name); INIT_CPLUS_SPECIFIC (t); return t; |