42#include "floatformat.h"
48#define INVALID_CONVERSION 100
80 &floatformat_ieee_half_big,
81 &floatformat_ieee_half_little
84 &floatformat_ieee_single_big,
85 &floatformat_ieee_single_little
88 &floatformat_ieee_double_big,
89 &floatformat_ieee_double_little
92 &floatformat_ieee_quad_big,
93 &floatformat_ieee_quad_little
96 &floatformat_ieee_double_big,
97 &floatformat_ieee_double_littlebyte_bigword
100 &floatformat_i387_ext,
101 &floatformat_i387_ext
104 &floatformat_m68881_ext,
105 &floatformat_m68881_ext
108 &floatformat_arm_ext_big,
109 &floatformat_arm_ext_littlebyte_bigword
112 &floatformat_ia64_spill_big,
113 &floatformat_ia64_spill_little
124 &floatformat_ibm_long_double_big,
125 &floatformat_ibm_long_double_little
128 &floatformat_bfloat16_big,
129 &floatformat_bfloat16_little
151 gdb_printf (file, _(
"Resolution of opaque struct/class/union types "
152 "(if set before loading symbols) is %s.\n"),
162 gdb_printf (file, _(
"Debugging of C++ overloading is %s.\n"),
258 gdb_assert (
arch !=
nullptr);
353 else if (*typeptr == 0)
360 if (typeptr == 0 || *typeptr == 0)
389 while (
chain != ntype)
418 struct type **reftype;
421 gdb_assert (refcode == TYPE_CODE_REF || refcode == TYPE_CODE_RVALUE_REF);
431 else if (*typeptr == 0)
438 if (typeptr == 0 || *typeptr == 0)
469 while (
chain != ntype)
513 if (typeptr == 0 || *typeptr == 0)
551 struct type **param_types)
558 if (param_types[nparams - 1] == NULL)
568 gdb_assert (nparams == 0);
578 for (i = 0; i < nparams; ++i)
589 const char *space_identifier)
591 type_instance_flags type_flags;
594 if (!strcmp (space_identifier,
"code"))
596 else if (!strcmp (space_identifier,
"data"))
604 error (_(
"Unknown address space specifier: \"%s\""), space_identifier);
612 type_instance_flags space_flag)
632 struct type *storage)
643 while (ntype !=
type);
690 type_instance_flags space_flag)
716 struct type **typeptr)
730 if (typeptr && *typeptr != NULL)
748 typeptr ? *typeptr : NULL);
830 while (ntype !=
chain);
908 gdb_assert_not_reached (
"unhandled dynamic_prop kind");
916#define FIELD_EQ(FIELD) (l.FIELD == r.FIELD)
920 &&
FIELD_EQ (flag_upper_bound_is_count)
941 if (result_type == NULL)
943 result_type->
set_code (TYPE_CODE_RANGE);
952 bounds->
low = *low_bound;
953 bounds->
high = *high_bound;
959 if (index_type->
code () == TYPE_CODE_FIXED_POINT)
1005 gdb_assert (stride !=
nullptr);
1026 LONGEST low_bound, LONGEST high_bound)
1053gdb::optional<LONGEST>
1059 case TYPE_CODE_RANGE:
1069 gdb::optional<LONGEST> low_pos
1072 if (low_pos.has_value ())
1079 case TYPE_CODE_ENUM:
1103 case TYPE_CODE_BOOL:
1111 return -(1 << (
type->
length () * TARGET_CHAR_BIT - 1));
1114 case TYPE_CODE_CHAR:
1124gdb::optional<LONGEST>
1130 case TYPE_CODE_RANGE:
1140 gdb::optional<LONGEST> high_pos
1143 if (high_pos.has_value ())
1150 case TYPE_CODE_ENUM:
1170 case TYPE_CODE_BOOL:
1179 LONGEST low = -(1 << (
type->
length () * TARGET_CHAR_BIT - 1));
1184 case TYPE_CODE_CHAR:
1189 LONGEST high = 1 << (
type->
length () * TARGET_CHAR_BIT - 1);
1190 return (high - 1) | high;
1204 if (!low.has_value ())
1208 if (!high.has_value ())
1255gdb::optional<LONGEST>
1258 if (
type->
code () == TYPE_CODE_RANGE)
1261 if (
type->
code () == TYPE_CODE_ENUM)
1285 gdb_assert (
type->
code () == TYPE_CODE_ARRAY);
1294 LONGEST low_bound, high_bound;
1296 struct type *element_type;
1301 low_bound = high_bound = 0;
1307 if (high_bound < low_bound)
1309 else if (stride != 0)
1317 LONGEST element_count = std::abs (high_bound - low_bound + 1);
1318 type->
set_length (((std::abs (stride) * element_count) + 7) / 8);
1322 * (high_bound - low_bound + 1));
1329 if (element_type->
code () == TYPE_CODE_ARRAY
1331 && element_type->
length () != 0
1334 && high_bound >= low_bound)
1336 = ((high_bound - low_bound + 1)
1369 struct type *element_type,
1370 struct type *range_type,
1374 if (byte_stride_prop != NULL
1382 byte_stride_prop = NULL;
1385 if (result_type == NULL)
1388 result_type->
set_code (TYPE_CODE_ARRAY);
1395 if (byte_stride_prop != NULL)
1412 if (result_type->
length () == 0)
1423 struct type *element_type,
1424 struct type *range_type)
1427 range_type, NULL, 0);
1432 LONGEST low_bound, LONGEST high_bound)
1435 struct type *range_type;
1443 low_bound, high_bound);
1462 struct type *string_char_type,
1463 struct type *range_type)
1468 result_type->
set_code (TYPE_CODE_STRING);
1474 LONGEST low_bound, LONGEST high_bound)
1476 struct type *result_type;
1479 low_bound, high_bound);
1480 result_type->
set_code (TYPE_CODE_STRING);
1487 if (result_type == NULL)
1490 result_type->
set_code (TYPE_CODE_SET);
1497 LONGEST low_bound, high_bound, bit_length;
1500 low_bound = high_bound = 0;
1502 bit_length = high_bound - low_bound + 1;
1503 result_type->
set_length ((bit_length + TARGET_CHAR_BIT - 1)
1519 struct type *inner_array, *elt_type;
1523 inner_array = array_type;
1528 if (elt_type->
code () == TYPE_CODE_INT)
1530 type_instance_flags
flags
1542 struct type *array_type;
1560 case TYPE_CODE_METHODPTR:
1561 case TYPE_CODE_MEMBERPTR:
1566 case TYPE_CODE_METHOD:
1572 gdb_assert_not_reached (
"bad type");
1586 case TYPE_CODE_METHODPTR:
1587 case TYPE_CODE_MEMBERPTR:
1593 case TYPE_CODE_METHOD:
1600 gdb_assert_not_reached (
"bad type");
1617 struct type *to_type)
1653 struct type *to_type,
struct field *args,
1654 int nargs,
int varargs)
1692 error (_(
"Invalid anonymous type %s [in module %s], GCC PR debug/47510 bug?"),
1711 return sym->
type ();
1715 error (_(
"No type named %s."),
name);
1722 char *uns = (
char *) alloca (strlen (
name) + 10);
1724 strcpy (uns,
"unsigned ");
1725 strcpy (uns + 9,
name);
1733 if (streq (
name,
"char"))
1734 name =
"signed char";
1750 error (_(
"No struct type named %s."),
name);
1752 if (sym->
type ()->
code () != TYPE_CODE_STRUCT)
1754 error (_(
"This context has class, union or enum %s, not a struct."),
1757 return (sym->
type ());
1772 error (_(
"No union type named %s."),
name);
1776 if (t->
code () == TYPE_CODE_UNION)
1780 error (_(
"This context has class, struct or enum %s, not a union."),
1795 error (_(
"No enum type named %s."),
name);
1797 if (sym->
type ()->
code () != TYPE_CODE_ENUM)
1799 error (_(
"This context has class, struct or union %s, not an enum."),
1802 return (sym->
type ());
1813 char *nam = (
char *)
1825 error (_(
"No template type named %s."),
name);
1827 if (sym->
type ()->
code () != TYPE_CODE_STRUCT)
1829 error (_(
"This context has class, union or enum %s, not a struct."),
1832 return (sym->
type ());
1851 if (
type->
code () != TYPE_CODE_STRUCT
1852 &&
type->
code () != TYPE_CODE_UNION)
1855 error (_(
"Type %s is not a structure or union type."),
1856 type_name.c_str ());
1867 else if (!t_field_name || *t_field_name ==
'\0')
1871 if (elt.
field != NULL)
1883 if (elt.
field != NULL)
1888 return {
nullptr, 0};
1891 error (_(
"Type %s has no component named %s."), type_name.c_str (),
name);
1900 if (elt.
field != NULL)
1915 gdb_assert (
type->
length () <= sizeof (ULONGEST));
1919 return ((((ULONGEST) 1 << (n - 1)) - 1) << 1) | 1;
1932 gdb_assert (
type->
length () <= sizeof (LONGEST));
1935 *min = -((ULONGEST) 1 << (n - 1));
1936 *max = ((ULONGEST) 1 << (n - 1)) - 1;
1947 gdb_assert (
type->
code () == TYPE_CODE_PTR);
1948 gdb_assert (
type->
length () <= sizeof (CORE_ADDR));
1951 return ((((CORE_ADDR) 1 << (n - 1)) - 1) << 1) | 1;
1965 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1966 ||
type->
code () == TYPE_CODE_UNION);
1978 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1979 ||
type->
code () == TYPE_CODE_UNION);
1992 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
1993 ||
type->
code () == TYPE_CODE_UNION);
2004 gdb_assert (
type->
code () == TYPE_CODE_STRUCT
2005 ||
type->
code () == TYPE_CODE_UNION);
2038 struct type *basetype;
2051 *basetypep = basetype;
2070 complaint (_(
"stub type has NULL name"));
2092 if (top_level &&
type->
code () == TYPE_CODE_REF)
2121 case TYPE_CODE_RANGE:
2132 case TYPE_CODE_STRING:
2135 case TYPE_CODE_ARRAY:
2151 case TYPE_CODE_STRUCT:
2152 case TYPE_CODE_UNION:
2214 int rank,
bool resolve_p =
true)
2217 struct type *static_range_type, *static_target_type;
2220 gdb_assert (dyn_range_type->
code () == TYPE_CODE_RANGE);
2221 gdb_assert (
rank >= 0);
2225 { (CORE_ADDR)
rank }))
2232 { (CORE_ADDR)
rank }))
2246 { (CORE_ADDR)
rank }))
2256 if (!byte_stride_p && (
value % (unit_size * 8)) != 0)
2257 error (_(
"bit strides that are not a multiple of the byte size "
2258 "are currently not supported"));
2263 byte_stride_p =
true;
2269 LONGEST bias = dyn_range_type->
bounds ()->
bias;
2271 (
copy_type (dyn_range_type), static_target_type,
2272 &low_bound, &high_bound, bias, &stride, byte_stride_p);
2274 return static_range_type;
2299 int rank,
bool resolve_p)
2302 struct type *elt_type;
2303 struct type *range_type;
2304 struct type *ary_dim;
2306 unsigned int bit_stride = 0;
2310 gdb_assert (
type->
code () == TYPE_CODE_ARRAY
2311 ||
type->
code () == TYPE_CODE_STRING);
2315 gdb_assert (
rank >= 0);
2327 if (prop != NULL && resolve_p
2336 if (prop != NULL && resolve_p
2349 if (ary_dim != NULL && ary_dim->
code () == TYPE_CODE_ARRAY)
2353 rank - 1, resolve_p);
2359 if (prop != NULL && resolve_p)
2364 bit_stride = (
unsigned int) (
value * 8);
2371 warning (_(
"cannot determine array stride for type %s"),
2395 gdb_assert (
type->
code () == TYPE_CODE_ARRAY
2396 ||
type->
code () == TYPE_CODE_STRING);
2416 if (prop_list !=
nullptr)
2418 struct obstack *obstack
2425 else if (
type->
code () == TYPE_CODE_STRING &&
rank != 1)
2429 error (_(
"unable to handle string with dynamic rank greater than 1"));
2444 for (
int i = 1; i <
rank; i++)
2457 tmp_type->
code () == TYPE_CODE_ARRAY;
2481 struct type *resolved_type;
2483 unsigned int max_len = 0;
2485 gdb_assert (
type->
code () == TYPE_CODE_UNION);
2492 memcpy (resolved_type->
fields (),
2495 for (i = 0; i < resolved_type->
num_fields (); ++i)
2507 if (real_type->
length () > max_len)
2508 max_len = real_type->
length ();
2512 return resolved_type;
2530 std::vector<bool> &
flags);
2545 std::vector<bool> &
flags,
2557 for (
const auto &sub_variant : new_part.
variants)
2577 std::vector<bool> &
flags)
2580 gdb::optional<ULONGEST> discr_value;
2586 error (_(
"Cannot determine struct field location"
2587 " (invalid location kind)"));
2589 if (addr_stack->
valaddr.data () != NULL)
2594 CORE_ADDR addr = (addr_stack->
addr
2596 / TARGET_CHAR_BIT));
2599 LONGEST
size = bitsize / 8;
2603 gdb_byte
bits[
sizeof (ULONGEST)];
2610 bits, bitpos, bitsize);
2615 const variant *default_variant =
nullptr;
2616 const variant *applied_variant =
nullptr;
2621 else if (discr_value.has_value ()
2628 if (applied_variant ==
nullptr)
2629 applied_variant = default_variant;
2643 struct type *resolved_type,
2645 const gdb::array_view<variant_part> &parts)
2651 for (
const auto &part : parts)
2655 (std::count (
flags.begin (),
flags.end (),
true));
2680 struct type *resolved_type;
2682 unsigned resolved_type_bit_length = 0;
2684 gdb_assert (
type->
code () == TYPE_CODE_STRUCT);
2704 memcpy (resolved_type->
fields (),
2709 for (i = 0; i < resolved_type->
num_fields (); ++i)
2711 unsigned new_bit_length;
2729 {addr_stack->
addr}))
2731 (TARGET_CHAR_BIT * (addr - addr_stack->
addr));
2742 error (_(
"Cannot determine struct field location"
2743 " (invalid location kind)"));
2746 size_t offset = resolved_type->
field (i).
loc_bitpos () / TARGET_CHAR_BIT;
2750 pinfo.
addr = addr_stack->
addr + offset;
2751 pinfo.
next = addr_stack;
2764 struct type *real_type
2767 new_bit_length += (real_type->
length () * TARGET_CHAR_BIT);
2776 if (new_bit_length > resolved_type_bit_length)
2777 resolved_type_bit_length = new_bit_length;
2785 resolved_type->
set_length ((resolved_type_bit_length + TARGET_CHAR_BIT - 1)
2792 return resolved_type;
2803 struct type *resolved_type =
nullptr;
2810 gdb::optional<CORE_ADDR> type_length;
2814 type_length =
value;
2816 if (
type->
code () == TYPE_CODE_TYPEDEF)
2836 if (addr_stack->
valaddr.data () != NULL)
2841 pinfo.
next = addr_stack;
2846 &pinfo, top_level));
2850 case TYPE_CODE_STRING:
2853 case TYPE_CODE_ARRAY:
2857 case TYPE_CODE_RANGE:
2866 case TYPE_CODE_UNION:
2870 case TYPE_CODE_STRUCT:
2876 if (resolved_type ==
nullptr)
2879 if (type_length.has_value ())
2893 && resolved_type->
code () == TYPE_CODE_ARRAY)
2900 return resolved_type;
2907 gdb::array_view<const gdb_byte> valaddr,
2923 while (node != NULL)
2960 while (NULL != curr_node)
2968 if (NULL == prev_node)
2976 prev_node = curr_node;
2977 curr_node = curr_node->
next;
3020 while (
type->
code () == TYPE_CODE_TYPEDEF)
3060 const type_instance_flags ALL_SPACES
3063 const type_instance_flags ALL_CLASSES
3069 if ((instance_flags & ALL_SPACES) != 0)
3070 new_instance_flags &= ~ALL_SPACES;
3071 if ((instance_flags & ALL_CLASSES) != 0)
3072 new_instance_flags &= ~ALL_CLASSES;
3074 instance_flags |= new_instance_flags;
3089 struct type *newtype;
3152 else if (
type->
code () == TYPE_CODE_RANGE)
3157 else if (
type->
code () == TYPE_CODE_ARRAY
3179 scoped_restore saved_gdb_stderr = make_scoped_restore (&
gdb_stderr,
3187 catch (
const gdb_exception_error &except)
3211 gdb::unique_xmalloc_ptr<char> demangled_name
3212 =
gdb_demangle (mangled_name, DMGL_PARAMS | DMGL_ANSI);
3213 char *argtypetext, *p;
3214 int depth = 0, argcount = 1;
3215 struct field *argtypes;
3220 p = strchr (demangled_name.get (),
'(');
3224 if (demangled_name == NULL || p == NULL)
3225 error (_(
"Internal: Cannot demangle mangled name `%s'."),
3233 if (*p ==
'(' || *p ==
'<')
3237 else if (*p ==
')' || *p ==
'>')
3241 else if (*p ==
',' && depth == 0)
3250 if (startswith (argtypetext,
"(void)"))
3255 argtypes = (
struct field *)
3274 if (depth <= 0 && (*p ==
',' || *p ==
')'))
3278 if (strncmp (argtypetext,
"...", p - argtypetext) != 0
3279 && strncmp (argtypetext,
"void", p - argtypetext) != 0)
3281 argtypes[argcount].set_type
3285 argtypetext = p + 1;
3288 if (*p ==
'(' || *p ==
'<')
3292 else if (*p ==
')' || *p ==
'>')
3308 argtypes, argcount, p[-2] ==
'.');
3327 for (
int j = 0; j < len; j++)
3377 case TYPE_CODE_STRUCT:
3378 case TYPE_CODE_UNION:
3379 case TYPE_CODE_NAMESPACE:
3385 case TYPE_CODE_FUNC:
3388 case TYPE_CODE_FIXED_POINT:
3401 gdb_assert (floatformat != NULL);
3404 bit = floatformat->totalsize;
3406 gdb_assert (
bit >= 0);
3407 gdb_assert (
bit >= floatformat->totalsize);
3415const struct floatformat *
3418 gdb_assert (
type->
code () == TYPE_CODE_FLT);
3437 gdb_assert ((
bit % TARGET_CHAR_BIT) == 0);
3460 int bit,
int unsigned_p,
const char *
name)
3481 int bit,
int unsigned_p,
const char *
name)
3498 int bit,
int unsigned_p,
const char *
name)
3523 const struct floatformat **floatformats,
3524 enum bfd_endian byte_order)
3526 if (byte_order == BFD_ENDIAN_UNKNOWN)
3531 const struct floatformat *fmt = floatformats[byte_order];
3579 + strlen (
"_Complex ") + 1);
3580 strcpy (new_name,
"_Complex ");
3621 int bit,
int unsigned_p,
const char *
name)
3660 case TYPE_CODE_FUNC:
3661 case TYPE_CODE_FLAGS:
3663 case TYPE_CODE_RANGE:
3665 case TYPE_CODE_ENUM:
3667 case TYPE_CODE_RVALUE_REF:
3668 case TYPE_CODE_CHAR:
3669 case TYPE_CODE_BOOL:
3670 case TYPE_CODE_DECFLOAT:
3671 case TYPE_CODE_METHODPTR:
3672 case TYPE_CODE_MEMBERPTR:
3676 case TYPE_CODE_ARRAY:
3677 case TYPE_CODE_COMPLEX:
3678 case TYPE_CODE_TYPEDEF:
3682 case TYPE_CODE_STRUCT:
3683 case TYPE_CODE_UNION:
3685 int number_of_non_static_fields = 0;
3690 number_of_non_static_fields++;
3698 if (f_align > align)
3704 if (number_of_non_static_fields == 0)
3710 case TYPE_CODE_STRING:
3715 case TYPE_CODE_VOID:
3719 case TYPE_CODE_ERROR:
3720 case TYPE_CODE_METHOD:
3725 if ((align & (align - 1)) != 0)
3740 gdb_assert ((align & (align - 1)) == 0);
3742 unsigned result = 0;
3767 && t->
code () == TYPE_CODE_PTR
3778 && ((t->
code () == TYPE_CODE_INT)
3779 || (t->
code () == TYPE_CODE_ENUM)
3780 || (t->
code () == TYPE_CODE_FLAGS)
3781 || (t->
code () == TYPE_CODE_CHAR)
3782 || (t->
code () == TYPE_CODE_RANGE)
3783 || (t->
code () == TYPE_CODE_BOOL)));
3792 && ((t->
code () == TYPE_CODE_FLT)
3793 || (t->
code () == TYPE_CODE_DECFLOAT)));
3808 case TYPE_CODE_ARRAY:
3809 case TYPE_CODE_STRUCT:
3810 case TYPE_CODE_UNION:
3812 case TYPE_CODE_STRING:
3831 else if ((t->
code () == TYPE_CODE_ARRAY
3835 LONGEST low_bound, high_bound;
3839 return (high_bound == low_bound
3845 else if (t->
code () == TYPE_CODE_STRUCT && t->
num_fields () == 1)
3847 else if (t->
code () == TYPE_CODE_UNION)
3852 for (i = 0; i < n; i++)
3867 return (t->
code () == TYPE_CODE_STRUCT
3868 || t->
code () == TYPE_CODE_UNION);
3880 && !strcmp (a->
name (), b->
name ())));
3955 const gdb_byte *valaddr,
int embedded_offset,
3956 CORE_ADDR address,
struct value *val)
3981 *offset = this_offset;
3984 else if (this_offset == *offset)
3994 embedded_offset + this_offset,
4023 if (byteorder == BFD_ENDIAN_BIG)
4024 return BFD_ENDIAN_LITTLE;
4027 gdb_assert (byteorder == BFD_ENDIAN_LITTLE);
4028 return BFD_ENDIAN_BIG;
4055 c.
rank = a.rank + b.rank;
4056 c.
subrank = a.subrank + b.subrank;
4099 bool found_pos =
false;
4101 bool found_neg =
false;
4103 bool a_invalid =
false;
4105 bool b_invalid =
false;
4108 if (a.size () != b.size ())
4112 for (i = 0; i < a.size (); i++)
4130 if (a_invalid != b_invalid)
4159 gdb::array_view<value *> args)
4163 bv.reserve (1 + args.size ());
4172 bv.push_back ((args.size () != parms.size ())
4177 size_t min_len = std::min (parms.size (), args.size ());
4179 for (
size_t i = 0; i < min_len; i++)
4184 for (
size_t i = min_len; i < args.size (); i++)
4197 int first_p, second_p;
4201 first_p = (strstr (first,
"short") != NULL);
4202 second_p = (strstr (second,
"short") != NULL);
4203 if (first_p && second_p)
4205 if (first_p || second_p)
4209 first_p = (strstr (first,
"long") != NULL);
4210 second_p = (strstr (second,
"long") != NULL);
4211 if (first_p && second_p)
4213 if (first_p || second_p)
4217 first_p = (strstr (first,
"char") != NULL);
4218 second_p = (strstr (second,
"char") != NULL);
4219 if (first_p && second_p)
4221 if (first_p || second_p)
4242 if (a->
code () == TYPE_CODE_TYPEDEF)
4244 if (b->
code () == TYPE_CODE_TYPEDEF)
4259 if (a->
code () == TYPE_CODE_PTR
4260 || a->
code () == TYPE_CODE_REF)
4270 && strcmp (a->
name (), b->
name ()) == 0)
4275 if (a->
code () == TYPE_CODE_FUNC)
4316 if (s == NULL || t == NULL)
4318 return strcmp (s, t) == 0;
4327 std::vector<type_equality_entry> *worklist)
4335 if (type1->
code () != type2->
code ()
4352 if (type1->
code () == TYPE_CODE_RANGE)
4363 const struct field *field1 = &type1->
field (i);
4364 const struct field *field2 = &type2->
field (i);
4401 || memcmp (block1->
data, block2->
data, block1->
size) != 0)
4406 internal_error (_(
"Unsupported field kind "
4407 "%d by check_types_equal"),
4411 worklist->emplace_back (field1->
type (), field2->
type ());
4436 while (!worklist->empty ())
4441 worklist->pop_back ();
4445 cache->
insert (&entry,
sizeof (entry), &added);
4462 std::vector<type_equality_entry> worklist;
4506 switch (arg->
code ())
4512 if (parm->target_type ()->code () == TYPE_CODE_VOID)
4523 case TYPE_CODE_ARRAY:
4525 struct type *t1 = parm->target_type ();
4541 case TYPE_CODE_FUNC:
4560 case TYPE_CODE_ENUM:
4561 case TYPE_CODE_FLAGS:
4562 case TYPE_CODE_CHAR:
4563 case TYPE_CODE_RANGE:
4564 case TYPE_CODE_BOOL:
4575 switch (arg->
code ())
4578 case TYPE_CODE_ARRAY:
4591 switch (arg->
code ())
4605 switch (arg->
code ())
4608 if (arg->
length () == parm->length ())
4612 if (parm->has_no_signedness ())
4620 else if (parm->is_unsigned ())
4668 else if (arg->
length () < parm->length ())
4672 case TYPE_CODE_ENUM:
4673 case TYPE_CODE_FLAGS:
4674 case TYPE_CODE_CHAR:
4675 case TYPE_CODE_RANGE:
4676 case TYPE_CODE_BOOL:
4694 switch (arg->
code ())
4697 case TYPE_CODE_CHAR:
4698 case TYPE_CODE_RANGE:
4699 case TYPE_CODE_BOOL:
4700 case TYPE_CODE_ENUM:
4716 switch (arg->
code ())
4718 case TYPE_CODE_RANGE:
4719 case TYPE_CODE_BOOL:
4720 case TYPE_CODE_ENUM:
4727 if (arg->
length () > parm->length ())
4729 else if (arg->
length () < parm->length ())
4732 case TYPE_CODE_CHAR:
4735 if (parm->has_no_signedness ())
4742 else if (parm->is_unsigned ())
4763 switch (arg->
code ())
4766 case TYPE_CODE_CHAR:
4767 case TYPE_CODE_RANGE:
4768 case TYPE_CODE_BOOL:
4769 case TYPE_CODE_ENUM:
4783 switch (arg->
code ())
4794 case TYPE_CODE_CHAR:
4795 case TYPE_CODE_ENUM:
4797 case TYPE_CODE_MEMBERPTR:
4800 case TYPE_CODE_RANGE:
4802 case TYPE_CODE_BOOL:
4814 switch (arg->
code ())
4817 if (arg->
length () < parm->length ())
4819 else if (arg->
length () == parm->length ())
4824 case TYPE_CODE_BOOL:
4825 case TYPE_CODE_ENUM:
4826 case TYPE_CODE_RANGE:
4827 case TYPE_CODE_CHAR:
4839 switch (arg->
code ())
4843 case TYPE_CODE_COMPLEX:
4857 switch (arg->
code ())
4859 case TYPE_CODE_STRUCT:
4875 switch (arg->
code ())
4904 if (parm->code () == TYPE_CODE_TYPEDEF)
4906 if (arg->
code () == TYPE_CODE_TYPEDEF)
4915 if (parm->code () == TYPE_CODE_RVALUE_REF)
4926 if (parm->code () == TYPE_CODE_RVALUE_REF)
4933 struct type *t1 = parm;
4934 struct type *t2 = arg;
4937 if (parm->is_pointer_or_reference ())
4939 t1 = parm->target_type ();
4966 "------ Arg is %s [%d], parm is %s [%d]\n",
4968 parm->name (), parm->code ());
4973 switch (parm->code ())
4977 case TYPE_CODE_ARRAY:
4979 case TYPE_CODE_FUNC:
4983 case TYPE_CODE_ENUM:
4985 case TYPE_CODE_CHAR:
4987 case TYPE_CODE_RANGE:
4989 case TYPE_CODE_BOOL:
4993 case TYPE_CODE_COMPLEX:
4995 case TYPE_CODE_STRUCT:
5013 for (bitno = 0; bitno < nbits; bitno++)
5015 if ((bitno % 8) == 0)
5037 for (i = 0; i < nargs; i++)
5040 (
"%*s[%d] name '%s'\n", spaces,
"", i,
5041 args[i].
name () != NULL ? args[i].
name () :
"<NULL>");
5066 gdb_printf (
"%*sfn_fieldlists %s\n", spaces,
"",
5072 (
"%*s[%d] name '%s' (%s) length %d\n", spaces + 2,
"",
5077 for (overload_idx = 0;
5082 (
"%*s[%d] physname '%s' (%s)\n",
5083 spaces + 4,
"", overload_idx,
5088 (
"%*stype %s\n", spaces + 8,
"",
5095 (
"%*sargs %s\n", spaces + 8,
"",
5101 (
"%*sfcontext %s\n", spaces + 8,
"",
5105 gdb_printf (
"%*sis_const %d\n", spaces + 8,
"",
5107 gdb_printf (
"%*sis_volatile %d\n", spaces + 8,
"",
5109 gdb_printf (
"%*sis_private %d\n", spaces + 8,
"",
5111 gdb_printf (
"%*sis_protected %d\n", spaces + 8,
"",
5113 gdb_printf (
"%*sis_stub %d\n", spaces + 8,
"",
5115 gdb_printf (
"%*sdefaulted %d\n", spaces + 8,
"",
5117 gdb_printf (
"%*sis_deleted %d\n", spaces + 8,
"",
5119 gdb_printf (
"%*svoffset %u\n", spaces + 8,
"",
5128 gdb_printf (
"%*svptr_fieldno %d\n", spaces,
"",
5130 gdb_printf (
"%*svptr_basetype %s\n", spaces,
"",
5135 gdb_printf (
"%*sn_baseclasses %d\n", spaces,
"",
5137 gdb_printf (
"%*snfn_fields %d\n", spaces,
"",
5142 (
"%*svirtual_field_bits (%d bits at *%s)",
5155 (
"%*sprivate_field_bits (%d bits at *%s)",
5165 (
"%*sprotected_field_bits (%d bits at *%s",
5178 gdb_printf (
"%*scalling_convention %d\n", spaces,
"",
5190 if (descriptive_type == NULL)
5191 gdb_printf (
"%*sno descriptive type\n", spaces + 2,
"");
5194 gdb_printf (
"%*sdescriptive type\n", spaces + 2,
"");
5205 gdb_printf (
"%*sscaling factor: %s\n", spaces + 2,
"",
5216 switch (prop.
kind ())
5229 gdb_assert_not_reached (
"unhandled prop kind");
5245 struct type **first_dont_print
5248 int i = (
struct type **)
5253 if (
type == first_dont_print[i])
5256 host_address_to_string (
type));
5257 gdb_printf (_(
" <same as already seen type>\n"));
5266 host_address_to_string (
type));
5267 gdb_printf (
"%*sname '%s' (%s)\n", spaces,
"",
5269 host_address_to_string (
type->
name ()));
5279 case TYPE_CODE_ARRAY:
5282 case TYPE_CODE_STRUCT:
5285 case TYPE_CODE_UNION:
5288 case TYPE_CODE_ENUM:
5291 case TYPE_CODE_FLAGS:
5294 case TYPE_CODE_FUNC:
5303 case TYPE_CODE_VOID:
5309 case TYPE_CODE_RANGE:
5312 case TYPE_CODE_STRING:
5315 case TYPE_CODE_ERROR:
5318 case TYPE_CODE_MEMBERPTR:
5321 case TYPE_CODE_METHODPTR:
5324 case TYPE_CODE_METHOD:
5330 case TYPE_CODE_CHAR:
5333 case TYPE_CODE_BOOL:
5336 case TYPE_CODE_COMPLEX:
5339 case TYPE_CODE_TYPEDEF:
5342 case TYPE_CODE_NAMESPACE:
5345 case TYPE_CODE_FIXED_POINT:
5361 gdb_printf (
"%*starget_type %s\n", spaces,
"",
5367 gdb_printf (
"%*spointer_type %s\n", spaces,
"",
5369 gdb_printf (
"%*sreference_type %s\n", spaces,
"",
5371 gdb_printf (
"%*stype_chain %s\n", spaces,
"",
5373 gdb_printf (
"%*sinstance_flags 0x%x", spaces,
"",
5393 gdb_puts (
" TYPE_ADDRESS_CLASS_1");
5397 gdb_puts (
" TYPE_ADDRESS_CLASS_2");
5420 gdb_puts (
" TYPE_ENDIANITY_NOT_DEFAULT");
5480 if (
type->
code () == TYPE_CODE_ENUM)
5481 gdb_printf (
"%*s[%d] enumval %s type ", spaces + 2,
"",
5484 gdb_printf (
"%*s[%d] bitpos %s bitsize %d type ", spaces + 2,
"",
5498 if (
type->
code () == TYPE_CODE_RANGE)
5510 gdb_printf (
"%*scplus_stuff %s\n", spaces,
"",
5516 gdb_printf (
"%*sgnat_stuff %s\n", spaces,
"",
5532 gdb_printf (
"%*scalling_convention %d\n", spaces,
"",
5543 gdb_printf (
"%*sfixed_point_info ", spaces,
"");
5553 gdb_printf (
"%*s bit size = %u, bit offset = %u\n", spaces,
"",
5580 return htab_hash_pointer (pair->
old);
5589 return lhs->
old == rhs->
old;
5599 htab_delete_entry<type_pair>,
5612 while (*node_ptr != NULL)
5617 obstack_copy (storage, *node_ptr,
5619 node_copy->
prop = (*node_ptr)->prop;
5620 *node_ptr = node_copy;
5622 node_ptr = &node_copy->
next;
5644 slot = htab_find_slot (copied_types, &pair, INSERT);
5646 return ((
struct type_pair *) *slot)->newobj;
5678 for (i = 0; i < nfields; i++)
5710 internal_error (_(
"Unexpected type field location kind: %d"),
5717 if (
type->
code () == TYPE_CODE_RANGE)
5780 gdb_assert_not_reached (
"bad type_specific_kind");
5822 gdb_assert ((
bit % TARGET_CHAR_BIT) == 0);
5837 int bit,
int unsigned_p,
const char *
name)
5854 int bit,
int unsigned_p,
const char *
name)
5871 int bit,
int unsigned_p,
const char *
name)
5890 const struct floatformat **floatformats)
5955 struct type *field_type,
const char *
name)
5957 int type_bitsize =
type->
length () * TARGET_CHAR_BIT;
5960 gdb_assert (
type->
code () == TYPE_CODE_FLAGS);
5962 gdb_assert (start_bitpos >= 0 && start_bitpos < type_bitsize);
5963 gdb_assert (nr_bits >= 1 && (start_bitpos + nr_bits) <= type_bitsize);
5964 gdb_assert (
name != NULL);
5994 gdb_assert (
code == TYPE_CODE_STRUCT ||
code == TYPE_CODE_UNION);
6015 memset (
f, 0,
sizeof f[0]);
6017 f[0].set_name (
name);
6030 if (t->
code () == TYPE_CODE_UNION)
6035 else if (t->
code () == TYPE_CODE_STRUCT)
6042 + (
f[-1].
type ()->length () * TARGET_CHAR_BIT));
6048 alignment *= TARGET_CHAR_BIT;
6049 left =
f[0].loc_bitpos () % alignment;
6053 f->set_loc_bitpos (
f[0].
loc_bitpos () + (alignment - left));
6055 (t->
length () + (alignment - left) / TARGET_CHAR_BIT);
6079typedef std::vector<std::unique_ptr<fixed_point_type_info>>
6098 if (storage ==
nullptr)
6101 storage->push_back (std::move (up));
6107 info = up.release ();
6122 return type->
code () == TYPE_CODE_FIXED_POINT;
6136 gdb_assert (
type->
code () == TYPE_CODE_FIXED_POINT);
6171 1,
"unsigned char");
6177 1,
"unsigned short");
6189 1,
"unsigned long");
6195 1,
"unsigned long long");
6291 "<internal function>");
6304 if (result ==
nullptr)
6316 gdb::noop_deleter<struct objfile_type>>
6346 1,
"unsigned char");
6352 1,
"unsigned short");
6364 1,
"unsigned long");
6370 1,
"unsigned long long");
6389 "<text variable, no debug info>");
6393 "<text gnu-indirect-function variable, no debug info>");
6398 "<text from jump slot in .got.plt, no debug info>",
6450 _(
"Set debugging of C++ overloading."),
6451 _(
"Show debugging of C++ overloading."),
6452 _(
"When enabled, ranking of the "
6453 "functions is displayed."),
6461 _(
"Set resolution of opaque struct/class/union"
6462 " types (if set before loading symbols)."),
6463 _(
"Show resolution of opaque struct/class/union"
6464 " types (if set before loading symbols)."),
6472 _(
"Set strict type checking."),
6473 _(
"Show strict type checking."),
#define bits(obj, st, fn)
void * xcalloc(size_t number, size_t size)
char * gdbarch_obstack_strdup(struct gdbarch *arch, const char *string)
obstack * gdbarch_obstack(gdbarch *arch)
void set(unsigned key, void *datum)
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)
struct type * arch_pointer_type(struct gdbarch *gdbarch, int bit, const char *name, struct type *target_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_string_type(struct type *result_type, struct type *string_char_type, struct type *range_type)
struct type * resolve_dynamic_type(struct type *type, gdb::array_view< const gdb_byte > valaddr, CORE_ADDR addr)
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)
struct type * lookup_enum(const char *name, const struct block *block)
const struct floatformat * floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN]
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 * 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)
struct type * init_decfloat_type(struct objfile *objfile, int bit, const char *name)
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 * arch_decfloat_type(struct gdbarch *gdbarch, int bit, const char *name)
const struct rank NS_POINTER_CONVERSION_BADNESS
const struct rank FLOAT_PROMOTION_BADNESS
const struct floatformat * floatformats_m68881_ext[BFD_ENDIAN_UNKNOWN]
struct type * allocate_stub_method(struct type *type)
struct type * lookup_struct_elt_type(struct type *type, const char *name, int noerr)
void allocate_cplus_struct_type(struct type *type)
struct type * create_array_type_with_stride(struct type *result_type, struct type *element_type, struct type *range_type, struct dynamic_prop *byte_stride_prop, unsigned int bit_stride)
static void set_type_code(struct type *type, enum type_code code)
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 field_is_static(struct field *f)
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)
struct type * alloc_type_arch(struct gdbarch *gdbarch)
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
const struct floatformat * floatformat_from_type(const struct type *type)
struct type * init_type(struct objfile *objfile, enum type_code code, int bit, const char *name)
struct type * init_fixed_point_type(struct objfile *objfile, int bit, int unsigned_p, const char *name)
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
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)
static struct type * safe_parse_type(struct gdbarch *gdbarch, const char *p, int length)
static void stub_noname_complaint(void)
static struct type * init_nodebug_var_type(struct objfile *objfile, const char *name)
const struct rank BASE_CONVERSION_BADNESS
struct type * arch_flags_type(struct gdbarch *gdbarch, const char *name, int bit)
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)
bool is_nocall_function(const struct type *type)
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)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int bit, const char *name)
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
struct type * create_array_type(struct type *result_type, struct type *element_type, struct type *range_type)
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)
struct type * arch_boolean_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
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]
static struct type * resolve_dynamic_array_or_string(struct type *type, struct property_addr_info *addr_stack)
const struct rank REFERENCE_CONVERSION_BADNESS
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, const char *name, const struct floatformat **floatformats)
struct type * arch_character_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
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)
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)
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 floatformat * floatformats_arm_ext[BFD_ENDIAN_UNKNOWN]
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)
struct type * init_pointer_type(struct objfile *objfile, int bit, const char *name, struct type *target_type)
int type_not_associated(const struct type *type)
unsigned type_align(struct type *type)
unsigned int type_length_units(struct type *type)
struct type * create_range_type_with_stride(struct type *result_type, 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)
bool types_equal(struct type *a, struct type *b)
void replace_type(struct type *ntype, struct type *type)
struct type * alloc_type(struct objfile *objfile)
struct type * init_complex_type(const char *name, struct type *target_type)
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)
struct type * init_float_type(struct objfile *objfile, int bit, const char *name, const struct floatformat **floatformats, enum bfd_endian byte_order)
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 type * alloc_type_copy(const struct type *type)
struct type * create_static_range_type(struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound)
static struct type * resolve_dynamic_range(struct type *dyn_range_type, struct property_addr_info *addr_stack, int rank, bool resolve_p=true)
struct field * append_composite_type_field_raw(struct type *t, const char *name, struct type *field)
const struct cplus_struct_type cplus_struct_default
struct type * init_character_type(struct objfile *objfile, int bit, int unsigned_p, const char *name)
static struct type * resolve_dynamic_struct(struct type *type, struct property_addr_info *addr_stack)
int get_vptr_fieldno(struct type *type, struct type **basetypep)
const struct floatformat * floatformats_ieee_half[BFD_ENDIAN_UNKNOWN]
static struct type * resolve_dynamic_union(struct type *type, struct property_addr_info *addr_stack)
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
struct type * create_set_type(struct type *result_type, struct type *domain_type)
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
static const registry< objfile >::key< struct objfile_type, gdb::noop_deleter< struct objfile_type > > objfile_type_data
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)
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)
struct type * init_boolean_type(struct objfile *objfile, int bit, int unsigned_p, const char *name)
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)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
static bool strict_type_checking
struct type * make_atomic_type(struct type *type)
struct type * create_range_type(struct type *result_type, struct type *index_type, const struct dynamic_prop *low_bound, const struct dynamic_prop *high_bound, LONGEST bias)
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 type * resolve_dynamic_array_or_string_1(struct type *type, struct property_addr_info *addr_stack, int rank, bool resolve_p)
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 * init_integer_type(struct objfile *objfile, int bit, int unsigned_p, const char *name)
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_type_internal(struct type *type, struct property_addr_info *addr_stack, int top_level)
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)
struct type * init_type(struct objfile *, enum type_code, int, const char *)
#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 FIELD_ARTIFICIAL(thisfld)
#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)
struct type * init_pointer_type(struct objfile *, int, const char *, struct type *)
#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_FIELD_ARTIFICIAL(thistype, n)
#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)
struct type * init_integer_type(struct objfile *, int, int, const char *)
#define TYPE_FN_FIELD_STATIC_P(thisfn, n)
#define INIT_GNAT_SPECIFIC(type)
#define TYPE_FIELD_BITSIZE(thistype, n)
#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
struct type * init_float_type(struct objfile *, int, const char *, const struct floatformat **, enum bfd_endian=BFD_ENDIAN_UNKNOWN)
#define TYPE_FN_FIELD_CONST(thisfn, n)
#define FIELD_BITSIZE(thisfld)
#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 * 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 * internal_fn
struct type * builtin_uint16
struct type * builtin_int24
struct type * builtin_double
struct type * builtin_string
struct type * builtin_int8
struct type * builtin_func_ptr
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 * 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 * 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 * builtin_func_func
struct type * builtin_true_char
const CORE_ADDR m_unrelocated_pc
dwarf2_per_cu_data *const per_cu
dwarf2_per_objfile *const per_objfile
int block_line_section() const
struct dwarf2_per_cu_data * per_cu
compunit_symtab * get_symtab(const dwarf2_per_cu_data *per_cu) const
struct dwarf2_locexpr_baton locexpr
struct type * property_type
struct dynamic_prop_list * next
enum dynamic_prop_node_kind prop_kind
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(void *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)
const char * loc_physname() const
void set_loc_dwarf_block(dwarf2_locexpr_baton *dwarf_block)
void set_loc_physname(const char *physname)
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
struct type * type() const
const void * insert(const void *addr, int length, bool *added=nullptr)
enum language la_language
struct dynamic_prop_list * dyn_prop_list
struct type * nodebug_unknown_symbol
struct type * nodebug_tls_symbol
struct type * nodebug_got_plt_symbol
struct type * builtin_error
struct type * builtin_unsigned_int
struct type * builtin_int
struct type * builtin_long
struct type * builtin_unsigned_long
struct type * builtin_void
struct type * builtin_char
struct type * builtin_long_long
struct type * builtin_long_double
struct type * builtin_float
struct type * builtin_short
struct type * builtin_unsigned_char
struct type * builtin_signed_char
struct type * nodebug_text_gnu_ifunc_symbol
struct type * builtin_core_addr
struct type * builtin_unsigned_short
struct type * nodebug_text_symbol
struct type * builtin_double
struct type * nodebug_data_symbol
struct type * builtin_unsigned_long_long
struct gdbarch * arch() const
auto_obstack objfile_obstack
::section_offsets section_offsets
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 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)
void set_num_fields(int num_fields)
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_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)
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
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)
struct type * value_type(const struct value *value)
LONGEST value_embedded_offset(const struct value *value)
CORE_ADDR value_address(const struct value *value)
LONGEST value_as_long(struct value *val)
gdb::array_view< const gdb_byte > value_contents_for_printing(struct value *value)
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)