diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/m32r-tdep.c | 51 |
2 files changed, 28 insertions, 32 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e917a41..e631089 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 73dce73..3d8dfec 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -55,19 +55,6 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) 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} @@ -266,19 +253,6 @@ m32r_store_return_value (struct type *type, struct regcache *regcache, } } -/* 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. */ @@ -781,6 +755,24 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, } } +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) @@ -900,13 +892,8 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 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); |