Remove CHECK_TYPEDEF, use check_typedef instead

I think that the CHECK_TYPEDEF macro is not necessary, and even a bit
annoying.  It makes unclear the fact that the "type" variables gets
overwritten.  It has actually bitten me a few times.  I think the
following, explicit form, is better.

  type = check_typedef (type);

This patches changes all instances of CHECK_TYPEDEF for an equivalent
call to check_typedef.  The bulk of the change was done with this sed:

  sed -i 's/CHECK_TYPEDEF (\([^)]*\));/\1 = check_typedef (\1);/' <file>.c

The ChangeLog was generated using David Malcom's generate_changelog.py.
I manually fixed those places where it gets the wrong function name,
hopefully all of them.

The patch was built-tested, and I ran a few smoke tests.

gdb/ChangeLog:
	* gdbtypes.h (CHECK_TYPEDEF): Remove.
	* aarch64-tdep.c (aarch64_return_in_memory): Replace CHECK_TYPEDEF
        with check_typedef.
	* ada-lang.c (decode_constrained_packed_array_type): Likewise.
	(ada_array_length): Likewise.
	(find_parallel_type_by_descriptive_type): Likewise.
	(ada_check_typedef): Likewise.
	* arm-tdep.c (arm_return_in_memory): Likewise.
	* ax-gdb.c (gen_trace_static_fields): Likewise.
	(gen_struct_ref_recursive): Likewise.
	* c-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
	(variable: block COLONCOLON name): Likewise.
	(qualified_name: TYPENAME COLONCOLON name): Likewise.
	* c-lang.c (classify_type): Likewise.
	* c-typeprint.c (c_print_type): Likewise.
	(c_print_typedef): Likewise.
	(c_type_print_base): Likewise.
	* c-valprint.c (c_val_print): Likewise.
	* compile/compile-c-types.c (convert_type): Likewise.
	* compile/compile-object-load.c (get_out_value_type): Likewise.
	* completer.c (add_struct_fields): Likewise.
	(expression_completer): Likewise.
	* cp-namespace.c (cp_find_type_baseclass_by_name): Likewise.
	(cp_lookup_nested_symbol_1): Likewise.
	(cp_lookup_nested_symbol): Likewise.
	* cp-valprint.c (cp_print_value_fields): Likewise.
	(cp_print_static_field): Likewise.
	* d-valprint.c (d_val_print): Likewise.
	* eval.c (evaluate_subexp_standard): Likewise.
	(evaluate_subexp_for_sizeof): Likewise.
	* f-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
	* f-typeprint.c (f_type_print_base): Likewise.
	* f-valprint.c (f_val_print): Likewise.
	* gdbtypes.c (get_discrete_bounds): Likewise.
	(create_array_type_with_stride): Likewise.
	(type_name_no_tag_or_error): Likewise.
	(lookup_struct_elt_type): Likewise.
	(get_unsigned_type_max): Likewise.
	(internal_type_vptr_fieldno): Likewise.
	(set_type_vptr_fieldno): Likewise.
	(internal_type_vptr_basetype): Likewise.
	(set_type_vptr_basetype): Likewise.
        (get_vptr_fieldno): Likewise.
	(is_integral_type): Likewise.
	(is_scalar_type): Likewise.
        (is_scalar_type_recursive): Likewise.
	(distance_to_ancestor): Likewise.
	(is_unique_ancestor_worker): Likewise.
	(check_types_equal): Likewise.
	* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
	* gnu-v3-abi.c (gnuv3_dynamic_class): Likewise.
	(gnuv3_get_vtable): Likewise.
	(gnuv3_pass_by_reference): Likewise.
	* go-exp.y (exp : SIZEOF_KEYWORD '(' type ')' %prec UNARY): Likewise.
	* go-lang.c (gccgo_string_p): Likewise.
	(go_classify_struct_type): Likewise.
	* go-typeprint.c (go_print_type): Likewise.
	* go-valprint.c (go_val_print): Likewise.
	* guile/scm-math.c (vlscm_binop): Likewise.
	* guile/scm-value.c (gdbscm_value_dynamic_type): Likewise.
	(gdbscm_value_to_bytevector): Likewise.
	(gdbscm_value_to_bool): Likewise.
	(gdbscm_value_to_integer): Likewise.
	(gdbscm_value_to_real): Likewise.
	* infcall.c (call_function_by_hand_dummy): Likewise.
	* infcmd.c (get_return_value): Likewise.
	* jv-lang.c (is_object_type): Likewise.
	* jv-typeprint.c (java_type_print_base): Likewise.
	* jv-valprint.c (java_print_value_fields): Likewise.
	(java_val_print): Likewise.
	* linespec.c (find_methods): Likewise.
	(collect_one_symbol): Likewise.
	* m2-typeprint.c (m2_print_type): Likewise.
	(m2_print_typedef): Likewise.
	(m2_get_discrete_bounds): Likewise.
	* m2-valprint.c (m2_print_long_set): Likewise.
	(m2_print_unbounded_array): Likewise.
	(m2_print_array_contents): Likewise.
	(m2_val_print): Likewise.
	* opencl-lang.c (opencl_print_type): Likewise.
	* p-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
	* p-typeprint.c (pascal_print_type): Likewise.
	(pascal_print_typedef): Likewise.
	(pascal_type_print_base): Likewise.
	* p-valprint.c (pascal_val_print): Likewise.
	(pascal_object_print_value_fields): Likewise.
	(pascal_object_print_static_field): Likewise.
	* python/py-type.c (typy_fields_items): Likewise.
	(typy_get_composite): Likewise.
	* python/py-value.c (valpy_get_dynamic_type): Likewise.
	(valpy_binop): Likewise.
	(valpy_long): Likewise.
	(valpy_float): Likewise.
	* stack.c (return_command): Likewise.
	* symtab.c (check_field): Likewise.
	(lookup_symbol_aux): Likewise.
	* tic6x-tdep.c (tic6x_return_value): Likewise.
	* typeprint.c (print_type_scalar): Likewise.
	* valarith.c (value_vector_widen): Likewise.
	* valops.c (value_cast): Likewise.
	(value_assign): Likewise.
	(do_search_struct_field): Likewise.
	(search_struct_method): Likewise.
	(find_method_list): Likewise.
	* valprint.c (val_print_scalar_type_p): Likewise.
	(valprint_check_validity): Likewise.
	(generic_val_print): Likewise.
	* value.c (unpack_double): Likewise.
	(value_primitive_field): Likewise.
	(unpack_bits_as_long): Likewise.
This commit is contained in:
Simon Marchi 2015-07-06 16:05:06 -04:00
parent 452802827f
commit f168693bc9
51 changed files with 179 additions and 131 deletions

View file

@ -1,3 +1,56 @@
2015-07-14 Simon Marchi <simon.marchi@ericsson.com>
* gdbtypes.h (CHECK_TYPEDEF): Remove.
* aarch64-tdep.c (aarch64_return_in_memory): Replace CHECK_TYPEDEF
with check_typedef.
* ada-lang.c (decode_constrained_packed_array_type): Likewise.
(ada_array_length): Likewise.
(find_parallel_type_by_descriptive_type): Likewise.
(ada_check_typedef): Likewise.
* arm-tdep.c (arm_return_in_memory): Likewise.
* ax-gdb.c (gen_trace_static_fields): Likewise.
(gen_struct_ref_recursive): Likewise.
* c-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
(variable: block COLONCOLON name): Likewise.
(qualified_name: TYPENAME COLONCOLON name): Likewise.
* c-lang.c (classify_type): Likewise.
* c-typeprint.c (c_print_type): Likewise.
(c_print_typedef): Likewise.
(c_type_print_base): Likewise.
* c-valprint.c (c_val_print): Likewise.
* compile/compile-c-types.c (convert_type): Likewise.
* compile/compile-object-load.c (get_out_value_type): Likewise.
* completer.c (add_struct_fields): Likewise.
(expression_completer): Likewise.
* cp-namespace.c (cp_find_type_baseclass_by_name): Likewise.
(cp_lookup_nested_symbol_1): Likewise.
(cp_lookup_nested_symbol): Likewise.
* cp-valprint.c (cp_print_value_fields): Likewise.
(cp_print_static_field): Likewise.
* d-valprint.c (d_val_print): Likewise.
* eval.c (evaluate_subexp_standard): Likewise.
(evaluate_subexp_for_sizeof): Likewise.
* f-exp.y (exp : SIZEOF '(' type ')' %prec UNARY): Likewise.
* f-typeprint.c (f_type_print_base): Likewise.
* f-valprint.c (f_val_print): Likewise.
* gdbtypes.c (get_discrete_bounds): Likewise.
(create_array_type_with_stride): Likewise.
(type_name_no_tag_or_error): Likewise.
(lookup_struct_elt_type): Likewise.
(get_unsigned_type_max): Likewise.
(internal_type_vptr_fieldno): Likewise.
(set_type_vptr_fieldno): Likewise.
(internal_type_vptr_basetype): Likewise.
(set_type_vptr_basetype): Likewise.
(get_vptr_fieldno): Likewise.
(is_integral_type): Likewise.
(is_scalar_type): Likewise.
(is_scalar_type_recursive): Likewise.
(distance_to_ancestor): Likewise.
(is_unique_ancestor_worker): Likewise.
(check_types_equal): Likewise.
* gnu-v2-abi.c (gnuv2_value_rtti_type): Likewise.
2015-07-14 Iain Buclaw <ibuclaw@gdcproject.org>
* dwarf2read.c (find_slot_in_mapped_hash): Extend language support to

View file

@ -2104,7 +2104,7 @@ aarch64_return_in_memory (struct gdbarch *gdbarch, struct type *type)
int nRc;
enum type_code code;
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* In the AArch64 ABI, "integer" like aggregate types are returned
in registers. For an aggregate type to be integer like, its size

View file

@ -2238,7 +2238,7 @@ decode_constrained_packed_array_type (struct type *type)
lim_warning (_("could not find bounds information on packed array"));
return NULL;
}
CHECK_TYPEDEF (shadow_type);
shadow_type = check_typedef (shadow_type);
if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
{
@ -3056,7 +3056,7 @@ ada_array_length (struct value *arr, int n)
high = value_as_long (desc_one_bound (desc_bounds (arr), n, 1));
}
CHECK_TYPEDEF (arr_type);
arr_type = check_typedef (arr_type);
index_type = TYPE_INDEX_TYPE (arr_type);
if (index_type != NULL)
{
@ -7841,7 +7841,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name)
result = tmp;
else
{
CHECK_TYPEDEF (result);
result = check_typedef (result);
if (HAVE_GNAT_AUX_INFO (result))
result = TYPE_DESCRIPTIVE_TYPE (result);
else
@ -8943,7 +8943,7 @@ ada_check_typedef (struct type *type)
&& is_thick_pntr (ada_typedef_target_type (type)))
return type;
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM
|| !TYPE_STUB (type)
|| TYPE_TAG_NAME (type) == NULL)

View file

@ -9008,7 +9008,7 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type)
int nRc;
enum type_code code;
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* In the ARM ABI, "integer" like aggregate types are returned in
registers. For an aggregate type to be integer like, its size

View file

@ -322,7 +322,7 @@ gen_trace_static_fields (struct gdbarch *gdbarch,
int i, nbases = TYPE_N_BASECLASSES (type);
struct axs_value value;
CHECK_TYPEDEF (type);
type = check_typedef (type);
for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
{
@ -1438,7 +1438,7 @@ gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
int i, rslt;
int nbases = TYPE_N_BASECLASSES (type);
CHECK_TYPEDEF (type);
type = check_typedef (type);
for (i = TYPE_NFIELDS (type) - 1; i >= nbases; i--)
{

View file

@ -793,7 +793,7 @@ exp : SIZEOF '(' type ')' %prec UNARY
(parse_language (pstate),
parse_gdbarch (pstate),
"int"));
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* $5.3.3/2 of the C++ Standard (n3290 draft)
says of sizeof: "When applied to a reference
@ -985,7 +985,7 @@ variable: block COLONCOLON name
qualified_name: TYPENAME COLONCOLON name
{
struct type *type = $1.type;
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (!type_aggregate_p (type))
error (_("`%s' is not defined as an aggregate type."),
TYPE_SAFE_NAME (type));
@ -1001,7 +1001,7 @@ qualified_name: TYPENAME COLONCOLON name
struct stoken tmp_token;
char *buf;
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (!type_aggregate_p (type))
error (_("`%s' is not defined as an aggregate type."),
TYPE_SAFE_NAME (type));

View file

@ -124,7 +124,7 @@ classify_type (struct type *elttype, struct gdbarch *gdbarch,
/* Perhaps check_typedef did not update the target type. In
this case, force the lookup again and hope it works out.
It never will for C, but it might for C++. */
CHECK_TYPEDEF (elttype);
elttype = check_typedef (elttype);
}
}

View file

@ -89,7 +89,7 @@ c_print_type (struct type *type,
const char *local_name;
if (show > 0)
CHECK_TYPEDEF (type);
type = check_typedef (type);
local_name = find_typedef_in_hash (flags, type);
if (local_name != NULL)
@ -144,7 +144,7 @@ c_print_typedef (struct type *type,
struct symbol *new_symbol,
struct ui_file *stream)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
fprintf_filtered (stream, "typedef ");
type_print (type, "", stream, 0);
if (TYPE_NAME ((SYMBOL_TYPE (new_symbol))) == 0
@ -876,7 +876,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
return;
}
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{

View file

@ -488,7 +488,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
{
struct type *unresolved_type = type;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:

View file

@ -383,7 +383,7 @@ convert_type (struct compile_c_instance *context, struct type *type)
/* We don't ever have to deal with typedefs in this code, because
those are only needed as symbols by the C compiler. */
CHECK_TYPEDEF (type);
type = check_typedef (type);
inst.type = type;
found = htab_find (context->type_map, &inst);

View file

@ -474,14 +474,14 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
error (_("No \"%s\" symbol found"), COMPILE_I_EXPR_PTR_TYPE);
gdb_type = SYMBOL_TYPE (gdb_val_sym);
CHECK_TYPEDEF (gdb_type);
gdb_type = check_typedef (gdb_type);
gdb_ptr_type_sym = block_lookup_symbol (block, COMPILE_I_EXPR_PTR_TYPE,
VAR_DOMAIN);
if (gdb_ptr_type_sym == NULL)
error (_("No \"%s\" symbol found"), COMPILE_I_EXPR_PTR_TYPE);
gdb_ptr_type = SYMBOL_TYPE (gdb_ptr_type_sym);
CHECK_TYPEDEF (gdb_ptr_type);
gdb_ptr_type = check_typedef (gdb_ptr_type);
if (TYPE_CODE (gdb_ptr_type) != TYPE_CODE_PTR)
error (_("Type of \"%s\" is not a pointer"), COMPILE_I_EXPR_PTR_TYPE);
gdb_type_from_ptr = TYPE_TARGET_TYPE (gdb_ptr_type);

View file

@ -344,7 +344,7 @@ add_struct_fields (struct type *type, VEC (char_ptr) **output,
int computed_type_name = 0;
const char *type_name = NULL;
CHECK_TYPEDEF (type);
type = check_typedef (type);
for (i = 0; i < TYPE_NFIELDS (type); ++i)
{
if (i < TYPE_N_BASECLASSES (type))
@ -415,7 +415,7 @@ expression_completer (struct cmd_list_element *ignore,
{
for (;;)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
break;

View file

@ -882,7 +882,7 @@ cp_find_type_baseclass_by_name (struct type *parent_type, const char *name)
{
int i;
CHECK_TYPEDEF (parent_type);
parent_type = check_typedef (parent_type);
for (i = 0; i < TYPE_N_BASECLASSES (parent_type); ++i)
{
struct type *type = check_typedef (TYPE_BASECLASS (parent_type, i));
@ -1002,7 +1002,7 @@ cp_lookup_nested_symbol_1 (struct type *container_type,
}
/* If this is a class with baseclasses, search them next. */
CHECK_TYPEDEF (container_type);
container_type = check_typedef (container_type);
if (TYPE_N_BASECLASSES (container_type) > 0)
{
sym = find_symbol_in_baseclass (container_type, nested_name, block,
@ -1029,7 +1029,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
original type. */
struct type *saved_parent_type = parent_type;
CHECK_TYPEDEF (parent_type);
parent_type = check_typedef (parent_type);
if (symbol_lookup_debug)
{

View file

@ -165,7 +165,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
int fields_seen = 0;
static int last_set_recurse = -1;
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (recurse == 0)
{
@ -669,7 +669,7 @@ cp_print_static_field (struct type *type,
addr = value_address (val);
obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
sizeof (CORE_ADDR));
CHECK_TYPEDEF (type);
type = check_typedef (type);
cp_print_value_fields (type, value_enclosing_type (val),
value_contents_for_printing (val),
value_embedded_offset (val), addr,

View file

@ -80,7 +80,7 @@ d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{
int ret;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_STRUCT:

View file

@ -1226,7 +1226,7 @@ evaluate_subexp_standard (struct type *expect_type,
block_for_pc (funaddr);
CHECK_TYPEDEF (val_type);
val_type = check_typedef (val_type);
if ((val_type == NULL)
|| (TYPE_CODE(val_type) == TYPE_CODE_ERROR))
@ -3089,7 +3089,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos,
/* $5.3.3/2 of the C++ Standard (n3290 draft) says of sizeof:
"When applied to a reference or a reference type, the result is
the size of the referenced type." */
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (exp->language_defn->la_language == language_cplus
&& TYPE_CODE (type) == TYPE_CODE_REF)
type = check_typedef (TYPE_TARGET_TYPE (type));

View file

@ -487,7 +487,7 @@ exp : SIZEOF '(' type ')' %prec UNARY
write_exp_elt_type (pstate,
parse_f_type (pstate)
->builtin_integer);
CHECK_TYPEDEF ($3);
$3 = check_typedef ($3);
write_exp_elt_longcst (pstate,
(LONGEST) TYPE_LENGTH ($3));
write_exp_elt_opcode (pstate, OP_LONG); }

View file

@ -273,7 +273,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
}
if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF)
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{

View file

@ -264,7 +264,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
CORE_ADDR addr;
int index;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_STRING:

View file

@ -898,7 +898,7 @@ has_static_range (const struct range_bounds *bounds)
int
get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_RANGE:
@ -1074,7 +1074,7 @@ create_array_type_with_stride (struct type *result_type,
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
low_bound = high_bound = 0;
CHECK_TYPEDEF (element_type);
element_type = check_typedef (element_type);
/* Be careful when setting the array length. Ada arrays can be
empty arrays with the high_bound being smaller than the low_bound.
In such cases, the array length should be zero. */
@ -1383,7 +1383,7 @@ type_name_no_tag_or_error (struct type *type)
const char *name;
struct objfile *objfile;
CHECK_TYPEDEF (type);
type = check_typedef (type);
name = type_name_no_tag (type);
if (name != NULL)
@ -1562,7 +1562,7 @@ lookup_struct_elt_type (struct type *type, const char *name, int noerr)
for (;;)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
break;
@ -1639,7 +1639,7 @@ get_unsigned_type_max (struct type *type, ULONGEST *max)
{
unsigned int n;
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_INT && TYPE_UNSIGNED (type));
gdb_assert (TYPE_LENGTH (type) <= sizeof (ULONGEST));
@ -1656,7 +1656,7 @@ get_signed_type_minmax (struct type *type, LONGEST *min, LONGEST *max)
{
unsigned int n;
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_INT && !TYPE_UNSIGNED (type));
gdb_assert (TYPE_LENGTH (type) <= sizeof (LONGEST));
@ -1675,7 +1675,7 @@ get_signed_type_minmax (struct type *type, LONGEST *min, LONGEST *max)
int
internal_type_vptr_fieldno (struct type *type)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION);
if (!HAVE_CPLUS_STRUCT (type))
@ -1688,7 +1688,7 @@ internal_type_vptr_fieldno (struct type *type)
void
set_type_vptr_fieldno (struct type *type, int fieldno)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION);
if (!HAVE_CPLUS_STRUCT (type))
@ -1702,7 +1702,7 @@ set_type_vptr_fieldno (struct type *type, int fieldno)
struct type *
internal_type_vptr_basetype (struct type *type)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION);
gdb_assert (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_CPLUS_STUFF);
@ -1714,7 +1714,7 @@ internal_type_vptr_basetype (struct type *type)
void
set_type_vptr_basetype (struct type *type, struct type *basetype)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION);
if (!HAVE_CPLUS_STRUCT (type))
@ -1737,7 +1737,7 @@ set_type_vptr_basetype (struct type *type, struct type *basetype)
int
get_vptr_fieldno (struct type *type, struct type **basetypep)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_VPTR_FIELDNO (type) < 0)
{
@ -2679,7 +2679,7 @@ can_dereference (struct type *t)
{
/* FIXME: Should we return true for references as well as
pointers? */
CHECK_TYPEDEF (t);
t = check_typedef (t);
return
(t != NULL
&& TYPE_CODE (t) == TYPE_CODE_PTR
@ -2689,7 +2689,7 @@ can_dereference (struct type *t)
int
is_integral_type (struct type *t)
{
CHECK_TYPEDEF (t);
t = check_typedef (t);
return
((t != NULL)
&& ((TYPE_CODE (t) == TYPE_CODE_INT)
@ -2705,7 +2705,7 @@ is_integral_type (struct type *t)
static int
is_scalar_type (struct type *type)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
@ -2727,7 +2727,7 @@ is_scalar_type (struct type *type)
int
is_scalar_type_recursive (struct type *t)
{
CHECK_TYPEDEF (t);
t = check_typedef (t);
if (is_scalar_type (t))
return 1;
@ -2809,8 +2809,8 @@ distance_to_ancestor (struct type *base, struct type *dclass, int is_public)
int i;
int d;
CHECK_TYPEDEF (base);
CHECK_TYPEDEF (dclass);
base = check_typedef (base);
dclass = check_typedef (dclass);
if (class_types_same_p (base, dclass))
return 0;
@ -2859,8 +2859,8 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass,
{
int i, count = 0;
CHECK_TYPEDEF (base);
CHECK_TYPEDEF (dclass);
base = check_typedef (base);
dclass = check_typedef (dclass);
for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i)
{
@ -3179,8 +3179,8 @@ static int
check_types_equal (struct type *type1, struct type *type2,
VEC (type_equality_entry_d) **worklist)
{
CHECK_TYPEDEF (type1);
CHECK_TYPEDEF (type2);
type1 = check_typedef (type1);
type2 = check_typedef (type2);
if (type1 == type2)
return 1;

View file

@ -1814,11 +1814,6 @@ extern void add_dyn_prop
extern struct type *check_typedef (struct type *);
#define CHECK_TYPEDEF(TYPE) \
do { \
(TYPE) = check_typedef (TYPE); \
} while (0)
extern void check_stub_method_group (struct type *, int);
extern char *gdb_mangle_name (struct type *, int, int);

View file

@ -204,7 +204,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
/* Get declared type. */
known_type = value_type (v);
CHECK_TYPEDEF (known_type);
known_type = check_typedef (known_type);
/* RTTI works only or class objects. */
if (TYPE_CODE (known_type) != TYPE_CODE_STRUCT)
return NULL;
@ -225,7 +225,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
/* Make sure our basetype and known type match, otherwise, cast
so we can get at the vtable properly. */
btype = known_type_vptr_basetype;
CHECK_TYPEDEF (btype);
btype = check_typedef (btype);
if (btype != known_type )
{
v = value_cast (btype, v);

View file

@ -202,7 +202,7 @@ gnuv3_dynamic_class (struct type *type)
{
int fieldnum, fieldelem;
CHECK_TYPEDEF (type);
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION);
@ -253,7 +253,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch,
struct value *vtable_pointer;
CORE_ADDR vtable_address;
CHECK_TYPEDEF (container_type);
container_type = check_typedef (container_type);
gdb_assert (TYPE_CODE (container_type) == TYPE_CODE_STRUCT);
/* If this type does not have a virtual table, don't read the first
@ -1293,7 +1293,7 @@ gnuv3_pass_by_reference (struct type *type)
{
int fieldnum, fieldelem;
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* We're only interested in things that can have methods. */
if (TYPE_CODE (type) != TYPE_CODE_STRUCT

View file

@ -508,7 +508,7 @@ exp : SIZEOF_KEYWORD '(' type ')' %prec UNARY
write_exp_elt_type
(pstate,
parse_type (pstate)->builtin_unsigned_int);
CHECK_TYPEDEF ($3);
$3 = check_typedef ($3);
write_exp_elt_longcst (pstate,
(LONGEST) TYPE_LENGTH ($3));
write_exp_elt_opcode (pstate, OP_LONG);

View file

@ -77,8 +77,8 @@ gccgo_string_p (struct type *type)
struct type *type0 = TYPE_FIELD_TYPE (type, 0);
struct type *type1 = TYPE_FIELD_TYPE (type, 1);
CHECK_TYPEDEF (type0);
CHECK_TYPEDEF (type1);
type0 = check_typedef (type0);
type1 = check_typedef (type1);
if (TYPE_CODE (type0) == TYPE_CODE_PTR
&& strcmp (TYPE_FIELD_NAME (type, 0), "__data") == 0
@ -87,7 +87,7 @@ gccgo_string_p (struct type *type)
{
struct type *target_type = TYPE_TARGET_TYPE (type0);
CHECK_TYPEDEF (target_type);
target_type = check_typedef (target_type);
if (TYPE_CODE (target_type) == TYPE_CODE_INT
&& TYPE_LENGTH (target_type) == 1
@ -119,7 +119,7 @@ sixg_string_p (struct type *type)
enum go_type
go_classify_struct_type (struct type *type)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* Recognize strings as they're useful to be able to print without
pretty-printers. */

View file

@ -48,7 +48,7 @@ go_print_type (struct type *type, const char *varstring,
{
/* Borrowed from c-typeprint.c. */
if (show > 0)
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* Print the type of "abc" as "string", not char[4]. */
if (TYPE_CODE (type) == TYPE_CODE_ARRAY

View file

@ -91,7 +91,7 @@ go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
const struct value *val,
const struct value_print_options *options)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{

View file

@ -186,9 +186,9 @@ vlscm_binop (enum valscm_binary_opcode opcode, SCM x, SCM y,
struct type *ltype = value_type (arg1);
struct type *rtype = value_type (arg2);
CHECK_TYPEDEF (ltype);
ltype = check_typedef (ltype);
ltype = STRIP_REFERENCE (ltype);
CHECK_TYPEDEF (rtype);
rtype = check_typedef (rtype);
rtype = STRIP_REFERENCE (rtype);
if (TYPE_CODE (ltype) == TYPE_CODE_PTR
@ -206,9 +206,9 @@ vlscm_binop (enum valscm_binary_opcode opcode, SCM x, SCM y,
struct type *ltype = value_type (arg1);
struct type *rtype = value_type (arg2);
CHECK_TYPEDEF (ltype);
ltype = check_typedef (ltype);
ltype = STRIP_REFERENCE (ltype);
CHECK_TYPEDEF (rtype);
rtype = check_typedef (rtype);
rtype = STRIP_REFERENCE (rtype);
if (TYPE_CODE (ltype) == TYPE_CODE_PTR

View file

@ -581,7 +581,7 @@ gdbscm_value_dynamic_type (SCM self)
= make_cleanup_value_free_to_mark (value_mark ());
type = value_type (value);
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (((TYPE_CODE (type) == TYPE_CODE_PTR)
|| (TYPE_CODE (type) == TYPE_CODE_REF))
@ -906,7 +906,7 @@ gdbscm_value_to_bytevector (SCM self)
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
length = TYPE_LENGTH (type);
contents = value_contents (value);
}
@ -950,7 +950,7 @@ gdbscm_value_to_bool (SCM self)
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
}
CATCH (except, RETURN_MASK_ALL)
{
@ -993,7 +993,7 @@ gdbscm_value_to_integer (SCM self)
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
}
CATCH (except, RETURN_MASK_ALL)
{
@ -1039,7 +1039,7 @@ gdbscm_value_to_real (SCM self)
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
}
CATCH (except, RETURN_MASK_ALL)
{

View file

@ -757,7 +757,7 @@ call_function_by_hand_dummy (struct value *function,
if (!values_type)
values_type = builtin_type (gdbarch)->builtin_int;
CHECK_TYPEDEF (values_type);
values_type = check_typedef (values_type);
/* Are we returning a value using a structure return (passing a
hidden argument pointing to storage) or a normal value return?

View file

@ -1530,7 +1530,7 @@ get_return_value (struct value *function, struct type *value_type,
gdbarch = get_regcache_arch (stop_regs);
CHECK_TYPEDEF (value_type);
value_type = check_typedef (value_type);
gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
/* FIXME: 2003-09-27: When returning from a nested inferior function

View file

@ -610,7 +610,7 @@ get_java_object_header_size (struct gdbarch *gdbarch)
int
is_object_type (struct type *type)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_CODE (type) == TYPE_CODE_PTR)
{
struct type *ttype = check_typedef (TYPE_TARGET_TYPE (type));

View file

@ -110,7 +110,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
return;
}
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{

View file

@ -273,7 +273,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
int i, len, n_baseclasses;
CHECK_TYPEDEF (type);
type = check_typedef (type);
fprintf_filtered (stream, "{");
len = TYPE_NFIELDS (type);
@ -462,7 +462,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
struct type *target_type;
CORE_ADDR addr;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_PTR:

View file

@ -1129,7 +1129,7 @@ find_methods (struct type *t, const char *name,
{
int method_counter;
CHECK_TYPEDEF (t);
t = check_typedef (t);
/* Loop over each method name. At this level, all overloads of a name
are counted as a single name. There is an inner loop which loops over
@ -2717,7 +2717,7 @@ collect_one_symbol (struct symbol *sym, void *d)
return 1; /* Continue iterating. */
t = SYMBOL_TYPE (sym);
CHECK_TYPEDEF (t);
t = check_typedef (t);
if (TYPE_CODE (t) != TYPE_CODE_STRUCT
&& TYPE_CODE (t) != TYPE_CODE_UNION
&& TYPE_CODE (t) != TYPE_CODE_NAMESPACE)

View file

@ -74,7 +74,7 @@ m2_print_type (struct type *type, const char *varstring,
int show, int level,
const struct type_print_options *flags)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
QUIT;
@ -160,7 +160,7 @@ void
m2_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
fprintf_filtered (stream, "TYPE ");
if (!TYPE_NAME (SYMBOL_TYPE (new_symbol))
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new_symbol))),
@ -373,7 +373,7 @@ m2_is_long_set (struct type *type)
static int
m2_get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_CHAR:

View file

@ -81,7 +81,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
struct type *target;
int bitval;
CHECK_TYPEDEF (type);
type = check_typedef (type);
fprintf_filtered (stream, "{");
len = TYPE_NFIELDS (type);
@ -167,7 +167,7 @@ m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
LONGEST len;
struct value *val;
CHECK_TYPEDEF (type);
type = check_typedef (type);
content_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));
addr = unpack_pointer (TYPE_FIELD_TYPE (type, 0),
@ -268,7 +268,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
const struct value_print_options *options,
int len)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_LENGTH (type) > 0)
{
@ -319,7 +319,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
struct type *elttype;
CORE_ADDR addr;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
@ -406,7 +406,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_SET:
elttype = TYPE_INDEX_TYPE (type);
CHECK_TYPEDEF (elttype);
elttype = check_typedef (elttype);
if (TYPE_STUB (elttype))
{
fprintf_filtered (stream, _("<incomplete type>"));

View file

@ -1007,7 +1007,7 @@ opencl_print_type (struct type *type, const char *varstring,
be printed using their TYPE_NAME. */
if (show > 0)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type)
&& TYPE_NAME (type) != NULL)
show = 0;

View file

@ -596,7 +596,7 @@ exp : SIZEOF '(' type ')' %prec UNARY
write_exp_elt_type (pstate,
parse_type (pstate)->builtin_int);
current_type = parse_type (pstate)->builtin_int;
CHECK_TYPEDEF ($3);
$3 = check_typedef ($3);
write_exp_elt_longcst (pstate,
(LONGEST) TYPE_LENGTH ($3));
write_exp_elt_opcode (pstate, OP_LONG); }

View file

@ -55,7 +55,7 @@ pascal_print_type (struct type *type, const char *varstring,
code = TYPE_CODE (type);
if (show > 0)
CHECK_TYPEDEF (type);
type = check_typedef (type);
if ((code == TYPE_CODE_FUNC
|| code == TYPE_CODE_METHOD))
@ -96,7 +96,7 @@ void
pascal_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
fprintf_filtered (stream, "type ");
fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
type_print (type, "", stream, 0);
@ -479,7 +479,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
return;
}
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{

View file

@ -74,7 +74,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
CORE_ADDR addr;
int want_space = 0;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
@ -336,7 +336,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
case TYPE_CODE_SET:
elttype = TYPE_INDEX_TYPE (type);
CHECK_TYPEDEF (elttype);
elttype = check_typedef (elttype);
if (TYPE_STUB (elttype))
{
fprintf_filtered (stream, "<incomplete type>");
@ -537,7 +537,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
int i, len, n_baseclasses;
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
CHECK_TYPEDEF (type);
type = check_typedef (type);
fprintf_filtered (stream, "{");
len = TYPE_NFIELDS (type);
@ -872,7 +872,7 @@ pascal_object_print_static_field (struct value *val,
obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
sizeof (CORE_ADDR));
CHECK_TYPEDEF (type);
type = check_typedef (type);
pascal_object_print_value_fields (type,
value_contents_for_printing (val),
value_embedded_offset (val),

View file

@ -346,7 +346,7 @@ typy_fields_items (PyObject *self, enum gdbpy_iter_kind kind)
TRY
{
CHECK_TYPEDEF (checked_type);
checked_type = check_typedef (checked_type);
}
CATCH (except, RETURN_MASK_ALL)
{
@ -477,7 +477,7 @@ typy_get_composite (struct type *type)
{
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
}
CATCH (except, RETURN_MASK_ALL)
{

View file

@ -356,7 +356,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
struct cleanup *cleanup = make_cleanup_value_free_to_mark (value_mark ());
type = value_type (val);
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (((TYPE_CODE (type) == TYPE_CODE_PTR)
|| (TYPE_CODE (type) == TYPE_CODE_REF))
@ -1059,9 +1059,9 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
struct type *ltype = value_type (arg1);
struct type *rtype = value_type (arg2);
CHECK_TYPEDEF (ltype);
ltype = check_typedef (ltype);
ltype = STRIP_REFERENCE (ltype);
CHECK_TYPEDEF (rtype);
rtype = check_typedef (rtype);
rtype = STRIP_REFERENCE (rtype);
handled = 1;
@ -1083,9 +1083,9 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
struct type *ltype = value_type (arg1);
struct type *rtype = value_type (arg2);
CHECK_TYPEDEF (ltype);
ltype = check_typedef (ltype);
ltype = STRIP_REFERENCE (ltype);
CHECK_TYPEDEF (rtype);
rtype = check_typedef (rtype);
rtype = STRIP_REFERENCE (rtype);
handled = 1;
@ -1474,7 +1474,7 @@ valpy_long (PyObject *self)
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (!is_integral_type (type)
&& TYPE_CODE (type) != TYPE_CODE_PTR)
@ -1501,7 +1501,7 @@ valpy_float (PyObject *self)
TRY
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_CODE (type) != TYPE_CODE_FLT)
error (_("Cannot convert value to float."));

View file

@ -2415,7 +2415,7 @@ return_command (char *retval_exp, int from_tty)
return_type = value_type (return_value);
}
do_cleanups (old_chain);
CHECK_TYPEDEF (return_type);
return_type = check_typedef (return_type);
return_value = value_cast (return_type, return_value);
/* Make sure the value is fully evaluated. It may live in the

View file

@ -2030,7 +2030,7 @@ check_field (struct type *type, const char *name,
int i;
/* The type may be a stub. */
CHECK_TYPEDEF (type);
type = check_typedef (type);
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
@ -2133,7 +2133,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
/* I'm not really sure that type of this can ever
be typedefed; just be safe. */
CHECK_TYPEDEF (t);
t = check_typedef (t);
if (TYPE_CODE (t) == TYPE_CODE_PTR
|| TYPE_CODE (t) == TYPE_CODE_REF)
t = TYPE_TARGET_TYPE (t);

View file

@ -807,7 +807,7 @@ tic6x_return_value (struct gdbarch *gdbarch, struct value *function,
{
if (type != NULL)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (language_pass_by_reference (type))
return RETURN_VALUE_STRUCT_CONVENTION;
}

View file

@ -524,7 +524,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
unsigned int i;
unsigned len;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{

View file

@ -1391,7 +1391,7 @@ value_vector_widen (struct value *scalar_value, struct type *vector_type)
LONGEST low_bound, high_bound;
int i;
CHECK_TYPEDEF (vector_type);
vector_type = check_typedef (vector_type);
gdb_assert (TYPE_CODE (vector_type) == TYPE_CODE_ARRAY
&& TYPE_VECTOR (vector_type));

View file

@ -381,7 +381,7 @@ value_cast (struct type *type, struct value *arg2)
/* We deref the value and then do the cast. */
return value_cast (type, coerce_ref (arg2));
CHECK_TYPEDEF (type);
type = check_typedef (type);
code1 = TYPE_CODE (type);
arg2 = coerce_ref (arg2);
type2 = check_typedef (value_type (arg2));
@ -1012,7 +1012,7 @@ value_assign (struct value *toval, struct value *fromval)
fromval = coerce_array (fromval);
}
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* Since modifying a register can trash the frame chain, and
modifying memory can trash the frame cache, we save the old frame
@ -1802,7 +1802,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset,
int i;
int nbases;
CHECK_TYPEDEF (type);
type = check_typedef (type);
nbases = TYPE_N_BASECLASSES (type);
if (!looking_for_baseclass)
@ -1983,7 +1983,7 @@ search_struct_method (const char *name, struct value **arg1p,
int name_matched = 0;
char dem_opname[64];
CHECK_TYPEDEF (type);
type = check_typedef (type);
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
{
const char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
@ -2285,7 +2285,7 @@ find_method_list (struct value **argp, const char *method,
VEC (xmethod_worker_ptr) *worker_vec = NULL, *new_vec = NULL;
gdb_assert (fn_list != NULL && xm_worker_vec != NULL);
CHECK_TYPEDEF (type);
type = check_typedef (type);
/* First check in object itself.
This function is called recursively to search through base classes.

View file

@ -274,11 +274,11 @@ show_symbol_print (struct ui_file *file, int from_tty,
int
val_print_scalar_type_p (struct type *type)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
while (TYPE_CODE (type) == TYPE_CODE_REF)
{
type = TYPE_TARGET_TYPE (type);
CHECK_TYPEDEF (type);
type = check_typedef (type);
}
switch (TYPE_CODE (type))
{
@ -301,7 +301,7 @@ valprint_check_validity (struct ui_file *stream,
int embedded_offset,
const struct value *val)
{
CHECK_TYPEDEF (type);
type = check_typedef (type);
if (TYPE_CODE (type) != TYPE_CODE_UNION
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
@ -386,7 +386,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
LONGEST val;
CORE_ADDR addr;
CHECK_TYPEDEF (type);
type = check_typedef (type);
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:

View file

@ -2852,7 +2852,7 @@ unpack_double (struct type *type, const gdb_byte *valaddr, int *invp)
int nosign;
*invp = 0; /* Assume valid. */
CHECK_TYPEDEF (type);
type = check_typedef (type);
code = TYPE_CODE (type);
len = TYPE_LENGTH (type);
nosign = TYPE_UNSIGNED (type);
@ -2993,7 +2993,7 @@ value_primitive_field (struct value *arg1, int offset,
struct value *v;
struct type *type;
CHECK_TYPEDEF (arg_type);
arg_type = check_typedef (arg_type);
type = TYPE_FIELD_TYPE (arg_type, fieldno);
/* Call check_typedef on our type to make sure that, if TYPE
@ -3195,7 +3195,7 @@ unpack_bits_as_long (struct type *field_type, const gdb_byte *valaddr,
/* Read the minimum number of bytes required; there may not be
enough bytes to read an entire ULONGEST. */
CHECK_TYPEDEF (field_type);
field_type = check_typedef (field_type);
if (bitsize)
bytes_read = ((bitpos % 8) + bitsize + 7) / 8;
else