mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
gdb: add type::target_type / type::set_target_type
Add the `target_type` and `set_target_type` methods on `struct type`, in order to remove the `TYPE_TARGET_TYPE` macro. In this patch, the macro is changed to use the getter, so all the call sites of the macro that are used as a setter are changed to use the setter method directly. The next patch will remove the macro completely. Change-Id: I85ce24d847763badd34fdee3e14b8c8c14cb3161
This commit is contained in:
@ -8114,7 +8114,7 @@ template_to_static_fixed_type (struct type *type0)
|
|||||||
|
|
||||||
/* Whether or not we cloned TYPE0, cache the result so that we don't do
|
/* Whether or not we cloned TYPE0, cache the result so that we don't do
|
||||||
recompute all over next time. */
|
recompute all over next time. */
|
||||||
TYPE_TARGET_TYPE (type0) = type;
|
type0->set_target_type (type);
|
||||||
|
|
||||||
for (f = 0; f < nfields; f += 1)
|
for (f = 0; f < nfields; f += 1)
|
||||||
{
|
{
|
||||||
@ -8134,7 +8134,8 @@ template_to_static_fixed_type (struct type *type0)
|
|||||||
/* Clone TYPE0 only the first time we get a new field type. */
|
/* Clone TYPE0 only the first time we get a new field type. */
|
||||||
if (type == type0)
|
if (type == type0)
|
||||||
{
|
{
|
||||||
TYPE_TARGET_TYPE (type0) = type = alloc_type_copy (type0);
|
type = alloc_type_copy (type0);
|
||||||
|
type0->set_target_type (type);
|
||||||
type->set_code (type0->code ());
|
type->set_code (type0->code ());
|
||||||
INIT_NONE_SPECIFIC (type);
|
INIT_NONE_SPECIFIC (type);
|
||||||
type->set_num_fields (nfields);
|
type->set_num_fields (nfields);
|
||||||
@ -10278,8 +10279,8 @@ ada_ternop_slice (struct expression *exp,
|
|||||||
the aligners. */
|
the aligners. */
|
||||||
if (value_type (array)->code () == TYPE_CODE_REF
|
if (value_type (array)->code () == TYPE_CODE_REF
|
||||||
&& ada_is_aligner_type (TYPE_TARGET_TYPE (value_type (array))))
|
&& ada_is_aligner_type (TYPE_TARGET_TYPE (value_type (array))))
|
||||||
TYPE_TARGET_TYPE (value_type (array)) =
|
value_type (array)->set_target_type
|
||||||
ada_aligned_type (TYPE_TARGET_TYPE (value_type (array)));
|
(ada_aligned_type (TYPE_TARGET_TYPE (value_type (array))));
|
||||||
|
|
||||||
if (ada_is_any_packed_array_type (value_type (array)))
|
if (ada_is_any_packed_array_type (value_type (array)))
|
||||||
error (_("cannot slice a packed array"));
|
error (_("cannot slice a packed array"));
|
||||||
|
@ -698,7 +698,7 @@ read_func_kind_type (struct ctf_context *ccp, ctf_id_t tid)
|
|||||||
fname == nullptr ? "noname" : fname);
|
fname == nullptr ? "noname" : fname);
|
||||||
}
|
}
|
||||||
rettype = fetch_tid_type (ccp, cfi.ctc_return);
|
rettype = fetch_tid_type (ccp, cfi.ctc_return);
|
||||||
TYPE_TARGET_TYPE (type) = rettype;
|
type->set_target_type (rettype);
|
||||||
set_type_align (type, ctf_type_align (fp, tid));
|
set_type_align (type, ctf_type_align (fp, tid));
|
||||||
|
|
||||||
/* Set up function's arguments. */
|
/* Set up function's arguments. */
|
||||||
@ -749,7 +749,7 @@ read_enum_type (struct ctf_context *ccp, ctf_id_t tid)
|
|||||||
type->set_code (TYPE_CODE_ENUM);
|
type->set_code (TYPE_CODE_ENUM);
|
||||||
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
|
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
|
||||||
/* Set the underlying type based on its ctf_type_size bits. */
|
/* Set the underlying type based on its ctf_type_size bits. */
|
||||||
TYPE_TARGET_TYPE (type) = objfile_int_type (of, TYPE_LENGTH (type), false);
|
type->set_target_type (objfile_int_type (of, TYPE_LENGTH (type), false));
|
||||||
set_type_align (type, ctf_type_align (fp, tid));
|
set_type_align (type, ctf_type_align (fp, tid));
|
||||||
|
|
||||||
return set_tid_type (of, tid, type);
|
return set_tid_type (of, tid, type);
|
||||||
@ -791,15 +791,14 @@ add_array_cv_type (struct ctf_context *ccp,
|
|||||||
|
|
||||||
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
||||||
{
|
{
|
||||||
TYPE_TARGET_TYPE (inner_array)
|
inner_array->set_target_type (copy_type (TYPE_TARGET_TYPE (inner_array)));
|
||||||
= copy_type (TYPE_TARGET_TYPE (inner_array));
|
|
||||||
inner_array = TYPE_TARGET_TYPE (inner_array);
|
inner_array = TYPE_TARGET_TYPE (inner_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
el_type = TYPE_TARGET_TYPE (inner_array);
|
el_type = TYPE_TARGET_TYPE (inner_array);
|
||||||
cnst |= TYPE_CONST (el_type);
|
cnst |= TYPE_CONST (el_type);
|
||||||
voltl |= TYPE_VOLATILE (el_type);
|
voltl |= TYPE_VOLATILE (el_type);
|
||||||
TYPE_TARGET_TYPE (inner_array) = make_cv_type (cnst, voltl, el_type, nullptr);
|
inner_array->set_target_type (make_cv_type (cnst, voltl, el_type, nullptr));
|
||||||
|
|
||||||
return set_tid_type (ccp->of, tid, base_type);
|
return set_tid_type (ccp->of, tid, base_type);
|
||||||
}
|
}
|
||||||
@ -933,9 +932,9 @@ read_typedef_type (struct ctf_context *ccp, ctf_id_t tid,
|
|||||||
set_tid_type (objfile, tid, this_type);
|
set_tid_type (objfile, tid, this_type);
|
||||||
target_type = fetch_tid_type (ccp, btid);
|
target_type = fetch_tid_type (ccp, btid);
|
||||||
if (target_type != this_type)
|
if (target_type != this_type)
|
||||||
TYPE_TARGET_TYPE (this_type) = target_type;
|
this_type->set_target_type (target_type);
|
||||||
else
|
else
|
||||||
TYPE_TARGET_TYPE (this_type) = nullptr;
|
this_type->set_target_type (nullptr);
|
||||||
|
|
||||||
this_type->set_target_is_stub (TYPE_TARGET_TYPE (this_type) != nullptr);
|
this_type->set_target_is_stub (TYPE_TARGET_TYPE (this_type) != nullptr);
|
||||||
|
|
||||||
|
@ -14380,7 +14380,7 @@ rewrite_array_type (struct type *type)
|
|||||||
memcpy (new_fields, copy->fields (), nfields * sizeof (struct field));
|
memcpy (new_fields, copy->fields (), nfields * sizeof (struct field));
|
||||||
copy->set_fields (new_fields);
|
copy->set_fields (new_fields);
|
||||||
if (new_target != nullptr)
|
if (new_target != nullptr)
|
||||||
TYPE_TARGET_TYPE (copy) = new_target;
|
copy->set_target_type (new_target);
|
||||||
|
|
||||||
struct type *index_copy = copy_type (index_type);
|
struct type *index_copy = copy_type (index_type);
|
||||||
range_bounds *bounds
|
range_bounds *bounds
|
||||||
@ -15196,7 +15196,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
|
|||||||
{
|
{
|
||||||
struct type *underlying_type = die_type (die, cu);
|
struct type *underlying_type = die_type (die, cu);
|
||||||
|
|
||||||
TYPE_TARGET_TYPE (type) = underlying_type;
|
type->set_target_type (underlying_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
|
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
|
||||||
@ -16286,15 +16286,14 @@ add_array_cv_type (struct die_info *die, struct dwarf2_cu *cu,
|
|||||||
|
|
||||||
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
while (TYPE_TARGET_TYPE (inner_array)->code () == TYPE_CODE_ARRAY)
|
||||||
{
|
{
|
||||||
TYPE_TARGET_TYPE (inner_array) =
|
inner_array->set_target_type (copy_type (TYPE_TARGET_TYPE (inner_array)));
|
||||||
copy_type (TYPE_TARGET_TYPE (inner_array));
|
|
||||||
inner_array = TYPE_TARGET_TYPE (inner_array);
|
inner_array = TYPE_TARGET_TYPE (inner_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
el_type = TYPE_TARGET_TYPE (inner_array);
|
el_type = TYPE_TARGET_TYPE (inner_array);
|
||||||
cnst |= TYPE_CONST (el_type);
|
cnst |= TYPE_CONST (el_type);
|
||||||
voltl |= TYPE_VOLATILE (el_type);
|
voltl |= TYPE_VOLATILE (el_type);
|
||||||
TYPE_TARGET_TYPE (inner_array) = make_cv_type (cnst, voltl, el_type, NULL);
|
inner_array->set_target_type (make_cv_type (cnst, voltl, el_type, NULL));
|
||||||
|
|
||||||
return set_die_type (die, base_type, cu);
|
return set_die_type (die, base_type, cu);
|
||||||
}
|
}
|
||||||
@ -16675,7 +16674,7 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu)
|
|||||||
set_die_type (die, this_type, cu);
|
set_die_type (die, this_type, cu);
|
||||||
target_type = die_type (die, cu);
|
target_type = die_type (die, cu);
|
||||||
if (target_type != this_type)
|
if (target_type != this_type)
|
||||||
TYPE_TARGET_TYPE (this_type) = target_type;
|
this_type->set_target_type (target_type);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Self-referential typedefs are, it seems, not allowed by the DWARF
|
/* Self-referential typedefs are, it seems, not allowed by the DWARF
|
||||||
@ -16683,7 +16682,7 @@ read_typedef (struct die_info *die, struct dwarf2_cu *cu)
|
|||||||
complaint (_("Self-referential DW_TAG_typedef "
|
complaint (_("Self-referential DW_TAG_typedef "
|
||||||
"- DIE at %s [in module %s]"),
|
"- DIE at %s [in module %s]"),
|
||||||
sect_offset_str (die->sect_off), objfile_name (objfile));
|
sect_offset_str (die->sect_off), objfile_name (objfile));
|
||||||
TYPE_TARGET_TYPE (this_type) = NULL;
|
this_type->set_target_type (nullptr);
|
||||||
}
|
}
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1609,14 +1609,14 @@ fbsd_get_siginfo_type (struct gdbarch *gdbarch)
|
|||||||
/* __pid_t */
|
/* __pid_t */
|
||||||
pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (int32_type) * TARGET_CHAR_BIT, "__pid_t");
|
TYPE_LENGTH (int32_type) * TARGET_CHAR_BIT, "__pid_t");
|
||||||
TYPE_TARGET_TYPE (pid_type) = int32_type;
|
pid_type->set_target_type (int32_type);
|
||||||
pid_type->set_target_is_stub (true);
|
pid_type->set_target_is_stub (true);
|
||||||
|
|
||||||
/* __uid_t */
|
/* __uid_t */
|
||||||
uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (uint32_type) * TARGET_CHAR_BIT,
|
TYPE_LENGTH (uint32_type) * TARGET_CHAR_BIT,
|
||||||
"__uid_t");
|
"__uid_t");
|
||||||
TYPE_TARGET_TYPE (uid_type) = uint32_type;
|
uid_type->set_target_type (uint32_type);
|
||||||
pid_type->set_target_is_stub (true);
|
pid_type->set_target_is_stub (true);
|
||||||
|
|
||||||
/* _reason */
|
/* _reason */
|
||||||
|
@ -371,7 +371,7 @@ make_pointer_type (struct type *type, struct type **typeptr)
|
|||||||
TYPE_CHAIN (ntype) = chain;
|
TYPE_CHAIN (ntype) = chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPE_TARGET_TYPE (ntype) = type;
|
ntype->set_target_type (type);
|
||||||
TYPE_POINTER_TYPE (type) = ntype;
|
TYPE_POINTER_TYPE (type) = ntype;
|
||||||
|
|
||||||
/* FIXME! Assumes the machine has only one representation for pointers! */
|
/* FIXME! Assumes the machine has only one representation for pointers! */
|
||||||
@ -449,7 +449,7 @@ make_reference_type (struct type *type, struct type **typeptr,
|
|||||||
TYPE_CHAIN (ntype) = chain;
|
TYPE_CHAIN (ntype) = chain;
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPE_TARGET_TYPE (ntype) = type;
|
ntype->set_target_type (type);
|
||||||
reftype = (refcode == TYPE_CODE_REF ? &TYPE_REFERENCE_TYPE (type)
|
reftype = (refcode == TYPE_CODE_REF ? &TYPE_REFERENCE_TYPE (type)
|
||||||
: &TYPE_RVALUE_REFERENCE_TYPE (type));
|
: &TYPE_RVALUE_REFERENCE_TYPE (type));
|
||||||
|
|
||||||
@ -522,7 +522,7 @@ make_function_type (struct type *type, struct type **typeptr)
|
|||||||
smash_type (ntype);
|
smash_type (ntype);
|
||||||
}
|
}
|
||||||
|
|
||||||
TYPE_TARGET_TYPE (ntype) = type;
|
ntype->set_target_type (type);
|
||||||
|
|
||||||
TYPE_LENGTH (ntype) = 1;
|
TYPE_LENGTH (ntype) = 1;
|
||||||
ntype->set_code (TYPE_CODE_FUNC);
|
ntype->set_code (TYPE_CODE_FUNC);
|
||||||
@ -876,7 +876,7 @@ allocate_stub_method (struct type *type)
|
|||||||
mtype->set_code (TYPE_CODE_METHOD);
|
mtype->set_code (TYPE_CODE_METHOD);
|
||||||
TYPE_LENGTH (mtype) = 1;
|
TYPE_LENGTH (mtype) = 1;
|
||||||
mtype->set_is_stub (true);
|
mtype->set_is_stub (true);
|
||||||
TYPE_TARGET_TYPE (mtype) = type;
|
mtype->set_target_type (type);
|
||||||
/* TYPE_SELF_TYPE (mtype) = unknown yet */
|
/* TYPE_SELF_TYPE (mtype) = unknown yet */
|
||||||
return mtype;
|
return mtype;
|
||||||
}
|
}
|
||||||
@ -941,7 +941,7 @@ create_range_type (struct type *result_type, struct type *index_type,
|
|||||||
if (result_type == NULL)
|
if (result_type == NULL)
|
||||||
result_type = alloc_type_copy (index_type);
|
result_type = alloc_type_copy (index_type);
|
||||||
result_type->set_code (TYPE_CODE_RANGE);
|
result_type->set_code (TYPE_CODE_RANGE);
|
||||||
TYPE_TARGET_TYPE (result_type) = index_type;
|
result_type->set_target_type (index_type);
|
||||||
if (index_type->is_stub ())
|
if (index_type->is_stub ())
|
||||||
result_type->set_target_is_stub (true);
|
result_type->set_target_is_stub (true);
|
||||||
else
|
else
|
||||||
@ -1378,7 +1378,7 @@ create_array_type_with_stride (struct type *result_type,
|
|||||||
result_type = alloc_type_copy (range_type);
|
result_type = alloc_type_copy (range_type);
|
||||||
|
|
||||||
result_type->set_code (TYPE_CODE_ARRAY);
|
result_type->set_code (TYPE_CODE_ARRAY);
|
||||||
TYPE_TARGET_TYPE (result_type) = element_type;
|
result_type->set_target_type (element_type);
|
||||||
|
|
||||||
result_type->set_num_fields (1);
|
result_type->set_num_fields (1);
|
||||||
result_type->set_fields
|
result_type->set_fields
|
||||||
@ -1522,7 +1522,7 @@ make_vector_type (struct type *array_type)
|
|||||||
type_instance_flags flags
|
type_instance_flags flags
|
||||||
= elt_type->instance_flags () | TYPE_INSTANCE_FLAG_NOTTEXT;
|
= elt_type->instance_flags () | TYPE_INSTANCE_FLAG_NOTTEXT;
|
||||||
elt_type = make_qualified_type (elt_type, flags, NULL);
|
elt_type = make_qualified_type (elt_type, flags, NULL);
|
||||||
TYPE_TARGET_TYPE (inner_array) = elt_type;
|
inner_array->set_target_type (elt_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
array_type->set_is_vector (true);
|
array_type->set_is_vector (true);
|
||||||
@ -1610,7 +1610,7 @@ smash_to_memberptr_type (struct type *type, struct type *self_type,
|
|||||||
{
|
{
|
||||||
smash_type (type);
|
smash_type (type);
|
||||||
type->set_code (TYPE_CODE_MEMBERPTR);
|
type->set_code (TYPE_CODE_MEMBERPTR);
|
||||||
TYPE_TARGET_TYPE (type) = to_type;
|
type->set_target_type (to_type);
|
||||||
set_type_self_type (type, self_type);
|
set_type_self_type (type, self_type);
|
||||||
/* Assume that a data member pointer is the same size as a normal
|
/* Assume that a data member pointer is the same size as a normal
|
||||||
pointer. */
|
pointer. */
|
||||||
@ -1628,7 +1628,7 @@ smash_to_methodptr_type (struct type *type, struct type *to_type)
|
|||||||
{
|
{
|
||||||
smash_type (type);
|
smash_type (type);
|
||||||
type->set_code (TYPE_CODE_METHODPTR);
|
type->set_code (TYPE_CODE_METHODPTR);
|
||||||
TYPE_TARGET_TYPE (type) = to_type;
|
type->set_target_type (to_type);
|
||||||
set_type_self_type (type, TYPE_SELF_TYPE (to_type));
|
set_type_self_type (type, TYPE_SELF_TYPE (to_type));
|
||||||
TYPE_LENGTH (type) = cplus_method_ptr_size (to_type);
|
TYPE_LENGTH (type) = cplus_method_ptr_size (to_type);
|
||||||
}
|
}
|
||||||
@ -1647,7 +1647,7 @@ smash_to_method_type (struct type *type, struct type *self_type,
|
|||||||
{
|
{
|
||||||
smash_type (type);
|
smash_type (type);
|
||||||
type->set_code (TYPE_CODE_METHOD);
|
type->set_code (TYPE_CODE_METHOD);
|
||||||
TYPE_TARGET_TYPE (type) = to_type;
|
type->set_target_type (to_type);
|
||||||
set_type_self_type (type, self_type);
|
set_type_self_type (type, self_type);
|
||||||
type->set_fields (args);
|
type->set_fields (args);
|
||||||
type->set_num_fields (nargs);
|
type->set_num_fields (nargs);
|
||||||
@ -2438,10 +2438,10 @@ resolve_dynamic_array_or_string (struct type *type,
|
|||||||
struct type *rank_type = type;
|
struct type *rank_type = type;
|
||||||
for (int i = 1; i < rank; i++)
|
for (int i = 1; i < rank; i++)
|
||||||
{
|
{
|
||||||
TYPE_TARGET_TYPE (rank_type) = copy_type (rank_type);
|
rank_type->set_target_type (copy_type (rank_type));
|
||||||
rank_type = TYPE_TARGET_TYPE (rank_type);
|
rank_type = TYPE_TARGET_TYPE (rank_type);
|
||||||
}
|
}
|
||||||
TYPE_TARGET_TYPE (rank_type) = element_type;
|
rank_type->set_target_type (element_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2782,7 +2782,7 @@ resolve_dynamic_struct (struct type *type,
|
|||||||
|
|
||||||
/* The Ada language uses this field as a cache for static fixed types: reset
|
/* The Ada language uses this field as a cache for static fixed types: reset
|
||||||
it as RESOLVED_TYPE must have its own static fixed type. */
|
it as RESOLVED_TYPE must have its own static fixed type. */
|
||||||
TYPE_TARGET_TYPE (resolved_type) = NULL;
|
resolved_type->set_target_type (nullptr);
|
||||||
|
|
||||||
return resolved_type;
|
return resolved_type;
|
||||||
}
|
}
|
||||||
@ -2811,9 +2811,9 @@ resolve_dynamic_type_internal (struct type *type,
|
|||||||
if (type->code () == TYPE_CODE_TYPEDEF)
|
if (type->code () == TYPE_CODE_TYPEDEF)
|
||||||
{
|
{
|
||||||
resolved_type = copy_type (type);
|
resolved_type = copy_type (type);
|
||||||
TYPE_TARGET_TYPE (resolved_type)
|
resolved_type->set_target_type
|
||||||
= resolve_dynamic_type_internal (TYPE_TARGET_TYPE (type), addr_stack,
|
(resolve_dynamic_type_internal (TYPE_TARGET_TYPE (type), addr_stack,
|
||||||
top_level);
|
top_level));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2836,9 +2836,9 @@ resolve_dynamic_type_internal (struct type *type,
|
|||||||
pinfo.next = addr_stack;
|
pinfo.next = addr_stack;
|
||||||
|
|
||||||
resolved_type = copy_type (type);
|
resolved_type = copy_type (type);
|
||||||
TYPE_TARGET_TYPE (resolved_type)
|
resolved_type->set_target_type
|
||||||
= resolve_dynamic_type_internal (TYPE_TARGET_TYPE (type),
|
(resolve_dynamic_type_internal (TYPE_TARGET_TYPE (type),
|
||||||
&pinfo, top_level);
|
&pinfo, top_level));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3034,9 +3034,9 @@ check_typedef (struct type *type)
|
|||||||
}
|
}
|
||||||
sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0).symbol;
|
sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0).symbol;
|
||||||
if (sym)
|
if (sym)
|
||||||
TYPE_TARGET_TYPE (type) = sym->type ();
|
type->set_target_type (sym->type ());
|
||||||
else /* TYPE_CODE_UNDEF */
|
else /* TYPE_CODE_UNDEF */
|
||||||
TYPE_TARGET_TYPE (type) = alloc_type_arch (type->arch ());
|
type->set_target_type (alloc_type_arch (type->arch ()));
|
||||||
}
|
}
|
||||||
type = TYPE_TARGET_TYPE (type);
|
type = TYPE_TARGET_TYPE (type);
|
||||||
|
|
||||||
@ -3582,7 +3582,7 @@ init_complex_type (const char *name, struct type *target_type)
|
|||||||
TYPE_LENGTH (t) = 2 * TYPE_LENGTH (target_type);
|
TYPE_LENGTH (t) = 2 * TYPE_LENGTH (target_type);
|
||||||
t->set_name (name);
|
t->set_name (name);
|
||||||
|
|
||||||
TYPE_TARGET_TYPE (t) = target_type;
|
t->set_target_type (target_type);
|
||||||
TYPE_MAIN_TYPE (target_type)->flds_bnds.complex_type = t;
|
TYPE_MAIN_TYPE (target_type)->flds_bnds.complex_type = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3601,7 +3601,7 @@ init_pointer_type (struct objfile *objfile,
|
|||||||
struct type *t;
|
struct type *t;
|
||||||
|
|
||||||
t = init_type (objfile, TYPE_CODE_PTR, bit, name);
|
t = init_type (objfile, TYPE_CODE_PTR, bit, name);
|
||||||
TYPE_TARGET_TYPE (t) = target_type;
|
t->set_target_type (target_type);
|
||||||
t->set_is_unsigned (true);
|
t->set_is_unsigned (true);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@ -5728,8 +5728,8 @@ copy_type_recursive (struct type *type, htab_t copied_types)
|
|||||||
|
|
||||||
/* Copy pointers to other types. */
|
/* Copy pointers to other types. */
|
||||||
if (TYPE_TARGET_TYPE (type))
|
if (TYPE_TARGET_TYPE (type))
|
||||||
TYPE_TARGET_TYPE (new_type) =
|
new_type->set_target_type
|
||||||
copy_type_recursive (TYPE_TARGET_TYPE (type), copied_types);
|
(copy_type_recursive (TYPE_TARGET_TYPE (type), copied_types));
|
||||||
|
|
||||||
/* Maybe copy the type_specific bits.
|
/* Maybe copy the type_specific bits.
|
||||||
|
|
||||||
@ -5919,7 +5919,7 @@ arch_pointer_type (struct gdbarch *gdbarch,
|
|||||||
struct type *t;
|
struct type *t;
|
||||||
|
|
||||||
t = arch_type (gdbarch, TYPE_CODE_PTR, bit, name);
|
t = arch_type (gdbarch, TYPE_CODE_PTR, bit, name);
|
||||||
TYPE_TARGET_TYPE (t) = target_type;
|
t->set_target_type (target_type);
|
||||||
t->set_is_unsigned (true);
|
t->set_is_unsigned (true);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
@ -968,7 +968,7 @@ struct main_type
|
|||||||
the type.
|
the type.
|
||||||
- Unused otherwise. */
|
- Unused otherwise. */
|
||||||
|
|
||||||
struct type *target_type;
|
struct type *m_target_type;
|
||||||
|
|
||||||
/* * For structure and union types, a description of each field.
|
/* * For structure and union types, a description of each field.
|
||||||
For set and pascal array types, there is one "field",
|
For set and pascal array types, there is one "field",
|
||||||
@ -1081,6 +1081,16 @@ struct type
|
|||||||
return this->field (0).type ();
|
return this->field (0).type ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct type *target_type () const
|
||||||
|
{
|
||||||
|
return this->main_type->m_target_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_target_type (struct type *target_type)
|
||||||
|
{
|
||||||
|
this->main_type->m_target_type = target_type;
|
||||||
|
}
|
||||||
|
|
||||||
void set_index_type (type *index_type)
|
void set_index_type (type *index_type)
|
||||||
{
|
{
|
||||||
this->field (0).set_type (index_type);
|
this->field (0).set_type (index_type);
|
||||||
@ -2087,7 +2097,7 @@ extern void allocate_gnat_aux_type (struct type *);
|
|||||||
allocate_fixed_point_type_info (type))
|
allocate_fixed_point_type_info (type))
|
||||||
|
|
||||||
#define TYPE_MAIN_TYPE(thistype) (thistype)->main_type
|
#define TYPE_MAIN_TYPE(thistype) (thistype)->main_type
|
||||||
#define TYPE_TARGET_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->target_type
|
#define TYPE_TARGET_TYPE(thistype) ((thistype)->target_type ())
|
||||||
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
|
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
|
||||||
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
|
#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
|
||||||
#define TYPE_RVALUE_REFERENCE_TYPE(thistype) (thistype)->rvalue_reference_type
|
#define TYPE_RVALUE_REFERENCE_TYPE(thistype) (thistype)->rvalue_reference_type
|
||||||
|
@ -294,20 +294,20 @@ linux_get_siginfo_type_with_fields (struct gdbarch *gdbarch,
|
|||||||
/* __pid_t */
|
/* __pid_t */
|
||||||
pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (int_type) * TARGET_CHAR_BIT, "__pid_t");
|
TYPE_LENGTH (int_type) * TARGET_CHAR_BIT, "__pid_t");
|
||||||
TYPE_TARGET_TYPE (pid_type) = int_type;
|
pid_type->set_target_type (int_type);
|
||||||
pid_type->set_target_is_stub (true);
|
pid_type->set_target_is_stub (true);
|
||||||
|
|
||||||
/* __uid_t */
|
/* __uid_t */
|
||||||
uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (uint_type) * TARGET_CHAR_BIT, "__uid_t");
|
TYPE_LENGTH (uint_type) * TARGET_CHAR_BIT, "__uid_t");
|
||||||
TYPE_TARGET_TYPE (uid_type) = uint_type;
|
uid_type->set_target_type (uint_type);
|
||||||
uid_type->set_target_is_stub (true);
|
uid_type->set_target_is_stub (true);
|
||||||
|
|
||||||
/* __clock_t */
|
/* __clock_t */
|
||||||
clock_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
clock_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (long_type) * TARGET_CHAR_BIT,
|
TYPE_LENGTH (long_type) * TARGET_CHAR_BIT,
|
||||||
"__clock_t");
|
"__clock_t");
|
||||||
TYPE_TARGET_TYPE (clock_type) = long_type;
|
clock_type->set_target_type (long_type);
|
||||||
clock_type->set_target_is_stub (true);
|
clock_type->set_target_is_stub (true);
|
||||||
|
|
||||||
/* _sifields */
|
/* _sifields */
|
||||||
|
@ -416,23 +416,23 @@ nbsd_get_siginfo_type (struct gdbarch *gdbarch)
|
|||||||
/* pid_t */
|
/* pid_t */
|
||||||
type *pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
type *pid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (int32_type) * char_bits, "pid_t");
|
TYPE_LENGTH (int32_type) * char_bits, "pid_t");
|
||||||
TYPE_TARGET_TYPE (pid_type) = int32_type;
|
pid_type->set_target_type (int32_type);
|
||||||
|
|
||||||
/* uid_t */
|
/* uid_t */
|
||||||
type *uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
type *uid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (uint32_type) * char_bits, "uid_t");
|
TYPE_LENGTH (uint32_type) * char_bits, "uid_t");
|
||||||
TYPE_TARGET_TYPE (uid_type) = uint32_type;
|
uid_type->set_target_type (uint32_type);
|
||||||
|
|
||||||
/* clock_t */
|
/* clock_t */
|
||||||
type *clock_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
type *clock_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (int_type) * char_bits, "clock_t");
|
TYPE_LENGTH (int_type) * char_bits, "clock_t");
|
||||||
TYPE_TARGET_TYPE (clock_type) = int_type;
|
clock_type->set_target_type (int_type);
|
||||||
|
|
||||||
/* lwpid_t */
|
/* lwpid_t */
|
||||||
type *lwpid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
type *lwpid_type = arch_type (gdbarch, TYPE_CODE_TYPEDEF,
|
||||||
TYPE_LENGTH (int32_type) * char_bits,
|
TYPE_LENGTH (int32_type) * char_bits,
|
||||||
"lwpid_t");
|
"lwpid_t");
|
||||||
TYPE_TARGET_TYPE (lwpid_type) = int32_type;
|
lwpid_type->set_target_type (int32_type);
|
||||||
|
|
||||||
/* union sigval */
|
/* union sigval */
|
||||||
type *sigval_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION);
|
type *sigval_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_UNION);
|
||||||
|
@ -1717,7 +1717,7 @@ again:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
type->set_target_is_stub (true);
|
type->set_target_is_stub (true);
|
||||||
TYPE_TARGET_TYPE (type) = xtype;
|
type->set_target_type (xtype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -246,7 +246,7 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
|
|||||||
seh_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
seh_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
||||||
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
||||||
NULL);
|
NULL);
|
||||||
TYPE_TARGET_TYPE (seh_ptr_type) = seh_type;
|
seh_ptr_type->set_target_type (seh_type);
|
||||||
|
|
||||||
append_composite_type_field (seh_type, "next_seh", seh_ptr_type);
|
append_composite_type_field (seh_type, "next_seh", seh_ptr_type);
|
||||||
append_composite_type_field (seh_type, "handler",
|
append_composite_type_field (seh_type, "handler",
|
||||||
@ -267,7 +267,7 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
|
|||||||
peb_ldr_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
peb_ldr_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
||||||
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
||||||
NULL);
|
NULL);
|
||||||
TYPE_TARGET_TYPE (peb_ldr_ptr_type) = peb_ldr_type;
|
peb_ldr_ptr_type->set_target_type (peb_ldr_type);
|
||||||
|
|
||||||
/* struct UNICODE_STRING */
|
/* struct UNICODE_STRING */
|
||||||
uni_str_type = arch_composite_type (gdbarch, "unicode_string",
|
uni_str_type = arch_composite_type (gdbarch, "unicode_string",
|
||||||
@ -337,7 +337,7 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
|
|||||||
peb_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
peb_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
||||||
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
||||||
NULL);
|
NULL);
|
||||||
TYPE_TARGET_TYPE (peb_ptr_type) = peb_type;
|
peb_ptr_type->set_target_type (peb_type);
|
||||||
|
|
||||||
|
|
||||||
/* struct thread information block */
|
/* struct thread information block */
|
||||||
@ -381,7 +381,7 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
|
|||||||
tib_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
tib_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
|
||||||
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
TYPE_LENGTH (void_ptr_type) * TARGET_CHAR_BIT,
|
||||||
NULL);
|
NULL);
|
||||||
TYPE_TARGET_TYPE (tib_ptr_type) = tib_type;
|
tib_ptr_type->set_target_type (tib_type);
|
||||||
|
|
||||||
windows_gdbarch_data->tib_ptr_type = tib_ptr_type;
|
windows_gdbarch_data->tib_ptr_type = tib_ptr_type;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user