+2004-10-05 Kei Sakamoto <sakamoto.kei@renesas.com>
+
+ * m32r-tdep.c (m32r_use_struct_convention): Delete function.
+ (m32r_extract_struct_value_address): Delete function.
+ (m32r_return_value): New function.
+ (m32r_gdbarch_init): Instead of store_return_value,
+ extract_return_value, deprecated_extract_struct_value_address
+ and deprecated_use_struct_convention, set return_value.
+
2004-10-03 Daniel Jacobowitz <dan@debian.org>
* dwarf2read.c (read_subrange_type): Add comment for variable
return sp & ~3;
}
-/* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
- EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE
- is the type (which is known to be struct, union or array).
-
- The m32r returns anything less than 8 bytes in size in
- registers. */
-
-static int
-m32r_use_struct_convention (int gcc_p, struct type *type)
-{
- return (TYPE_LENGTH (type) > 8);
-}
-
/* BREAKPOINT */
#define M32R_BE_BREAKPOINT32 {0x10, 0xf1, 0x70, 0x00}
}
}
-/* Extract from an array REGBUF containing the (raw) register state
- the address in which a function should return its structure value,
- as a CORE_ADDR (or an expression that can be used as one). */
-
-static CORE_ADDR
-m32r_extract_struct_value_address (struct regcache *regcache)
-{
- ULONGEST addr;
- regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &addr);
- return addr;
-}
-
-
/* This is required by skip_prologue. The results of decoding a prologue
should be cached because this thrashing is getting nuts. */
}
}
+enum return_value_convention
+m32r_return_value (struct gdbarch *gdbarch, struct type *valtype,
+ struct regcache *regcache, void *readbuf,
+ const void *writebuf)
+{
+ if (TYPE_LENGTH (valtype) > 8)
+ return RETURN_VALUE_STRUCT_CONVENTION;
+ else
+ {
+ if (readbuf != NULL)
+ m32r_extract_return_value (valtype, regcache, readbuf);
+ if (writebuf != NULL)
+ m32r_store_return_value (valtype, regcache, writebuf);
+ return RETURN_VALUE_REGISTER_CONVENTION;
+ }
+}
+
+
static CORE_ADDR
m32r_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
set_gdbarch_register_name (gdbarch, m32r_register_name);
set_gdbarch_register_type (gdbarch, m32r_register_type);
- set_gdbarch_extract_return_value (gdbarch, m32r_extract_return_value);
set_gdbarch_push_dummy_call (gdbarch, m32r_push_dummy_call);
- set_gdbarch_store_return_value (gdbarch, m32r_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
- m32r_extract_struct_value_address);
- set_gdbarch_deprecated_use_struct_convention (gdbarch,
- m32r_use_struct_convention);
+ set_gdbarch_return_value (gdbarch, m32r_return_value);
set_gdbarch_skip_prologue (gdbarch, m32r_skip_prologue);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);