diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-12 15:30:05 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-10-12 15:30:05 +0000 |
commit | f6e56ab396717b198eb7a8eded5d0d2d24483c5e (patch) | |
tree | eb430bcca0168e2fd3e9b78241c1ea81f9828900 /gdb/cris-tdep.c | |
parent | 3a99f02f77a073c934e5f6514b28bc417223cda6 (diff) | |
download | gdb-f6e56ab396717b198eb7a8eded5d0d2d24483c5e.zip gdb-f6e56ab396717b198eb7a8eded5d0d2d24483c5e.tar.gz gdb-f6e56ab396717b198eb7a8eded5d0d2d24483c5e.tar.bz2 |
* 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.
doc/ChangeLog:
* gdbint.texi (Target Conditionals): Remove documentation of
and references to DEPRECATED_REG_STRUCT_HAS_ADDR.
Diffstat (limited to 'gdb/cris-tdep.c')
-rw-r--r-- | gdb/cris-tdep.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 7d8bdb2..a2999a5 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -938,8 +938,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* 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; } @@ -952,8 +951,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (argreg <= ARG4_REGNUM) { - regcache_cooked_write_unsigned (regcache, argreg, - *(unsigned long *) val); + regcache_cooked_write (regcache, argreg, val); argreg++; val += 4; } @@ -968,8 +966,22 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } 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 { @@ -1931,18 +1943,6 @@ cris_return_value (struct gdbarch *gdbarch, struct type *type, 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. */ @@ -4120,9 +4120,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } 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); |