2004-11-12 Andrew Cagney <cagney@gnu.org>

* sparc-tdep.c: Replace VALUE_TYPE with value_type.
	* v850-tdep.c, sparc64-tdep.c, sh-tdep.c: Ditto.
	* sh64-tdep.c, s390-tdep.c, mcore-tdep.c: Ditto.
	* h8300-tdep.c, arm-linux-tdep.c, amd64-tdep.c: Ditto.
	* hppa-tdep.c, mips-tdep.c, m88k-tdep.c: Ditto.
	* m68hc11-tdep.c, m32r-tdep.c, ia64-tdep.c: Ditto.
	* frv-tdep.c, cris-tdep.c, avr-tdep.c, alpha-tdep.c: Ditto.
This commit is contained in:
Andrew Cagney 2004-11-13 02:15:33 +00:00
parent 9ee8fc9d71
commit 4991999e35
21 changed files with 57 additions and 49 deletions

View file

@ -1,5 +1,13 @@
2004-11-12 Andrew Cagney <cagney@gnu.org>
* sparc-tdep.c: Replace VALUE_TYPE with value_type.
* v850-tdep.c, sparc64-tdep.c, sh-tdep.c: Ditto.
* sh64-tdep.c, s390-tdep.c, mcore-tdep.c: Ditto.
* h8300-tdep.c, arm-linux-tdep.c, amd64-tdep.c: Ditto.
* hppa-tdep.c, mips-tdep.c, m88k-tdep.c: Ditto.
* m68hc11-tdep.c, m32r-tdep.c, ia64-tdep.c: Ditto.
* frv-tdep.c, cris-tdep.c, avr-tdep.c, alpha-tdep.c: Ditto.
Merge VALUE_REGNO and VALUE_FRAME_REGNUM into VALUE_REGNUM.
* value.h (VALUE_REGNO, VALUE_FRAME_REGNUM): Delete.
(VALUE_REGNUM): Define.

View file

@ -283,7 +283,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (i = 0, m_arg = alpha_args; i < nargs; i++, m_arg++)
{
struct value *arg = args[i];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
struct type *arg_type = check_typedef (value_type (arg));
/* Cast argument to long if necessary as the compiler does it too. */
switch (TYPE_CODE (arg_type))

View file

@ -548,7 +548,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
enum amd64_reg_class class[2];
int needed_integer_regs = 0;
@ -629,7 +629,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
/* Write out the arguments to the stack. */
for (i = 0; i < num_stack_args; i++)
{
struct type *type = VALUE_TYPE (stack_args[i]);
struct type *type = value_type (stack_args[i]);
char *valbuf = VALUE_CONTENTS (stack_args[i]);
int len = TYPE_LENGTH (type);

View file

@ -110,7 +110,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int len;
struct type *arg_type;
arg_type = check_typedef (VALUE_TYPE (args[argnum]));
arg_type = check_typedef (value_type (args[argnum]));
len = TYPE_LENGTH (arg_type);
/* ANSI C code passes float arguments as integers, K&R code
@ -149,7 +149,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
enum type_code typecode;
struct type *arg_type, *target_type;
arg_type = check_typedef (VALUE_TYPE (args[argnum]));
arg_type = check_typedef (value_type (args[argnum]));
target_type = TYPE_TARGET_TYPE (arg_type);
len = TYPE_LENGTH (arg_type);
typecode = TYPE_CODE (arg_type);

View file

@ -1172,7 +1172,7 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int last_regnum;
int j;
struct value *arg = args[i];
struct type *type = check_typedef (VALUE_TYPE (arg));
struct type *type = check_typedef (value_type (arg));
char *contents = VALUE_CONTENTS (arg);
int len = TYPE_LENGTH (type);

View file

@ -755,7 +755,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int reg_demand;
int i;
len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
len = TYPE_LENGTH (value_type (args[argnum]));
val = (char *) VALUE_CONTENTS (args[argnum]);
/* How may registers worth of storage do we need for this argument? */

View file

@ -1139,7 +1139,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
stack_space = 0;
for (argnum = 0; argnum < nargs; ++argnum)
stack_space += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])), 4);
stack_space += align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
stack_space -= (6 * 4);
if (stack_space > 0)
@ -1159,7 +1159,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (argnum = 0; argnum < nargs; ++argnum)
{
arg = args[argnum];
arg_type = check_typedef (VALUE_TYPE (arg));
arg_type = check_typedef (value_type (arg));
len = TYPE_LENGTH (arg_type);
typecode = TYPE_CODE (arg_type);

View file

@ -644,7 +644,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Now make sure there's space on the stack for the arguments. We
may over-allocate a little here, but that won't hurt anything. */
for (argument = 0; argument < nargs; argument++)
stack_alloc += align_up (TYPE_LENGTH (VALUE_TYPE (args[argument])),
stack_alloc += align_up (TYPE_LENGTH (value_type (args[argument])),
wordsize);
sp -= stack_alloc;
@ -658,7 +658,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (argument = 0; argument < nargs; argument++)
{
struct type *type = VALUE_TYPE (args[argument]);
struct type *type = value_type (args[argument]);
int len = TYPE_LENGTH (type);
char *contents = (char *) VALUE_CONTENTS (args[argument]);

View file

@ -758,7 +758,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
struct type *type = check_typedef (VALUE_TYPE (arg));
struct type *type = check_typedef (value_type (arg));
/* The corresponding parameter that is pushed onto the
stack, and [possibly] passed in a register. */
char param_val[8];
@ -922,7 +922,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
struct type *type = check_typedef (VALUE_TYPE (arg));
struct type *type = check_typedef (value_type (arg));
if ((TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_ENUM)
&& TYPE_LENGTH (type) <= 8)

View file

@ -3043,7 +3043,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (argno = 0; argno < nargs; argno++)
{
arg = args[argno];
type = check_typedef (VALUE_TYPE (arg));
type = check_typedef (value_type (arg));
len = TYPE_LENGTH (type);
if ((nslots & 1) && slot_alignment_is_next_even (type))
@ -3098,7 +3098,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct type *float_elt_type;
arg = args[argno];
type = check_typedef (VALUE_TYPE (arg));
type = check_typedef (value_type (arg));
len = TYPE_LENGTH (type);
/* Special handling for function parameters. */

View file

@ -702,12 +702,12 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Now make sure there's space on the stack */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
stack_alloc += ((TYPE_LENGTH (value_type (args[argnum])) + 3) & ~3);
sp -= stack_alloc; /* make room on stack for args */
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
{
type = VALUE_TYPE (args[argnum]);
type = value_type (args[argnum]);
typecode = TYPE_CODE (type);
len = TYPE_LENGTH (type);

View file

@ -1195,7 +1195,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
}
else if (nargs > 0)
{
type = VALUE_TYPE (args[0]);
type = value_type (args[0]);
len = TYPE_LENGTH (type);
/* First argument is passed in D and X registers. */
@ -1217,7 +1217,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (argnum = nargs - 1; argnum >= first_stack_argnum; argnum--)
{
type = VALUE_TYPE (args[argnum]);
type = value_type (args[argnum]);
len = TYPE_LENGTH (type);
if (len & 1)

View file

@ -266,13 +266,13 @@ m88k_store_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
if (m88k_integral_or_pointer_p (type) && len < 4)
{
args[i] = value_cast (builtin_type_int32, args[i]);
type = VALUE_TYPE (args[i]);
type = value_type (args[i]);
len = TYPE_LENGTH (type);
}
@ -307,7 +307,7 @@ m88k_store_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
char *valbuf = VALUE_CONTENTS (args[i]);
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
int stack_word = num_stack_words;

View file

@ -823,8 +823,8 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
for (argnum = 0; argnum < nargs; argnum++)
{
char *val = (char *) VALUE_CONTENTS (args[argnum]);
int len = TYPE_LENGTH (VALUE_TYPE (args[argnum]));
struct type *type = VALUE_TYPE (args[argnum]);
int len = TYPE_LENGTH (value_type (args[argnum]));
struct type *type = value_type (args[argnum]);
int olen;
mcore_insn_debug (("MCORE PUSH: argreg=%d; len=%d; %s\n",
@ -866,7 +866,7 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Any remainder for the stack is noted below... */
}
else if (TYPE_CODE (VALUE_TYPE (args[argnum])) != TYPE_CODE_STRUCT
else if (TYPE_CODE (value_type (args[argnum])) != TYPE_CODE_STRUCT
&& len > DEPRECATED_REGISTER_SIZE)
{
/* All subsequent args go onto the stack. */

View file

@ -2401,7 +2401,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
than necessary for EABI, because the first few arguments are
passed in registers, but that's OK. */
for (argnum = 0; argnum < nargs; argnum++)
len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
len += align_up (TYPE_LENGTH (value_type (args[argnum])),
mips_stack_argsize (gdbarch));
sp -= align_up (len, 16);
@ -2432,7 +2432,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
char *val;
char valbuf[MAX_REGISTER_SIZE];
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
struct type *arg_type = check_typedef (value_type (arg));
int len = TYPE_LENGTH (arg_type);
enum type_code typecode = TYPE_CODE (arg_type);
@ -2684,7 +2684,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
len += align_up (TYPE_LENGTH (value_type (args[argnum])),
mips_stack_argsize (gdbarch));
sp -= align_up (len, 16);
@ -2714,7 +2714,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
char *val;
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
struct type *arg_type = check_typedef (value_type (arg));
int len = TYPE_LENGTH (arg_type);
enum type_code typecode = TYPE_CODE (arg_type);
@ -3023,7 +3023,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
len += align_up (TYPE_LENGTH (value_type (args[argnum])),
mips_stack_argsize (gdbarch));
sp -= align_up (len, 16);
@ -3054,7 +3054,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
char *val;
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
struct type *arg_type = check_typedef (value_type (arg));
int len = TYPE_LENGTH (arg_type);
enum type_code typecode = TYPE_CODE (arg_type);
@ -3477,7 +3477,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
len += align_up (TYPE_LENGTH (value_type (args[argnum])),
mips_stack_argsize (gdbarch));
sp -= align_up (len, 16);
@ -3508,7 +3508,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
char *val;
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (VALUE_TYPE (arg));
struct type *arg_type = check_typedef (value_type (arg));
int len = TYPE_LENGTH (arg_type);
enum type_code typecode = TYPE_CODE (arg_type);

View file

@ -2428,7 +2428,7 @@ s390_function_arg_integer (struct type *type)
static LONGEST
extend_simple_arg (struct value *arg)
{
struct type *type = VALUE_TYPE (arg);
struct type *type = value_type (arg);
/* Even structs get passed in the least significant bits of the
register / memory word. It's not really right to extract them as
@ -2511,7 +2511,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
struct type *type = VALUE_TYPE (arg);
struct type *type = value_type (arg);
unsigned length = TYPE_LENGTH (type);
if (s390_function_arg_pass_by_reference (type))
@ -2552,7 +2552,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
struct type *type = VALUE_TYPE (arg);
struct type *type = value_type (arg);
unsigned length = TYPE_LENGTH (type);
if (s390_function_arg_pass_by_reference (type))

View file

@ -890,7 +890,7 @@ sh_stack_allocsize (int nargs, struct value **args)
{
int stack_alloc = 0;
while (nargs-- > 0)
stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[nargs])) + 3) & ~3);
stack_alloc += ((TYPE_LENGTH (value_type (args[nargs])) + 3) & ~3);
return stack_alloc;
}
@ -1045,7 +1045,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
in four registers available. Loop thru args from first to last. */
for (argnum = 0; argnum < nargs; argnum++)
{
type = VALUE_TYPE (args[argnum]);
type = value_type (args[argnum]);
len = TYPE_LENGTH (type);
val = sh_justify_value_in_reg (args[argnum], len);
@ -1151,7 +1151,7 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
in four registers available. Loop thru args from first to last. */
for (argnum = 0; argnum < nargs; argnum++)
{
type = VALUE_TYPE (args[argnum]);
type = value_type (args[argnum]);
len = TYPE_LENGTH (type);
val = sh_justify_value_in_reg (args[argnum], len);

View file

@ -1494,7 +1494,7 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Now make sure there's space on the stack */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 7) & ~7);
stack_alloc += ((TYPE_LENGTH (value_type (args[argnum])) + 7) & ~7);
sp -= stack_alloc; /* make room on stack for args */
/* Now load as many as possible of the first arguments into
@ -1507,7 +1507,7 @@ sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
{
type = VALUE_TYPE (args[argnum]);
type = value_type (args[argnum]);
len = TYPE_LENGTH (type);
memset (valbuf, 0, sizeof (valbuf));

View file

@ -368,7 +368,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
if (sparc_structure_or_union_p (type)
@ -417,7 +417,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
char *valbuf = VALUE_CONTENTS (args[i]);
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
gdb_assert (len == 4 || len == 8);

View file

@ -755,7 +755,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
if (sparc64_structure_or_union_p (type))
@ -854,7 +854,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
for (i = 0; i < nargs; i++)
{
char *valbuf = VALUE_CONTENTS (args[i]);
struct type *type = VALUE_TYPE (args[i]);
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
int regnum = -1;
char buf[16];

View file

@ -929,7 +929,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
len += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
len += ((TYPE_LENGTH (value_type (args[argnum])) + 3) & ~3);
sp -= len + stack_offset; /* possibly over-allocating, but it works... */
/* (you might think we could allocate 16 bytes */
/* less, but the ABI seems to use it all! ) */
@ -948,8 +948,8 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
char *val;
char valbuf[v850_register_raw_size (E_ARG0_REGNUM)];
if (!v850_type_is_scalar (VALUE_TYPE (*args))
&& TYPE_LENGTH (VALUE_TYPE (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS)
if (!v850_type_is_scalar (value_type (*args))
&& TYPE_LENGTH (value_type (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS)
{
store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (*args));
len = 4;
@ -957,7 +957,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
}
else
{
len = TYPE_LENGTH (VALUE_TYPE (*args));
len = TYPE_LENGTH (value_type (*args));
val = (char *) VALUE_CONTENTS (*args);
}