42#include "floatformat.h"
50#define INVALID_CONVERSION 100
82 &floatformat_ieee_half_big,
83 &floatformat_ieee_half_little
86 &floatformat_ieee_single_big,
87 &floatformat_ieee_single_little
90 &floatformat_ieee_double_big,
91 &floatformat_ieee_double_little
94 &floatformat_ieee_quad_big,
95 &floatformat_ieee_quad_little
98 &floatformat_ieee_double_big,
99 &floatformat_ieee_double_littlebyte_bigword
102 &floatformat_i387_ext,
103 &floatformat_i387_ext
106 &floatformat_m68881_ext,
107 &floatformat_m68881_ext
110 &floatformat_arm_ext_big,
111 &floatformat_arm_ext_littlebyte_bigword
114 &floatformat_ia64_spill_big,
115 &floatformat_ia64_spill_little
126 &floatformat_ibm_long_double_big,
127 &floatformat_ibm_long_double_little
130 &floatformat_bfloat16_big,
131 &floatformat_bfloat16_little
153 gdb_printf (file, _(
"Resolution of opaque struct/class/union types "
154 "(if set before loading symbols) is %s.\n"),
164 gdb_printf (file, _(
"Debugging of C++ overloading is %s.\n"),
188 case TYPE_CODE_STRUCT:
189 case TYPE_CODE_UNION:
190 case TYPE_CODE_NAMESPACE:
199 case TYPE_CODE_FIXED_POINT:
214 ? &
m_data.objfile->objfile_obstack
218 struct type *
type = OBSTACK_ZALLOC (obstack,
struct type);
244 gdb_assert ((
bit % TARGET_CHAR_BIT) == 0);
250 ? &
m_data.objfile->objfile_obstack
264 return m_data.type->arch ();
266 return m_data.objfile->arch ();
286 gdb_assert (
arch !=
nullptr);
381 else if (*typeptr == 0)
388 if (typeptr == 0 || *typeptr == 0)
417 while (
chain != ntype)
446 struct type **reftype;
449 gdb_assert (refcode == TYPE_CODE_REF || refcode == TYPE_CODE_RVALUE_REF);
459 else if (*typeptr == 0)
466 if (typeptr == 0 || *typeptr == 0)
497 while (
chain != ntype)
541 if (typeptr == 0 || *typeptr == 0)
579 struct type **param_types)
586 if (param_types[nparams - 1] == NULL)
596 gdb_assert (nparams == 0);
604 for (i = 0; i < nparams; ++i)
615 const char *space_identifier)
617 type_instance_flags type_flags;
620 if (!strcmp (space_identifier,
"code"))
622 else if (!strcmp (space_identifier,
"data"))
630 error (_(
"Unknown address space specifier: \"%s\""), space_identifier);
638 type_instance_flags space_flag)
658 struct type *storage)
669 while (ntype !=
type);
716 type_instance_flags space_flag)
742 struct type **typeptr)
756 if (typeptr && *typeptr != NULL)
774 typeptr ? *typeptr : NULL);
856 while (ntype !=
chain);
914 gdb_assert_not_reached (
"unhandled dynamic_prop kind");
922#define FIELD_EQ(FIELD) (l.FIELD == r.FIELD)
926 &&
FIELD_EQ (flag_upper_bound_is_count)
947 result_type->
set_code (TYPE_CODE_RANGE);
956 bounds->
low = *low_bound;
957 bounds->
high = *high_bound;
963 if (index_type->
code () == TYPE_CODE_FIXED_POINT)
1009 gdb_assert (stride !=
nullptr);
1020 LONGEST low_bound, LONGEST high_bound)
1048gdb::optional<LONGEST>
1054 case TYPE_CODE_RANGE:
1064 gdb::optional<LONGEST> low_pos
1067 if (low_pos.has_value ())
1074 case TYPE_CODE_ENUM:
1094 case TYPE_CODE_BOOL:
1102 return -(1 << (
type->
length () * TARGET_CHAR_BIT - 1));
1105 case TYPE_CODE_CHAR:
1115gdb::optional<LONGEST>
1121 case TYPE_CODE_RANGE:
1131 gdb::optional<LONGEST> high_pos
1134 if (high_pos.has_value ())
1141 case TYPE_CODE_ENUM:
1161 case TYPE_CODE_BOOL:
1170 LONGEST low = -(1 << (
type->
length () * TARGET_CHAR_BIT - 1));
1175 case TYPE_CODE_CHAR:
1180 LONGEST high = 1 << (
type->
length () * TARGET_CHAR_BIT - 1);
1181 return (high - 1) | high;
1195 if (!low.has_value ())
1199 if (!high.has_value ())
1246gdb::optional<LONGEST>
1249 if (
type->
code () == TYPE_CODE_RANGE)
1252 if (
type->
code () == TYPE_CODE_ENUM)
1276 gdb_assert (
type->
code () == TYPE_CODE_ARRAY);
1285 LONGEST low_bound, high_bound;
1287 struct type *element_type;
1292 low_bound = high_bound = 0;
1298 if (high_bound < low_bound)
1300 else if (stride != 0)
1308 LONGEST element_count = std::abs (high_bound - low_bound + 1);
1309 type->
set_length (((std::abs (stride) * element_count) + 7) / 8);
1313 * (high_bound - low_bound + 1));
1320 if (element_type->
code () == TYPE_CODE_ARRAY
1322 && element_type->
length () != 0
1325 && high_bound >= low_bound)
1327 ((high_bound - low_bound + 1)
1340 struct type *element_type,
1341 struct type *range_type,
1345 if (byte_stride_prop !=
nullptr && byte_stride_prop->
is_constant ())
1352 byte_stride_prop = NULL;
1357 result_type->
set_code (TYPE_CODE_ARRAY);
1362 if (byte_stride_prop != NULL)
1379 if (result_type->
length () == 0)
1389 struct type *element_type,
1390 struct type *range_type)
1393 range_type, NULL, 0);
1398 LONGEST low_bound, LONGEST high_bound)
1401 struct type *range_type;
1407 low_bound, high_bound);
1416 struct type *string_char_type,
1417 struct type *range_type)
1422 result_type->
set_code (TYPE_CODE_STRING);
1428 LONGEST low_bound, LONGEST high_bound)
1430 struct type *result_type;
1433 low_bound, high_bound);
1434 result_type->
set_code (TYPE_CODE_STRING);
1443 result_type->
set_code (TYPE_CODE_SET);
1448 LONGEST low_bound, high_bound, bit_length;
1451 low_bound = high_bound = 0;
1453 bit_length = high_bound - low_bound + 1;
1454 result_type->
set_length ((bit_length + TARGET_CHAR_BIT - 1)
1470 struct type *inner_array, *elt_type;
1474 inner_array = array_type;
1479 if (elt_type->
code () == TYPE_CODE_INT)
1481 type_instance_flags
flags
1493 struct type *array_type;
1511 case TYPE_CODE_METHODPTR:
1512 case TYPE_CODE_MEMBERPTR:
1517 case TYPE_CODE_METHOD:
1523 gdb_assert_not_reached (
"bad type");
1537 case TYPE_CODE_METHODPTR:
1538 case TYPE_CODE_MEMBERPTR:
1544 case TYPE_CODE_METHOD:
1551 gdb_assert_not_reached (
"bad type");
1568 struct type *to_type)
1604 struct type *to_type,
struct field *args,
1605 int nargs,
int varargs)
1643 error (_(
"Invalid anonymous type %s [in module %s], GCC PR debug/47510 bug?"),
1669 error (_(
"No type named %s."),
name);
1677 uns.reserve (strlen (
name) + strlen (
"unsigned "));
1688 if (streq (
name,
"char"))
1689 name =
"signed char";
1705 error (_(
"No struct type named %s."),
name);
1707 if (sym->
type ()->
code () != TYPE_CODE_STRUCT)
1709 error (_(
"This context has class, union or enum %s, not a struct."),
1712 return (sym->
type ());
1727 error (_(
"No union type named %s."),
name);
1731 if (t->
code () == TYPE_CODE_UNION)
1735 error (_(
"This context has class, struct or enum %s, not a union."),
1750 error (_(
"No enum type named %s."),
name);
1752 if (sym->
type ()->
code () != TYPE_CODE_ENUM)
1754 error (_(
"This context has class, struct or union %s, not an enum."),
1757 return (sym->
type ());
1768 nam.reserve (strlen (
name) + strlen (
type->
name ()) + strlen (
"< >"));
1778 error (_(
"No template type named %s."),
name);
1780 if (sym->
type ()->
code () != TYPE_CODE_STRUCT)
1782 error (_(
"This context has class, union or enum %s, not a struct."),
1785 return (sym->
type ());
1804 if (
type->
code () != TYPE_CODE_STRUCT
1805 &&
type->
code () != TYPE_CODE_UNION)
1808 error (_(
"Type %s is not a structure or union type."),
1809 type_name.c_str ());
1820 else if (!t_field_name || *t_field_name ==
'\0')
1824 if (elt.
field != NULL)
1836 if (elt.
field != NULL)
1841 return {
nullptr, 0};
1844 error (_(
"Type %s has no component named %s."), type_name.c_str (),
name);
1853 if (elt.
field != NULL)
1868 gdb_assert (
type->
length () <= sizeof (ULONGEST));
1872 return ((((ULONGEST) 1 << (n - 1)) - 1) << 1) | 1;
1885 gdb_assert (
type->
length () <= sizeof (LONGEST));
1888 *min = -((ULONGEST) 1 << (n - 1));
1889 *max = ((ULONGEST) 1 << (n - 1)) - 1;
1900 gdb_assert (
type->
code () == TYPE_CODE_PTR);
1901 gdb_assert (
type->
length () <= sizeof (CORE_ADDR));
1904 return ((((CORE_ADDR) 1 << (n - 1)) - 1) << 1) | 1;
1918 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1919 ||
type->
code () == TYPE_CODE_UNION);
1931 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1932 ||
type->
code () == TYPE_CODE_UNION);
1945 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1946 ||
type->
code () == TYPE_CODE_UNION);
1957 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1958 ||
type->
code () == TYPE_CODE_UNION);
1991 struct type *basetype;
2004 *basetypep = basetype;
2023 complaint (_(
"stub type has NULL name"));
2045 if (top_level &&
type->
code () == TYPE_CODE_REF)
2074 case TYPE_CODE_RANGE:
2085 case TYPE_CODE_STRING:
2088 case TYPE_CODE_ARRAY:
2104 case TYPE_CODE_STRUCT:
2105 case TYPE_CODE_UNION:
2169 int rank,
bool resolve_p =
true)
2172 struct type *static_range_type, *static_target_type;
2175 gdb_assert (dyn_range_type->
code () == TYPE_CODE_RANGE);
2176 gdb_assert (
rank >= 0);
2180 { (CORE_ADDR)
rank }))
2187 { (CORE_ADDR)
rank }))
2201 { (CORE_ADDR)
rank }))
2211 if (!byte_stride_p && (
value % (unit_size * 8)) != 0)
2212 error (_(
"bit strides that are not a multiple of the byte size "
2213 "are currently not supported"));
2218 byte_stride_p =
true;
2223 addr_stack, frame, 0);
2224 LONGEST bias = dyn_range_type->
bounds ()->
bias;
2227 (alloc, static_target_type,
2228 &low_bound, &high_bound, bias, &stride, byte_stride_p);
2231 return static_range_type;
2257 int rank,
bool resolve_p)
2260 struct type *elt_type;
2261 struct type *range_type;
2262 struct type *ary_dim;
2264 unsigned int bit_stride = 0;
2268 gdb_assert (
type->
code () == TYPE_CODE_ARRAY
2269 ||
type->
code () == TYPE_CODE_STRING);
2273 gdb_assert (
rank >= 0);
2285 if (prop != NULL && resolve_p
2294 if (prop != NULL && resolve_p
2307 if (ary_dim != NULL && ary_dim->
code () == TYPE_CODE_ARRAY)
2318 if (prop != NULL && resolve_p)
2323 bit_stride = (
unsigned int) (
value * 8);
2330 warning (_(
"cannot determine array stride for type %s"),
2356 gdb_assert (
type->
code () == TYPE_CODE_ARRAY
2357 ||
type->
code () == TYPE_CODE_STRING);
2377 if (prop_list !=
nullptr)
2379 struct obstack *obstack
2386 else if (
type->
code () == TYPE_CODE_STRING &&
rank != 1)
2390 error (_(
"unable to handle string with dynamic rank greater than 1"));
2405 for (
int i = 1; i <
rank; i++)
2418 tmp_type->code () == TYPE_CODE_ARRAY;
2444 struct type *resolved_type;
2446 unsigned int max_len = 0;
2448 gdb_assert (
type->
code () == TYPE_CODE_UNION);
2452 for (i = 0; i < resolved_type->
num_fields (); ++i)
2460 addr_stack, frame, 0);
2464 if (real_type->
length () > max_len)
2465 max_len = real_type->
length ();
2469 return resolved_type;
2487 std::vector<bool> &
flags);
2502 std::vector<bool> &
flags,
2514 for (
const auto &sub_variant : new_part.variants)
2534 std::vector<bool> &
flags)
2537 gdb::optional<ULONGEST> discr_value;
2543 error (_(
"Cannot determine struct field location"
2544 " (invalid location kind)"));
2546 if (addr_stack->
valaddr.data () != NULL)
2551 CORE_ADDR addr = (addr_stack->
addr
2553 / TARGET_CHAR_BIT));
2556 LONGEST
size = bitsize / 8;
2560 gdb_byte
bits[
sizeof (ULONGEST)];
2567 bits, bitpos, bitsize);
2572 const variant *default_variant =
nullptr;
2573 const variant *applied_variant =
nullptr;
2578 else if (discr_value.has_value ()
2585 if (applied_variant ==
nullptr)
2586 applied_variant = default_variant;
2600 struct type *resolved_type,
2602 const gdb::array_view<variant_part> &parts)
2608 for (
const auto &part : parts)
2611 unsigned int nfields = std::count (
flags.begin (),
flags.end (),
true);
2636 struct type *resolved_type;
2638 unsigned resolved_type_bit_length = 0;
2640 gdb_assert (
type->
code () == TYPE_CODE_STRUCT);
2658 for (i = 0; i < resolved_type->
num_fields (); ++i)
2660 unsigned new_bit_length;
2678 {addr_stack->
addr}))
2680 (TARGET_CHAR_BIT * (addr - addr_stack->
addr));
2691 error (_(
"Cannot determine struct field location"
2692 " (invalid location kind)"));
2695 size_t offset = resolved_type->
field (i).
loc_bitpos () / TARGET_CHAR_BIT;
2699 pinfo.
addr = addr_stack->
addr + offset;
2700 pinfo.
next = addr_stack;
2713 struct type *real_type
2716 new_bit_length += (real_type->
length () * TARGET_CHAR_BIT);
2725 if (new_bit_length > resolved_type_bit_length)
2726 resolved_type_bit_length = new_bit_length;
2734 resolved_type->
set_length ((resolved_type_bit_length + TARGET_CHAR_BIT - 1)
2741 return resolved_type;
2753 struct type *resolved_type =
nullptr;
2760 gdb::optional<CORE_ADDR> type_length;
2764 type_length =
value;
2766 if (
type->
code () == TYPE_CODE_TYPEDEF)
2786 if (addr_stack->
valaddr.data () != NULL)
2791 pinfo.
next = addr_stack;
2796 &pinfo, frame, top_level));
2800 case TYPE_CODE_STRING:
2803 case TYPE_CODE_ARRAY:
2808 case TYPE_CODE_RANGE:
2817 case TYPE_CODE_UNION:
2821 case TYPE_CODE_STRUCT:
2827 if (resolved_type ==
nullptr)
2830 if (type_length.has_value ())
2844 && resolved_type->
code () == TYPE_CODE_ARRAY)
2851 return resolved_type;
2858 gdb::array_view<const gdb_byte> valaddr,
2866 if (in_frame !=
nullptr)
2879 while (node != NULL)
2916 while (NULL != curr_node)
2924 if (NULL == prev_node)
2932 prev_node = curr_node;
2933 curr_node = curr_node->
next;
2976 while (
type->
code () == TYPE_CODE_TYPEDEF)
3016 const type_instance_flags ALL_SPACES
3019 const type_instance_flags ALL_CLASSES
3025 if ((instance_flags & ALL_SPACES) != 0)
3026 new_instance_flags &= ~ALL_SPACES;
3027 if ((instance_flags & ALL_CLASSES) != 0)
3028 new_instance_flags &= ~ALL_CLASSES;
3030 instance_flags |= new_instance_flags;
3045 struct type *newtype;
3108 else if (
type->
code () == TYPE_CODE_RANGE)
3113 else if (
type->
code () == TYPE_CODE_ARRAY
3135 scoped_restore saved_gdb_stderr = make_scoped_restore (&
gdb_stderr,
3143 catch (
const gdb_exception_error &except)
3167 gdb::unique_xmalloc_ptr<char> demangled_name
3168 =
gdb_demangle (mangled_name, DMGL_PARAMS | DMGL_ANSI);
3169 char *argtypetext, *p;
3170 int depth = 0, argcount = 1;
3171 struct field *argtypes;
3176 p = strchr (demangled_name.get (),
'(');
3180 if (demangled_name == NULL || p == NULL)
3181 error (_(
"Internal: Cannot demangle mangled name `%s'."),
3189 if (*p ==
'(' || *p ==
'<')
3193 else if (*p ==
')' || *p ==
'>')
3197 else if (*p ==
',' && depth == 0)
3206 if (startswith (argtypetext,
"(void)"))
3211 argtypes = (
struct field *)
3230 if (depth <= 0 && (*p ==
',' || *p ==
')'))
3234 if (strncmp (argtypetext,
"...", p - argtypetext) != 0
3235 && strncmp (argtypetext,
"void", p - argtypetext) != 0)
3237 argtypes[argcount].set_type
3241 argtypetext = p + 1;
3244 if (*p ==
'(' || *p ==
'<')
3248 else if (*p ==
')' || *p ==
'>')
3264 argtypes, argcount, p[-2] ==
'.');
3283 for (
int j = 0; j < len; j++)
3330 gdb_assert (floatformat != NULL);
3333 bit = floatformat->totalsize;
3335 gdb_assert (
bit >= 0);
3336 gdb_assert (
bit >= floatformat->totalsize);
3344const struct floatformat *
3347 gdb_assert (
type->
code () == TYPE_CODE_FLT);
3356 int bit,
int unsigned_p,
const char *
name)
3375 int bit,
int unsigned_p,
const char *
name)
3390 int bit,
int unsigned_p,
const char *
name)
3410 const struct floatformat **floatformats,
3411 enum bfd_endian byte_order)
3413 if (byte_order == BFD_ENDIAN_UNKNOWN)
3418 const struct floatformat *fmt = floatformats[byte_order];
3464 + strlen (
"_Complex ") + 1);
3465 strcpy (new_name,
"_Complex ");
3503 int bit,
int unsigned_p,
const char *
name)
3542 case TYPE_CODE_FUNC:
3543 case TYPE_CODE_FLAGS:
3545 case TYPE_CODE_RANGE:
3547 case TYPE_CODE_ENUM:
3549 case TYPE_CODE_RVALUE_REF:
3550 case TYPE_CODE_CHAR:
3551 case TYPE_CODE_BOOL:
3552 case TYPE_CODE_DECFLOAT:
3553 case TYPE_CODE_METHODPTR:
3554 case TYPE_CODE_MEMBERPTR:
3558 case TYPE_CODE_ARRAY:
3559 case TYPE_CODE_COMPLEX:
3560 case TYPE_CODE_TYPEDEF:
3564 case TYPE_CODE_STRUCT:
3565 case TYPE_CODE_UNION:
3567 int number_of_non_static_fields = 0;
3572 number_of_non_static_fields++;
3580 if (f_align > align)
3586 if (number_of_non_static_fields == 0)
3592 case TYPE_CODE_STRING:
3597 case TYPE_CODE_VOID:
3601 case TYPE_CODE_ERROR:
3602 case TYPE_CODE_METHOD:
3607 if ((align & (align - 1)) != 0)
3622 gdb_assert ((align & (align - 1)) == 0);
3624 unsigned result = 0;
3649 && t->
code () == TYPE_CODE_PTR
3660 && ((t->
code () == TYPE_CODE_INT)
3661 || (t->
code () == TYPE_CODE_ENUM)
3662 || (t->
code () == TYPE_CODE_FLAGS)
3663 || (t->
code () == TYPE_CODE_CHAR)
3664 || (t->
code () == TYPE_CODE_RANGE)
3665 || (t->
code () == TYPE_CODE_BOOL)));
3674 && ((t->
code () == TYPE_CODE_FLT)
3675 || (t->
code () == TYPE_CODE_DECFLOAT)));
3690 case TYPE_CODE_ARRAY:
3691 case TYPE_CODE_STRUCT:
3692 case TYPE_CODE_UNION:
3694 case TYPE_CODE_STRING:
3713 else if ((t->
code () == TYPE_CODE_ARRAY
3717 LONGEST low_bound, high_bound;
3721 return (high_bound == low_bound
3727 else if (t->
code () == TYPE_CODE_STRUCT && t->
num_fields () == 1)
3729 else if (t->
code () == TYPE_CODE_UNION)
3734 for (i = 0; i < n; i++)
3749 return (t->
code () == TYPE_CODE_STRUCT
3750 || t->
code () == TYPE_CODE_UNION);
3762 && !strcmp (a->
name (), b->
name ())));
3837 const gdb_byte *valaddr,
int embedded_offset,
3838 CORE_ADDR address,
struct value *val)
3863 *offset = this_offset;
3866 else if (this_offset == *offset)
3876 embedded_offset + this_offset,
3905 if (byteorder == BFD_ENDIAN_BIG)
3906 return BFD_ENDIAN_LITTLE;
3909 gdb_assert (byteorder == BFD_ENDIAN_LITTLE);
3910 return BFD_ENDIAN_BIG;
3937 c.
rank = a.rank + b.rank;
3938 c.
subrank = a.subrank + b.subrank;
3981 bool found_pos =
false;
3983 bool found_neg =
false;
3985 bool a_invalid =
false;
3987 bool b_invalid =
false;
3990 if (a.size () != b.size ())
3994 for (i = 0; i < a.size (); i++)
4012 if (a_invalid != b_invalid)
4041 gdb::array_view<value *> args)
4045 bv.reserve (1 + args.size ());
4054 bv.push_back ((args.size () != parms.size ())
4059 size_t min_len = std::min (parms.size (), args.size ());
4061 for (
size_t i = 0; i < min_len; i++)
4066 for (
size_t i = min_len; i < args.size (); i++)
4079 int first_p, second_p;
4083 first_p = (strstr (first,
"short") != NULL);
4084 second_p = (strstr (second,
"short") != NULL);
4085 if (first_p && second_p)
4087 if (first_p || second_p)
4091 first_p = (strstr (first,
"long") != NULL);
4092 second_p = (strstr (second,
"long") != NULL);
4093 if (first_p && second_p)
4095 if (first_p || second_p)
4099 first_p = (strstr (first,
"char") != NULL);
4100 second_p = (strstr (second,
"char") != NULL);
4101 if (first_p && second_p)
4103 if (first_p || second_p)
4124 if (a->
code () == TYPE_CODE_TYPEDEF)
4126 if (b->
code () == TYPE_CODE_TYPEDEF)
4141 if (a->
code () == TYPE_CODE_PTR
4142 || a->
code () == TYPE_CODE_REF)
4152 && strcmp (a->
name (), b->
name ()) == 0)
4157 if (a->
code () == TYPE_CODE_FUNC)
4198 if (s == NULL || t == NULL)
4200 return strcmp (s, t) == 0;
4209 std::vector<type_equality_entry> *worklist)
4217 if (type1->
code () != type2->
code ()
4234 if (type1->
code () == TYPE_CODE_RANGE)
4245 const struct field *field1 = &type1->
field (i);
4246 const struct field *field2 = &type2->
field (i);
4283 || memcmp (block1->
data, block2->
data, block1->
size) != 0)
4288 internal_error (_(
"Unsupported field kind "
4289 "%d by check_types_equal"),
4293 worklist->emplace_back (field1->
type (), field2->
type ());
4318 while (!worklist->empty ())
4323 worklist->pop_back ();
4327 cache->
insert (&entry,
sizeof (entry), &added);
4344 std::vector<type_equality_entry> worklist;
4386 switch (arg->
code ())
4392 if (parm->target_type ()->code () == TYPE_CODE_VOID)
4403 case TYPE_CODE_ARRAY:
4405 struct type *t1 = parm->target_type ();
4421 case TYPE_CODE_FUNC:
4440 case TYPE_CODE_ENUM:
4441 case TYPE_CODE_FLAGS:
4442 case TYPE_CODE_CHAR:
4443 case TYPE_CODE_RANGE:
4444 case TYPE_CODE_BOOL:
4455 switch (arg->
code ())
4458 case TYPE_CODE_ARRAY:
4471 switch (arg->
code ())
4485 switch (arg->
code ())
4488 if (arg->
length () == parm->length ())
4492 if (parm->has_no_signedness ())
4500 else if (parm->is_unsigned ())
4548 else if (arg->
length () < parm->length ())
4552 case TYPE_CODE_ENUM:
4553 case TYPE_CODE_FLAGS:
4554 case TYPE_CODE_CHAR:
4555 case TYPE_CODE_RANGE:
4556 case TYPE_CODE_BOOL:
4574 switch (arg->
code ())
4577 case TYPE_CODE_CHAR:
4578 case TYPE_CODE_RANGE:
4579 case TYPE_CODE_BOOL:
4580 case TYPE_CODE_ENUM:
4596 switch (arg->
code ())
4598 case TYPE_CODE_RANGE:
4599 case TYPE_CODE_BOOL:
4600 case TYPE_CODE_ENUM:
4607 if (arg->
length () > parm->length ())
4609 else if (arg->
length () < parm->length ())
4612 case TYPE_CODE_CHAR:
4615 if (parm->has_no_signedness ())
4622 else if (parm->is_unsigned ())
4643 switch (arg->
code ())
4646 case TYPE_CODE_CHAR:
4647 case TYPE_CODE_RANGE:
4648 case TYPE_CODE_BOOL:
4649 case TYPE_CODE_ENUM:
4663 switch (arg->
code ())
4674 case TYPE_CODE_CHAR:
4675 case TYPE_CODE_ENUM:
4677 case TYPE_CODE_MEMBERPTR:
4680 case TYPE_CODE_RANGE:
4682 case TYPE_CODE_BOOL:
4694 switch (arg->
code ())
4697 if (arg->
length () < parm->length ())
4699 else if (arg->
length () == parm->length ())
4704 case TYPE_CODE_BOOL:
4705 case TYPE_CODE_ENUM:
4706 case TYPE_CODE_RANGE:
4707 case TYPE_CODE_CHAR:
4719 switch (arg->
code ())
4723 case TYPE_CODE_COMPLEX:
4737 switch (arg->
code ())
4739 case TYPE_CODE_STRUCT:
4755 switch (arg->
code ())
4784 if (parm->code () == TYPE_CODE_TYPEDEF)
4786 if (arg->
code () == TYPE_CODE_TYPEDEF)
4795 if (parm->code () == TYPE_CODE_RVALUE_REF)
4806 if (parm->code () == TYPE_CODE_RVALUE_REF)
4813 struct type *t1 = parm;
4814 struct type *t2 = arg;
4817 if (parm->is_pointer_or_reference ())
4819 t1 = parm->target_type ();
4846 "------ Arg is %s [%d], parm is %s [%d]\n",
4848 parm->name (), parm->code ());
4853 switch (parm->code ())
4857 case TYPE_CODE_ARRAY:
4859 case TYPE_CODE_FUNC:
4863 case TYPE_CODE_ENUM:
4865 case TYPE_CODE_CHAR:
4867 case TYPE_CODE_RANGE:
4869 case TYPE_CODE_BOOL:
4873 case TYPE_CODE_COMPLEX:
4875 case TYPE_CODE_STRUCT:
4893 for (bitno = 0; bitno < nbits; bitno++)
4895 if ((bitno % 8) == 0)
4917 for (i = 0; i < nargs; i++)
4920 (
"%*s[%d] name '%s'\n", spaces,
"", i,
4921 args[i].
name () != NULL ? args[i].
name () :
"<NULL>");
4934 gdb_printf (
"%*sfn_fieldlists %s\n", spaces,
"",
4940 (
"%*s[%d] name '%s' (%s) length %d\n", spaces + 2,
"",
4945 for (overload_idx = 0;
4950 (
"%*s[%d] physname '%s' (%s)\n",
4951 spaces + 4,
"", overload_idx,
4956 (
"%*stype %s\n", spaces + 8,
"",
4963 (
"%*sargs %s\n", spaces + 8,
"",
4969 (
"%*sfcontext %s\n", spaces + 8,
"",
4973 gdb_printf (
"%*sis_const %d\n", spaces + 8,
"",
4975 gdb_printf (
"%*sis_volatile %d\n", spaces + 8,
"",
4977 gdb_printf (
"%*sis_private %d\n", spaces + 8,
"",
4979 gdb_printf (
"%*sis_protected %d\n", spaces + 8,
"",
4981 gdb_printf (
"%*sis_stub %d\n", spaces + 8,
"",
4983 gdb_printf (
"%*sdefaulted %d\n", spaces + 8,
"",
4985 gdb_printf (
"%*sis_deleted %d\n", spaces + 8,
"",
4987 gdb_printf (
"%*svoffset %u\n", spaces + 8,
"",
4996 gdb_printf (
"%*svptr_fieldno %d\n", spaces,
"",
4998 gdb_printf (
"%*svptr_basetype %s\n", spaces,
"",
5003 gdb_printf (
"%*sn_baseclasses %d\n", spaces,
"",
5005 gdb_printf (
"%*snfn_fields %d\n", spaces,
"",
5010 (
"%*svirtual_field_bits (%d bits at *%s)",
5023 (
"%*sprivate_field_bits (%d bits at *%s)",
5033 (
"%*sprotected_field_bits (%d bits at *%s",
5046 gdb_printf (
"%*scalling_convention %d\n", spaces,
"",
5058 if (descriptive_type == NULL)
5059 gdb_printf (
"%*sno descriptive type\n", spaces + 2,
"");
5062 gdb_printf (
"%*sdescriptive type\n", spaces + 2,
"");
5073 gdb_printf (
"%*sscaling factor: %s\n", spaces + 2,
"",
5084 switch (prop.
kind ())
5097 gdb_assert_not_reached (
"unhandled prop kind");
5113 struct type **first_dont_print
5116 int i = (
struct type **)
5121 if (
type == first_dont_print[i])
5124 host_address_to_string (
type));
5125 gdb_printf (_(
" <same as already seen type>\n"));
5134 host_address_to_string (
type));
5135 gdb_printf (
"%*sname '%s' (%s)\n", spaces,
"",
5137 host_address_to_string (
type->
name ()));
5147 case TYPE_CODE_ARRAY:
5150 case TYPE_CODE_STRUCT:
5153 case TYPE_CODE_UNION:
5156 case TYPE_CODE_ENUM:
5159 case TYPE_CODE_FLAGS:
5162 case TYPE_CODE_FUNC:
5171 case TYPE_CODE_VOID:
5177 case TYPE_CODE_RANGE:
5180 case TYPE_CODE_STRING:
5183 case TYPE_CODE_ERROR:
5186 case TYPE_CODE_MEMBERPTR:
5189 case TYPE_CODE_METHODPTR:
5192 case TYPE_CODE_METHOD:
5198 case TYPE_CODE_CHAR:
5201 case TYPE_CODE_BOOL:
5204 case TYPE_CODE_COMPLEX:
5207 case TYPE_CODE_TYPEDEF:
5210 case TYPE_CODE_NAMESPACE:
5213 case TYPE_CODE_FIXED_POINT:
5229 gdb_printf (
"%*starget_type %s\n", spaces,
"",
5235 gdb_printf (
"%*spointer_type %s\n", spaces,
"",
5237 gdb_printf (
"%*sreference_type %s\n", spaces,
"",
5239 gdb_printf (
"%*stype_chain %s\n", spaces,
"",
5241 gdb_printf (
"%*sinstance_flags 0x%x", spaces,
"",
5261 gdb_puts (
" TYPE_ADDRESS_CLASS_1");
5265 gdb_puts (
" TYPE_ADDRESS_CLASS_2");
5288 gdb_puts (
" TYPE_ENDIANITY_NOT_DEFAULT");
5348 if (
type->
code () == TYPE_CODE_ENUM)
5349 gdb_printf (
"%*s[%d] enumval %s type ", spaces + 2,
"",
5352 gdb_printf (
"%*s[%d] bitpos %s bitsize %d type ", spaces + 2,
"",
5366 if (
type->
code () == TYPE_CODE_RANGE)
5378 gdb_printf (
"%*scplus_stuff %s\n", spaces,
"",
5384 gdb_printf (
"%*sgnat_stuff %s\n", spaces,
"",
5400 gdb_printf (
"%*scalling_convention %d\n", spaces,
"",
5411 gdb_printf (
"%*sfixed_point_info ", spaces,
"");
5421 gdb_printf (
"%*s bit size = %u, bit offset = %u\n", spaces,
"",
5448 return htab_hash_pointer (pair->
old);
5457 return lhs->
old == rhs->
old;
5467 htab_delete_entry<type_pair>,
5480 while (*node_ptr != NULL)
5485 obstack_copy (storage, *node_ptr,
5487 node_copy->
prop = (*node_ptr)->prop;
5488 *node_ptr = node_copy;
5490 node_ptr = &node_copy->
next;
5512 slot = htab_find_slot (copied_types, &pair, INSERT);
5514 return ((
struct type_pair *) *slot)->newobj;
5544 for (i = 0; i < nfields; i++)
5576 internal_error (_(
"Unexpected type field location kind: %d"),
5583 if (
type->
code () == TYPE_CODE_RANGE)
5646 gdb_assert_not_reached (
"bad type_specific_kind");
5700 struct type *field_type,
const char *
name)
5702 int type_bitsize =
type->
length () * TARGET_CHAR_BIT;
5705 gdb_assert (
type->
code () == TYPE_CODE_FLAGS);
5707 gdb_assert (start_bitpos >= 0 && start_bitpos < type_bitsize);
5708 gdb_assert (nr_bits >= 1 && (start_bitpos + nr_bits) <= type_bitsize);
5709 gdb_assert (
name != NULL);
5739 gdb_assert (
code == TYPE_CODE_STRUCT ||
code == TYPE_CODE_UNION);
5760 memset (
f, 0,
sizeof f[0]);
5762 f[0].set_name (
name);
5775 if (t->
code () == TYPE_CODE_UNION)
5780 else if (t->
code () == TYPE_CODE_STRUCT)
5787 + (
f[-1].
type ()->length () * TARGET_CHAR_BIT));
5793 alignment *= TARGET_CHAR_BIT;
5794 left =
f[0].loc_bitpos () % alignment;
5798 f->set_loc_bitpos (
f[0].
loc_bitpos () + (alignment - left));
5800 (t->
length () + (alignment - left) / TARGET_CHAR_BIT);
5824typedef std::vector<std::unique_ptr<fixed_point_type_info>>
5836 auto up = gdb::make_unique<fixed_point_type_info> ();
5843 if (storage ==
nullptr)
5846 storage->push_back (std::move (up));
5852 info = up.release ();
5867 return type->
code () == TYPE_CODE_FIXED_POINT;
5881 gdb_assert (
type->
code () == TYPE_CODE_FIXED_POINT);
5908 size_t size = nfields *
sizeof (*this->
fields ());
5910 = (
struct field *) (init
5927 size_t size = nfields *
sizeof (*this->
fields ());
5936 unsigned int nfields = src.size ();
5941 size_t size = nfields *
sizeof (*this->
fields ());
5959 if (
code () == TYPE_CODE_ARRAY)
5978 = alloc.
new_type (TYPE_CODE_VOID, TARGET_CHAR_BIT,
"void");
5988 1,
"unsigned char");
5994 1,
"unsigned short");
6006 1,
"unsigned long");
6012 1,
"unsigned long long");
6033 = alloc.
new_type (TYPE_CODE_STRING, TARGET_CHAR_BIT,
"string");
6107 = alloc.
new_type (TYPE_CODE_INTERNAL_FUNCTION, 0,
6108 "<internal function>");
6112 = alloc.
new_type (TYPE_CODE_XMETHOD, 0,
"<xmethod>");
6116 = alloc.
new_type (TYPE_CODE_ERROR, 0,
"<unknown type>");
6121 = alloc.
new_type (TYPE_CODE_FUNC, TARGET_CHAR_BIT,
6122 "<text variable, no debug info>");
6125 = alloc.
new_type (TYPE_CODE_FUNC, TARGET_CHAR_BIT,
6126 "<text gnu-indirect-function variable, no debug info>");
6131 "<text from jump slot in .got.plt, no debug info>",
6134 = alloc.
new_type (TYPE_CODE_ERROR, 0,
"<data variable, no debug info>");
6136 = alloc.
new_type (TYPE_CODE_ERROR, 0,
6137 "<variable (not text or data), no debug info>");
6139 = alloc.
new_type (TYPE_CODE_ERROR, 0,
6140 "<thread local variable, no debug info>");
6171 if (result ==
nullptr)
6198 _(
"Set debugging of C++ overloading."),
6199 _(
"Show debugging of C++ overloading."),
6200 _(
"When enabled, ranking of the "
6201 "functions is displayed."),
6209 _(
"Set resolution of opaque struct/class/union"
6210 " types (if set before loading symbols)."),
6211 _(
"Show resolution of opaque struct/class/union"
6212 " types (if set before loading symbols)."),
6220 _(
"Set strict type checking."),
6221 _(
"Show strict type checking."),
#define bits(obj, st, fn)
void * xcalloc(size_t number, size_t size)
obstack * gdbarch_obstack(gdbarch *arch)
void set(unsigned key, void *datum)
union type_allocator::@68 m_data
struct cmd_list_element * showlist
struct cmd_list_element * setchecklist
struct cmd_list_element * setlist
struct cmd_list_element * showdebuglist
struct cmd_list_element * showchecklist
struct cmd_list_element * setdebuglist
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define complaint(FMT,...)
CORE_ADDR read_memory_typed_address(CORE_ADDR addr, struct type *type)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int cplus_method_ptr_size(struct type *to_type)
int baseclass_offset(struct type *type, int index, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val)
gdb::unique_xmalloc_ptr< char > gdb_demangle(const char *name, int options)
static int dynamic_array_type(struct type *type, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
struct type * parse_and_eval_type(const char *p, int length)
CORE_ADDR fortran_adjust_dynamic_array_base_address_hack(struct type *type, CORE_ADDR address)
const char * gdbarch_address_class_type_flags_to_name(struct gdbarch *gdbarch, type_instance_flags type_flags)
int gdbarch_half_bit(struct gdbarch *gdbarch)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int gdbarch_wchar_bit(struct gdbarch *gdbarch)
bool gdbarch_address_class_name_to_type_flags(struct gdbarch *gdbarch, const char *name, type_instance_flags *type_flags_ptr)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
int gdbarch_long_long_bit(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_half_format(struct gdbarch *gdbarch)
int gdbarch_short_bit(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_bfloat16_format(struct gdbarch *gdbarch)
ULONGEST gdbarch_type_align(struct gdbarch *gdbarch, struct type *type)
int gdbarch_int_bit(struct gdbarch *gdbarch)
int gdbarch_float_bit(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_double_format(struct gdbarch *gdbarch)
bool gdbarch_address_class_type_flags_to_name_p(struct gdbarch *gdbarch)
int gdbarch_char_signed(struct gdbarch *gdbarch)
bool gdbarch_address_class_name_to_type_flags_p(struct gdbarch *gdbarch)
int gdbarch_long_double_bit(struct gdbarch *gdbarch)
int gdbarch_bfloat16_bit(struct gdbarch *gdbarch)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_float_format(struct gdbarch *gdbarch)
const struct floatformat ** gdbarch_long_double_format(struct gdbarch *gdbarch)
int gdbarch_long_bit(struct gdbarch *gdbarch)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
int gdbarch_wchar_signed(struct gdbarch *gdbarch)
int gdbarch_double_bit(struct gdbarch *gdbarch)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
static bool compare_maybe_null_strings(const char *s, const char *t)
struct type * make_pointer_type(struct type *type, struct type **typeptr)
void set_type_vptr_basetype(struct type *type, struct type *basetype)
static bool check_types_equal(struct type *type1, struct type *type2, std::vector< type_equality_entry > *worklist)
struct type * copy_type_recursive(struct type *type, htab_t copied_types)
unsigned type_raw_align(struct type *type)
void set_type_vptr_fieldno(struct type *type, int fieldno)
struct type * internal_type_vptr_basetype(struct type *type)
static struct rank rank_one_type_parm_func(struct type *parm, struct type *arg, struct value *value)
const struct rank INTEGER_PROMOTION_BADNESS
static void print_bit_vector(B_TYPE *bits, int nbits)
struct type * create_set_type(type_allocator &alloc, struct type *domain_type)
struct type * get_target_type(struct type *type)
struct type * make_restrict_type(struct type *type)
int is_scalar_type_recursive(struct type *t)
enum bfd_endian type_byte_order(const struct type *type)
void check_stub_method_group(struct type *type, int method_id)
struct type * lookup_pointer_type(struct type *type)
static struct type * resolve_dynamic_array_or_string_1(struct type *type, struct property_addr_info *addr_stack, const frame_info_ptr &frame, int rank, bool resolve_p)
struct type * lookup_enum(const char *name, const struct block *block)
const struct floatformat * floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN]
struct type * init_character_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
struct type * init_integer_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
const struct rank BASE_PTR_CONVERSION_BADNESS
static int is_dynamic_type_internal(struct type *type, int top_level)
void append_flags_type_flag(struct type *type, int bitpos, const char *name)
struct type * create_static_range_type(type_allocator &alloc, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
struct type * internal_type_self_type(struct type *type)
struct type * make_unqualified_type(struct type *type)
const struct rank LENGTH_MISMATCH_BADNESS
static struct rank rank_one_type_parm_ptr(struct type *parm, struct type *arg, struct value *value)
struct type * lookup_lvalue_reference_type(struct type *type)
void set_type_self_type(struct type *type, struct type *self_type)
static int integer_types_same_name_p(const char *first, const char *second)
bool operator==(const dynamic_prop &l, const dynamic_prop &r)
static const struct registry< objfile >::key< fixed_point_type_storage > fixed_point_objfile_key
static struct rank rank_one_type_parm_range(struct type *parm, struct type *arg, struct value *value)
struct type * lookup_methodptr_type(struct type *to_type)
static bool update_static_array_size(struct type *type)
bool set_type_align(struct type *type, ULONGEST align)
int is_integral_type(struct type *t)
struct_elt lookup_struct_elt(struct type *type, const char *name, int noerr)
struct type * lookup_typename(const struct language_defn *language, const char *name, const struct block *block, int noerr)
int is_floating_type(struct type *t)
htab_up create_copied_types_hash()
const struct rank BOOL_CONVERSION_BADNESS
struct type * create_range_type(type_allocator &alloc, struct type *index_type, const struct dynamic_prop *low_bound, const struct dynamic_prop *high_bound, LONGEST bias)
const struct rank NS_POINTER_CONVERSION_BADNESS
const struct rank FLOAT_PROMOTION_BADNESS
const struct floatformat * floatformats_m68881_ext[BFD_ENDIAN_UNKNOWN]
struct type * lookup_struct_elt_type(struct type *type, const char *name, int noerr)
void allocate_cplus_struct_type(struct type *type)
static void set_type_code(struct type *type, enum type_code code)
struct type * init_fixed_point_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
const struct rank TOO_FEW_PARAMS_BADNESS
static struct rank rank_one_type_parm_array(struct type *parm, struct type *arg, struct value *value)
int internal_type_vptr_fieldno(struct type *type)
static void print_args(struct field *args, int nargs, int spaces)
struct type * arch_composite_type(struct gdbarch *gdbarch, const char *name, enum type_code code)
int is_scalar_type(struct type *type)
void allocate_gnat_aux_type(struct type *type)
const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS
static struct rank rank_one_type_parm_complex(struct type *parm, struct type *arg, struct value *value)
void _initialize_gdbtypes()
struct type * make_reference_type(struct type *type, struct type **typeptr, enum type_code refcode)
static int is_unique_ancestor_worker(struct type *base, struct type *dclass, int *offset, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct value *val)
struct rank rank_one_type(struct type *parm, struct type *arg, struct value *value)
static bool has_static_range(const struct range_bounds *bounds)
int is_dynamic_type(struct type *type)
int class_or_union_p(const struct type *t)
static int type_pair_eq(const void *item_lhs, const void *item_rhs)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
const struct rank INCOMPATIBLE_TYPE_BADNESS
void allocate_fixed_point_type_info(struct type *type)
const struct rank NULL_POINTER_CONVERSION_BADNESS
struct type * init_decfloat_type(type_allocator &alloc, int bit, const char *name)
const struct floatformat * floatformat_from_type(const struct type *type)
static void print_gnat_stuff(struct type *type, int spaces)
const struct floatformat * floatformats_ieee_quad[BFD_ENDIAN_UNKNOWN]
static void smash_type(struct type *type)
const struct rank REFERENCE_SEE_THROUGH_BADNESS
struct type * make_cv_type(int cnst, int voltl, struct type *type, struct type **typeptr)
bool get_discrete_bounds(struct type *type, LONGEST *lowp, LONGEST *highp)
const struct floatformat * floatformats_ieee_double_littlebyte_bigword[BFD_ENDIAN_UNKNOWN]
const struct rank INT_FLOAT_CONVERSION_BADNESS
static struct type * resolve_dynamic_struct(struct type *type, struct property_addr_info *addr_stack, const frame_info_ptr &frame)
gdb::optional< LONGEST > get_discrete_high_bound(struct type *type)
static void compute_variant_fields(struct type *type, struct type *resolved_type, struct property_addr_info *addr_stack, const gdb::array_view< variant_part > &parts)
struct type * lookup_function_type(struct type *type)
struct type * create_string_type(type_allocator &alloc, struct type *string_char_type, struct type *range_type)
static struct type * safe_parse_type(struct gdbarch *gdbarch, const char *p, int length)
static void stub_noname_complaint(void)
const struct rank BASE_CONVERSION_BADNESS
struct type * arch_flags_type(struct gdbarch *gdbarch, const char *name, int bit)
struct type * create_range_type_with_stride(type_allocator &alloc, struct type *index_type, const struct dynamic_prop *low_bound, const struct dynamic_prop *high_bound, LONGEST bias, const struct dynamic_prop *stride, bool byte_stride_p)
static int verify_floatformat(int bit, const struct floatformat *floatformat)
static const registry< gdbarch >::key< struct builtin_type > gdbtypes_data
static struct rank rank_one_type_parm_char(struct type *parm, struct type *arg, struct value *value)
badness_vector rank_function(gdb::array_view< type * > parms, gdb::array_view< value * > args)
struct type * lookup_function_type_with_arguments(struct type *type, int nparams, struct type **param_types)
struct type * init_vector_type(struct type *elt_type, int n)
static struct dynamic_prop_list * copy_dynamic_prop_list(struct obstack *, struct dynamic_prop_list *)
static struct rank rank_one_type_parm_bool(struct type *parm, struct type *arg, struct value *value)
gdb::optional< LONGEST > get_discrete_low_bound(struct type *type)
void append_flags_type_field(struct type *type, int start_bitpos, int nr_bits, struct type *field_type, const char *name)
struct type * lookup_unsigned_typename(const struct language_defn *language, const char *name)
static void print_fixed_point_type_info(struct type *type, int spaces)
static void check_stub_method(struct type *type, int method_id, int signature_id)
struct type * init_pointer_type(type_allocator &alloc, int bit, const char *name, struct type *target_type)
bool is_nocall_function(const struct type *type)
struct type * resolve_dynamic_type(struct type *type, gdb::array_view< const gdb_byte > valaddr, CORE_ADDR addr, const frame_info_ptr *in_frame)
static struct type * alloc_type_instance(struct type *oldtype)
CORE_ADDR get_pointer_type_max(struct type *type)
struct type * make_type_with_address_space(struct type *type, type_instance_flags space_flag)
void get_signed_type_minmax(struct type *type, LONGEST *min, LONGEST *max)
const struct floatformat * floatformats_bfloat16[BFD_ENDIAN_UNKNOWN]
const struct rank CV_CONVERSION_BADNESS
int compare_ranks(struct rank a, struct rank b)
struct type * lookup_rvalue_reference_type(struct type *type)
struct type * lookup_reference_type(struct type *type, enum type_code refcode)
const char * address_space_type_instance_flags_to_name(struct gdbarch *gdbarch, type_instance_flags space_flag)
static void print_cplus_stuff(struct type *type, int spaces)
void smash_to_method_type(struct type *type, struct type *self_type, struct type *to_type, struct field *args, int nargs, int varargs)
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
const struct rank REFERENCE_CONVERSION_BADNESS
int is_unique_ancestor(struct type *base, struct value *val)
struct type * lookup_template_type(const char *name, struct type *type, const struct block *block)
static struct rank rank_one_type_parm_struct(struct type *parm, struct type *arg, struct value *value)
void append_composite_type_field_aligned(struct type *t, const char *name, struct type *field, int alignment)
struct type * init_float_type(type_allocator &alloc, int bit, const char *name, const struct floatformat **floatformats, enum bfd_endian byte_order)
void smash_to_methodptr_type(struct type *type, struct type *to_type)
static bool check_types_worklist(std::vector< type_equality_entry > *worklist, gdb::bcache *cache)
gdb::optional< LONGEST > discrete_position(struct type *type, LONGEST val)
struct type * lookup_memberptr_type(struct type *type, struct type *domain)
struct type * lookup_string_range_type(struct type *string_char_type, LONGEST low_bound, LONGEST high_bound)
static int distance_to_ancestor(struct type *base, struct type *dclass, int is_public)
static struct type * resolve_dynamic_union(struct type *type, struct property_addr_info *addr_stack, const frame_info_ptr &frame)
bool get_array_bounds(struct type *type, LONGEST *low_bound, LONGEST *high_bound)
unsigned int overload_debug
static void dump_fn_fieldlists(struct type *type, int spaces)
int compare_badness(const badness_vector &a, const badness_vector &b)
const struct floatformat * floatformats_ia64_spill[BFD_ENDIAN_UNKNOWN]
int is_ancestor(struct type *base, struct type *dclass)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
const struct floatformat * floatformats_arm_ext[BFD_ENDIAN_UNKNOWN]
struct type * create_array_type(type_allocator &alloc, struct type *element_type, struct type *range_type)
static struct rank rank_one_type_parm_float(struct type *parm, struct type *arg, struct value *value)
int is_public_ancestor(struct type *base, struct type *dclass)
int type_not_associated(const struct type *type)
unsigned type_align(struct type *type)
unsigned int type_length_units(struct type *type)
static struct type * resolve_dynamic_array_or_string(struct type *type, struct property_addr_info *addr_stack, const frame_info_ptr &frame)
bool types_equal(struct type *a, struct type *b)
void replace_type(struct type *ntype, struct type *type)
static struct type * resolve_dynamic_type_internal(struct type *type, struct property_addr_info *addr_stack, const frame_info_ptr &frame, int top_level)
struct type * init_complex_type(const char *name, struct type *target_type)
struct type * create_array_type_with_stride(type_allocator &alloc, struct type *element_type, struct type *range_type, struct dynamic_prop *byte_stride_prop, unsigned int bit_stride)
static void show_opaque_type_resolution(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
ULONGEST get_unsigned_type_max(struct type *type)
bool types_deeply_equal(struct type *type1, struct type *type2)
const struct rank INTEGER_CONVERSION_BADNESS
static void compute_variant_fields_inner(struct type *type, struct property_addr_info *addr_stack, const variant_part &part, std::vector< bool > &flags)
struct field * append_composite_type_field_raw(struct type *t, const char *name, struct type *field)
const struct cplus_struct_type cplus_struct_default
int get_vptr_fieldno(struct type *type, struct type **basetypep)
const struct floatformat * floatformats_ieee_half[BFD_ENDIAN_UNKNOWN]
void smash_to_memberptr_type(struct type *type, struct type *self_type, struct type *to_type)
static void dump_dynamic_prop(dynamic_prop const &prop)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
const struct gnat_aux_type gnat_aux_default
void append_composite_type_field(struct type *t, const char *name, struct type *field)
struct type * lookup_struct(const char *name, const struct block *block)
const struct rank EXACT_MATCH_BADNESS
struct type * lookup_union(const char *name, const struct block *block)
std::vector< std::unique_ptr< fixed_point_type_info > > fixed_point_type_storage
int class_types_same_p(const struct type *a, const struct type *b)
static struct builtin_type * create_gdbtypes_data(struct gdbarch *gdbarch)
struct type * init_boolean_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
static struct rank rank_one_type_parm_set(struct type *parm, struct type *arg, struct value *value)
static void show_overload_debug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct type * make_qualified_type(struct type *type, type_instance_flags new_flags, struct type *storage)
void recursive_dump_type(struct type *type, int spaces)
struct type * lookup_signed_typename(const struct language_defn *language, const char *name)
static struct rank rank_one_type_parm_int(struct type *parm, struct type *arg, struct value *value)
static void show_strict_type_checking(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
bool is_fixed_point_type(struct type *type)
static bool strict_type_checking
struct type * make_atomic_type(struct type *type)
static void compute_variant_fields_recurse(struct type *type, struct property_addr_info *addr_stack, const variant &variant, std::vector< bool > &flags, bool enabled)
const struct rank FLOAT_CONVERSION_BADNESS
static bool opaque_type_resolution
const struct floatformat * floatformats_vax_d[BFD_ENDIAN_UNKNOWN]
int type_not_allocated(const struct type *type)
const struct rank VOID_PTR_CONVERSION_BADNESS
static struct obstack dont_print_type_obstack
static hashval_t type_pair_hash(const void *item)
const struct floatformat * floatformats_i387_ext[BFD_ENDIAN_UNKNOWN]
#define INVALID_CONVERSION
type_instance_flags address_space_name_to_type_instance_flags(struct gdbarch *gdbarch, const char *space_identifier)
struct type * copy_type(const struct type *type)
const char * type_name_or_error(struct type *type)
static struct rank rank_one_type_parm_enum(struct type *parm, struct type *arg, struct value *value)
struct type * check_typedef(struct type *type)
void make_vector_type(struct type *array_type)
struct rank sum_ranks(struct rank a, struct rank b)
static struct type * resolve_dynamic_range(struct type *dyn_range_type, struct property_addr_info *addr_stack, const frame_info_ptr &frame, int rank, bool resolve_p=true)
bool can_create_complex_type(struct type *target_type)
static int array_type_has_dynamic_stride(struct type *type)
struct type * make_function_type(struct type *type, struct type **typeptr)
const struct floatformat * floatformats_vax_f[BFD_ENDIAN_UNKNOWN]
int can_dereference(struct type *t)
@ TYPE_SPECIFIC_FLOATFORMAT
@ TYPE_SPECIFIC_FIXED_POINT
@ TYPE_SPECIFIC_GNAT_STUFF
@ TYPE_SPECIFIC_SELF_TYPE
@ TYPE_SPECIFIC_CPLUS_STUFF
#define TYPE_ZALLOC(t, size)
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n)
#define TYPE_NFN_FIELDS(thistype)
#define TYPE_ASSOCIATED_PROP(thistype)
struct type * check_typedef(struct type *)
#define TYPE_ALLOCATED_PROP(thistype)
#define TYPE_VPTR_BASETYPE(thistype)
#define TYPE_DESCRIPTIVE_TYPE(thistype)
#define TYPE_FN_FIELD_ARGS(thisfn, n)
#define TYPE_CPLUS_SPECIFIC(thistype)
#define TYPE_RAW_CPLUS_SPECIFIC(thistype)
#define INIT_FIXED_POINT_SPECIFIC(type)
#define TYPE_GNAT_SPECIFIC(thistype)
#define TYPE_CHAIN(thistype)
#define TYPE_DATA_LOCATION(thistype)
#define TYPE_IS_REFERENCE(t)
#define TYPE_FIELD_VIRTUAL_BITS(thistype)
#define ALLOCATE_CPLUS_STRUCT_TYPE(type)
#define TYPE_FN_FIELD_VOFFSET(thisfn, n)
#define TYPE_FIELD_PRIVATE_BITS(thistype)
@ FIELD_LOC_KIND_PHYSNAME
@ FIELD_LOC_KIND_PHYSADDR
@ FIELD_LOC_KIND_DWARF_BLOCK
#define TYPE_FN_FIELDLIST1(thistype, n)
#define TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL
#define TYPE_DATA_LOCATION_KIND(thistype)
#define TYPE_MAIN_TYPE(thistype)
#define TYPE_ADDRESS_CLASS_ALL(t)
@ TYPE_INSTANCE_FLAG_CODE_SPACE
@ TYPE_INSTANCE_FLAG_CONST
@ TYPE_INSTANCE_FLAG_VOLATILE
@ TYPE_INSTANCE_FLAG_ATOMIC
@ TYPE_INSTANCE_FLAG_DATA_SPACE
@ TYPE_INSTANCE_FLAG_RESTRICT
@ TYPE_INSTANCE_FLAG_NOTTEXT
#define CV_CONVERSION_VOLATILE
#define TYPE_FN_FIELDLISTS(thistype)
#define TYPE_IS_OPAQUE(thistype)
#define TYPE_DATA_SPACE(t)
#define TYPE_HAS_DYNAMIC_LENGTH(t)
#define TYPE_ADDRESS_CLASS_1(t)
#define TYPE_SELF_TYPE(thistype)
#define TYPE_FN_FIELD_STUB(thisfn, n)
#define INIT_FUNC_SPECIFIC(type)
#define TYPE_FN_FIELD_TYPE(thisfn, n)
#define TYPE_FLOATFORMAT(thistype)
#define TYPE_FN_FIELD_VOLATILE(thisfn, n)
#define REFERENCE_CONVERSION_RVALUE
#define TYPE_BASECLASS(thistype, index)
#define TYPE_CALLING_CONVENTION(thistype)
#define REFERENCE_CONVERSION_CONST_LVALUE
char * gdb_mangle_name(struct type *, int, int)
#define CV_CONVERSION_CONST
#define TYPE_POINTER_TYPE(thistype)
#define TYPE_FN_FIELDLIST_LENGTH(thistype, n)
#define TYPE_FN_FIELD_PROTECTED(thisfn, n)
#define TYPE_FN_FIELD_PRIVATE(thisfn, n)
#define HAVE_CPLUS_STRUCT(type)
#define TYPE_VPTR_FIELDNO(thistype)
#define TYPE_TAIL_CALL_LIST(thistype)
#define TYPE_DYNAMIC_LENGTH(thistype)
#define TYPE_SPECIFIC_FIELD(thistype)
#define TYPE_ADDRESS_CLASS_2(t)
#define TYPE_NO_RETURN(thistype)
#define TYPE_FN_FIELD_STATIC_P(thisfn, n)
#define INIT_GNAT_SPECIFIC(type)
#define TYPE_RVALUE_REFERENCE_TYPE(thistype)
#define INIT_CPLUS_SPECIFIC(type)
#define TYPE_CPLUS_CALLING_CONVENTION(thistype)
#define TYPE_RANK_PROP(thistype)
#define TYPE_FN_FIELD_DEFAULTED(thisfn, n)
#define TYPE_FN_FIELD_DELETED(thisfn, n)
#define BASETYPE_VIA_VIRTUAL(thistype, index)
#define TYPE_REFERENCE_TYPE(thistype)
#define TYPE_FN_FIELDLIST_NAME(thistype, n)
#define TYPE_FIELD_PROTECTED_BITS(thistype)
#define BASETYPE_VIA_PUBLIC(thistype, index)
#define TYPE_ALLOC(t, size)
#define TYPE_CODE_SPACE(t)
#define TYPE_N_BASECLASSES(thistype)
std::vector< rank > badness_vector
#define TYPE_FN_FIELD_CONST(thisfn, n)
#define TYPE_FN_FIELD_FCONTEXT(thisfn, n)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
const struct language_defn * language_def(enum language lang)
const struct language_defn * current_language
bool dwarf2_evaluate_property(const struct dynamic_prop *prop, frame_info_ptr frame, const struct property_addr_info *addr_stack, CORE_ADDR *value, gdb::array_view< CORE_ADDR > push_values)
static struct type * new_type(char *)
const char * objfile_name(const struct objfile *objfile)
#define OBJSTAT(objfile, expr)
struct type * builtin_signed_char
struct type * builtin_declong
struct type * builtin_long_long
struct type * builtin_int0
struct type * nodebug_text_gnu_ifunc_symbol
struct type * internal_fn
struct type * builtin_uint16
struct type * builtin_error
struct type * builtin_int24
struct type * builtin_double
struct type * builtin_string
struct type * builtin_int8
struct type * builtin_func_ptr
struct type * builtin_core_addr
struct type * builtin_uint128
struct type * builtin_long
struct type * builtin_data_ptr
struct type * builtin_bool
struct type * builtin_true_unsigned_char
struct type * builtin_unsigned_char
struct type * nodebug_tls_symbol
struct type * builtin_complex
struct type * builtin_long_double
struct type * builtin_unsigned_long_long
struct type * builtin_uint32
struct type * builtin_uint64
struct type * builtin_char16
struct type * builtin_short
struct type * builtin_double_complex
struct type * builtin_int64
struct type * builtin_uint24
struct type * builtin_char
struct type * builtin_int
struct type * builtin_decfloat
struct type * builtin_int32
struct type * builtin_unsigned_short
struct type * builtin_wchar
struct type * builtin_unsigned_int
struct type * builtin_decdouble
struct type * builtin_char32
struct type * builtin_uint8
struct type * nodebug_got_plt_symbol
struct type * builtin_half
struct type * builtin_bfloat16
struct type * builtin_int128
struct type * builtin_unsigned_long
struct type * builtin_int16
struct type * builtin_void
struct type * builtin_float
struct type * nodebug_data_symbol
struct type * builtin_func_func
struct type * nodebug_unknown_symbol
struct type * builtin_true_char
struct type * nodebug_text_symbol
const unrelocated_addr m_unrelocated_pc
dwarf2_per_objfile *const per_objfile
struct dwarf2_per_cu_data * per_cu
CORE_ADDR relocate(unrelocated_addr addr)
struct dwarf2_locexpr_baton locexpr
struct type * property_type
struct dynamic_prop_list * next
enum dynamic_prop_node_kind prop_kind
const dwarf2_property_baton * baton() const
LONGEST const_val() const
dynamic_prop_kind kind() const
void set_original_type(struct type *original_type)
struct type * original_type() const
const gdb::array_view< variant_part > * variant_parts() const
void set_locexpr(const dwarf2_property_baton *baton)
void set_const_val(LONGEST const_val)
void set_type(struct type *type)
void set_loc_bitpos(LONGEST bitpos)
CORE_ADDR loc_physaddr() const
LONGEST loc_bitpos() const
void set_loc_physaddr(CORE_ADDR physaddr)
void set_is_artificial(bool is_artificial)
const char * loc_physname() const
void set_loc_dwarf_block(dwarf2_locexpr_baton *dwarf_block)
void set_loc_physname(const char *physname)
bool is_artificial() const
void set_bitsize(unsigned int bitsize)
field_loc_kind loc_kind() const
LONGEST loc_enumval() const
dwarf2_locexpr_baton * loc_dwarf_block() const
void set_loc_enumval(LONGEST enumval)
void set_name(const char *name)
const char * name() const
unsigned int bitsize() const
struct type * type() const
const void * insert(const void *addr, int length, bool *added=nullptr)
virtual bool is_string_type_p(struct type *type) const
enum language la_language
virtual bool is_array_like(struct type *type) const
union main_type::@67 flds_bnds
struct dynamic_prop_list * dyn_prop_list
struct gdbarch * arch() const
objfile(gdb_bfd_ref_ptr, const char *, objfile_flags)
auto_obstack objfile_obstack
gdb::array_view< const gdb_byte > valaddr
struct property_addr_info * next
struct dynamic_prop stride
unsigned int flag_upper_bound_is_count
unsigned int flag_is_byte_stride
unsigned int flag_bound_evaluated
address_class aclass() const
struct type * type() const
type_equality_entry(struct type *t1, struct type *t2)
struct type *const *const newobj
type_pair(struct type *old_, struct type *newobj_)
struct type * target_type() const
dynamic_prop * dyn_prop(dynamic_prop_node_kind kind) const
void set_is_prototyped(bool is_prototyped)
void copy_fields(struct type *src)
void set_code(type_code code)
void remove_dyn_prop(dynamic_prop_node_kind kind)
bool is_fixed_instance() const
void set_endianity_is_not_default(bool endianity_is_not_default)
struct field & field(int idx) const
void set_has_no_signedness(bool has_no_signedness)
void set_instance_flags(type_instance_flags flags)
void set_index_type(type *index_type)
void set_target_type(struct type *target_type)
struct main_type * main_type
void set_is_unsigned(bool is_unsigned)
void set_is_stub(bool is_stub)
gdbarch * arch_owner() const
void set_has_varargs(bool has_varargs)
void set_owner(objfile *objfile)
bool target_is_stub() const
bool endianity_is_not_default() const
void set_fixed_point_info(struct fixed_point_type_info *info) const
void set_bounds(range_bounds *bounds)
bool is_declared_class() const
bool has_no_signedness() const
struct objfile * objfile_owner() const
void add_dyn_prop(dynamic_prop_node_kind kind, dynamic_prop prop)
void set_num_fields(unsigned int num_fields)
unsigned int num_fields() const
void set_name(const char *name)
void set_is_vector(bool is_vector)
bool stub_is_supported() const
struct fixed_point_type_info & fixed_point_info() const
void set_is_gnu_ifunc(bool is_gnu_ifunc)
void alloc_fields(unsigned int nfields, bool init=true)
bool bit_size_differs_p() const
ULONGEST bit_stride() const
void set_length(ULONGEST length)
bool is_multi_dimensional() const
const gdb_mpq & fixed_point_scaling_factor()
struct field * fields() const
range_bounds * bounds() const
const char * name() const
type * index_type() const
struct type * fixed_point_type_base_type()
bool is_prototyped() const
const type_instance_flags instance_flags() const
unsigned short bit_offset() const
void set_fields(struct field *fields)
void set_target_is_stub(bool target_is_stub)
bool is_objfile_owned() const
unsigned short bit_size() const
LONGEST embedded_offset() const
struct type * type() const
enum lval_type lval() const
gdb::array_view< const gdb_byte > contents_for_printing()
gdb::array_view< variant > variants
bool matches(ULONGEST value, bool is_unsigned) const
gdb::array_view< variant_part > parts
gdb::array_view< discriminant_range > discriminants
int currently_reading_symtab
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
struct type * lookup_transparent_type(const char *name)
struct block_symbol lookup_symbol_in_language(const char *name, const struct block *block, const domain_enum domain, enum language lang, struct field_of_this_result *is_a_field_of_this)
std::string type_to_string(struct type *type)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
int strcmp_iw(const char *string1, const char *string2)
LONGEST value_as_long(struct value *val)
LONGEST unpack_bits_as_long(struct type *field_type, const gdb_byte *valaddr, LONGEST bitpos, LONGEST bitsize)
LONGEST unpack_field_as_long(struct type *type, const gdb_byte *valaddr, int fieldno)