reference. Fix endianness bugs.
(cris_reg_struct_has_address): Remove.
(cris_gdbarch_init): Remove set_gdbarch_deprecated_reg_struct_has_addr
and set_gdbarch_deprecated_use_struct_convention calls.
* gdbarch.sh (deprecated_reg_struct_has_addr): Remove.
* gdbarch.c, gdbarch.h: Regenerate.
* infcall.c (call_function_by_hand): Remove handling of
deprecated_reg_struct_has_addr.
doc/ChangeLog:
* gdbint.texi (Target Conditionals): Remove documentation of
and references to DEPRECATED_REG_STRUCT_HAS_ADDR.
+2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * cris-tdep.c (cris_push_dummy_call): Support arguments passed by
+ reference. Fix endianness bugs.
+ (cris_reg_struct_has_address): Remove.
+ (cris_gdbarch_init): Remove set_gdbarch_deprecated_reg_struct_has_addr
+ and set_gdbarch_deprecated_use_struct_convention calls.
+
+ * gdbarch.sh (deprecated_reg_struct_has_addr): Remove.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * infcall.c (call_function_by_hand): Remove handling of
+ deprecated_reg_struct_has_addr.
+
2007-10-11 Daniel Jacobowitz <dan@codesourcery.com>
Kazu Hirata <kazu@codesourcery.com>
/* Data passed by value. Fits in available register(s). */
for (i = 0; i < reg_demand; i++)
{
- regcache_cooked_write_unsigned (regcache, argreg,
- *(unsigned long *) val);
+ regcache_cooked_write (regcache, argreg, val);
argreg++;
val += 4;
}
{
if (argreg <= ARG4_REGNUM)
{
- regcache_cooked_write_unsigned (regcache, argreg,
- *(unsigned long *) val);
+ regcache_cooked_write (regcache, argreg, val);
argreg++;
val += 4;
}
}
else if (len > (2 * 4))
{
- /* FIXME */
- internal_error (__FILE__, __LINE__, _("We don't do this"));
+ /* Data passed by reference. Push copy of data onto stack
+ and pass pointer to this copy as argument. */
+ sp = (sp - len) & ~3;
+ write_memory (sp, val, len);
+
+ if (argreg <= ARG4_REGNUM)
+ {
+ regcache_cooked_write_unsigned (regcache, argreg, sp);
+ argreg++;
+ }
+ else
+ {
+ gdb_byte buf[4];
+ store_unsigned_integer (buf, 4, sp);
+ si = push_stack_item (si, buf, 4);
+ }
}
else
{
return RETURN_VALUE_REGISTER_CONVENTION;
}
-/* Returns 1 if the given type will be passed by pointer rather than
- directly. */
-
-/* In the CRIS ABI, arguments shorter than or equal to 64 bits are passed
- by value. */
-
-static int
-cris_reg_struct_has_addr (int gcc_p, struct type *type)
-{
- return (TYPE_LENGTH (type) > 8);
-}
-
/* Calculates a value that measures how good inst_args constraints an
instruction. It stems from cris_constraint, found in cris-dis.c. */
}
set_gdbarch_return_value (gdbarch, cris_return_value);
- set_gdbarch_deprecated_reg_struct_has_addr (gdbarch,
- cris_reg_struct_has_addr);
- set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention);
set_gdbarch_sp_regnum (gdbarch, 14);
+2007-10-12 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gdbint.texi (Target Conditionals): Remove documentation of
+ and references to DEPRECATED_REG_STRUCT_HAS_ADDR.
+
2007-10-11 Kazu Hirata <kazu@codesourcery.com>
* gdb.texinfo: Mention that inaccessible-by-default is on by
@item int gdbarch_stabs_argument_has_addr (@var{gdbarch}, @var{type})
@findex gdbarch_stabs_argument_has_addr
-@findex DEPRECATED_REG_STRUCT_HAS_ADDR
@anchor{gdbarch_stabs_argument_has_addr} Define this function to return
nonzero if a function argument of type @var{type} is passed by reference
instead of value.
-This method replaces @code{DEPRECATED_REG_STRUCT_HAS_ADDR}
-(@pxref{DEPRECATED_REG_STRUCT_HAS_ADDR}).
-
@item PROCESS_LINENUMBER_HOOK
@findex PROCESS_LINENUMBER_HOOK
A hook defined for XCOFF reading.
Return the name of register @var{regnr} as a string. May return @code{NULL}
to indicate that @var{regnr} is not a valid register.
-@item DEPRECATED_REG_STRUCT_HAS_ADDR (@var{gcc_p}, @var{type})
-@findex DEPRECATED_REG_STRUCT_HAS_ADDR
-@anchor{DEPRECATED_REG_STRUCT_HAS_ADDR}Define this to return 1 if the
-given type will be passed by pointer rather than directly.
-
-This method has been replaced by @code{gdbarch_stabs_argument_has_addr}
-(@pxref{gdbarch_stabs_argument_has_addr}).
-
@item SAVE_DUMMY_FRAME_TOS (@var{sp})
@findex SAVE_DUMMY_FRAME_TOS
@anchor{SAVE_DUMMY_FRAME_TOS} Used in @samp{call_function_by_hand} to
gdbarch_unwind_sp_ftype *unwind_sp;
gdbarch_frame_num_args_ftype *frame_num_args;
gdbarch_frame_align_ftype *frame_align;
- gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
int frame_red_zone_size;
gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
0, /* unwind_sp */
0, /* frame_num_args */
0, /* frame_align */
- 0, /* deprecated_reg_struct_has_addr */
default_stabs_argument_has_addr, /* stabs_argument_has_addr */
0, /* frame_red_zone_size */
convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
/* Skip verify of unwind_sp, has predicate */
/* Skip verify of frame_num_args, has predicate */
/* Skip verify of frame_align, has predicate */
- /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
/* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
/* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
/* Skip verify of addr_bits_remove, invalid_p == 0 */
fprintf_unfiltered (file,
"gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
paddr_nz (current_gdbarch->deprecated_function_start_offset));
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
- gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
- fprintf_unfiltered (file,
- "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
- (long) current_gdbarch->deprecated_reg_struct_has_addr);
fprintf_unfiltered (file,
"gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
(long) current_gdbarch->deprecated_use_struct_convention);
gdbarch->frame_align = frame_align;
}
-int
-gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->deprecated_reg_struct_has_addr != NULL;
-}
-
-int
-gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
- return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
-}
-
-void
-set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
- gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
-{
- gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
-}
-
int
gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
{
extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
-/* deprecated_reg_struct_has_addr has been replaced by
- stabs_argument_has_addr. */
-
-extern int gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch);
-
-typedef int (gdbarch_deprecated_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
-extern int gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
-extern void set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr);
-
typedef int (gdbarch_stabs_argument_has_addr_ftype) (struct gdbarch *gdbarch, struct type *type);
extern int gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type);
extern void set_gdbarch_stabs_argument_has_addr (struct gdbarch *gdbarch, gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr);
F::int:frame_num_args:struct frame_info *frame:frame
#
M::CORE_ADDR:frame_align:CORE_ADDR address:address
-# deprecated_reg_struct_has_addr has been replaced by
-# stabs_argument_has_addr.
-F::int:deprecated_reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type
m::int:stabs_argument_has_addr:struct type *type:type::default_stabs_argument_has_addr::0
v::int:frame_red_zone_size
#
}
}
- if (gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch))
- {
- int i;
- /* This is a machine like the sparc, where we may need to pass a
- pointer to the structure, not the structure itself. */
- for (i = nargs - 1; i >= 0; i--)
- {
- struct type *arg_type = check_typedef (value_type (args[i]));
- if ((TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
- || TYPE_CODE (arg_type) == TYPE_CODE_UNION
- || TYPE_CODE (arg_type) == TYPE_CODE_ARRAY
- || TYPE_CODE (arg_type) == TYPE_CODE_STRING
- || TYPE_CODE (arg_type) == TYPE_CODE_BITSTRING
- || TYPE_CODE (arg_type) == TYPE_CODE_SET
- || (TYPE_CODE (arg_type) == TYPE_CODE_FLT
- && TYPE_LENGTH (arg_type) > 8)
- )
- && gdbarch_deprecated_reg_struct_has_addr
- (current_gdbarch, using_gcc, arg_type))
- {
- CORE_ADDR addr;
- int len; /* = TYPE_LENGTH (arg_type); */
- int aligned_len;
- arg_type = check_typedef (value_enclosing_type (args[i]));
- len = TYPE_LENGTH (arg_type);
-
- aligned_len = len;
- if (gdbarch_inner_than (current_gdbarch, 1, 2))
- {
- /* stack grows downward */
- sp -= aligned_len;
- /* ... so the address of the thing we push is the
- stack pointer after we push it. */
- addr = sp;
- }
- else
- {
- /* The stack grows up, so the address of the thing
- we push is the stack pointer before we push it. */
- addr = sp;
- sp += aligned_len;
- }
- /* Push the structure. */
- write_memory (addr, value_contents_all (args[i]), len);
- /* The value we're going to pass is the address of the
- thing we just pushed. */
- /*args[i] = value_from_longest (lookup_pointer_type (values_type),
- (LONGEST) addr); */
- args[i] = value_from_pointer (lookup_pointer_type (arg_type),
- addr);
- }
- }
- }
-
-
/* Reserve space for the return structure to be written on the
stack, if necessary. Make certain that the value is correctly
aligned. */