From 931aecf5eec16660dc9ccc4ac4a4be6c4ca77d8e Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sat, 17 Jan 2004 22:45:44 +0000 Subject: [PATCH] 2004-01-17 Andrew Cagney * x86-64-tdep.c (x86_64_init_abi): No need to clear extract_struct_value_address, i386 does not set it. * sparc64-tdep.c (sparc64_init_abi): Do not set extract_struct_value_address, never called. (sparc64_extract_struct_value_address): Delete function. * m68hc11-tdep.c: Update copyright. (m68hc11_gdbarch_init): Delete redundant assignment of extract_struct_value_address. * i386-tdep.c: Update copyright. (i386_gdbarch_init): Do not set extract_struct_value_address, never called. (i386_extract_struct_value_address): Delete function. * sparc-tdep.c (sparc32_gdbarch_init): Do not set extract_struct_value_address, never called. (sparc32_extract_struct_value_address): #if 0 function. --- gdb/ChangeLog | 19 +++++++++++++++++++ gdb/i386-tdep.c | 18 ++---------------- gdb/m68hc11-tdep.c | 7 ++++--- gdb/sparc-tdep.c | 15 +++++++++++++-- gdb/sparc64-tdep.c | 15 --------------- gdb/x86-64-tdep.c | 2 -- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2709bcb5bb6..fb99958f7d6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,22 @@ +2004-01-17 Andrew Cagney + + * x86-64-tdep.c (x86_64_init_abi): No need to clear + extract_struct_value_address, i386 does not set it. + * sparc64-tdep.c (sparc64_init_abi): Do not set + extract_struct_value_address, never called. + (sparc64_extract_struct_value_address): Delete function. + * m68hc11-tdep.c: Update copyright. + (m68hc11_gdbarch_init): Delete redundant assignment of + extract_struct_value_address. + * i386-tdep.c: Update copyright. + (i386_gdbarch_init): Do not set extract_struct_value_address, + never called. + (i386_extract_struct_value_address): Delete function. + * sparc-tdep.c (sparc32_gdbarch_init): Do not set + extract_struct_value_address, never called. + (sparc32_extract_struct_value_address): #if 0 function. Add + comments explaining its future. + 2004-01-17 Daniel Jacobowitz * arm-tdep.c (arm_write_pc): New function. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 651690f9803..e1ce81fcf0c 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1,7 +1,8 @@ /* Intel 386 target-dependent stuff. Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, - 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. This file is part of GDB. @@ -1274,19 +1275,6 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, #undef I387_ST0_REGNUM } - -/* Extract from REGCACHE, which contains the (raw) register state, the - address in which a function should return its structure value, as a - CORE_ADDR. */ - -static CORE_ADDR -i386_extract_struct_value_address (struct regcache *regcache) -{ - char buf[4]; - - regcache_cooked_read (regcache, I386_EAX_REGNUM, buf); - return extract_unsigned_integer (buf, 4); -} /* This is the variable that is set with "set struct-convention", and @@ -1995,8 +1983,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_value_to_register (gdbarch, i386_value_to_register); set_gdbarch_return_value (gdbarch, i386_return_value); - set_gdbarch_extract_struct_value_address (gdbarch, - i386_extract_struct_value_address); set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue); diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index c920ea67d31..6aa29116c5a 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1,5 +1,8 @@ /* Target-dependent code for Motorola 68HC11 & 68HC12 - Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + + Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software + Foundation, Inc. + Contributed by Stephane Carrez, stcarrez@nerim.fr This file is part of GDB. @@ -1549,8 +1552,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info, set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack); set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value); - set_gdbarch_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); - set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value); set_gdbarch_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address); set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention); diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 1bcdeb8b7c5..c2f3cfb1f63 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -834,6 +834,18 @@ sparc32_return_value (struct gdbarch *gdbarch, struct type *type, return RETURN_VALUE_REGISTER_CONVENTION; } +#if 0 +/* NOTE: cagney/2004-01-17: For the moment disable this method. The + architecture and CORE-gdb will need new code (and a replacement for + EXTRACT_STRUCT_VALUE_ADDRESS) before this can be made to work + robustly. Here is a possible function signature: */ +/* NOTE: cagney/2004-01-17: So far only the 32-bit SPARC ABI has been + identifed as having a way to robustly recover the address of a + struct-convention return-value (after the function has returned). + For all other ABIs so far examined, the calling convention makes no + guarenteed that the register containing the return-value will be + preserved and hence that the return-value's address can be + recovered. */ /* Extract from REGCACHE, which contains the (raw) register state, the address in which a function should return its structure value, as a CORE_ADDR. */ @@ -846,6 +858,7 @@ sparc32_extract_struct_value_address (struct regcache *regcache) regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp); return read_memory_unsigned_integer (sp + 64, 4); } +#endif static int sparc32_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) @@ -1069,8 +1082,6 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, sparc32_push_dummy_call); set_gdbarch_return_value (gdbarch, sparc32_return_value); - set_gdbarch_extract_struct_value_address - (gdbarch, sparc32_extract_struct_value_address); set_gdbarch_stabs_argument_has_addr (gdbarch, sparc32_stabs_argument_has_addr); diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index b32a24c51b2..8aad619eeae 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -1086,19 +1086,6 @@ sparc64_return_value (struct gdbarch *gdbarch, struct type *type, return RETURN_VALUE_REGISTER_CONVENTION; } - -/* Extract from REGCACHE, which contains the (raw) register state, the - address in which a function should return its structure value, as a - CORE_ADDR. */ - -static CORE_ADDR -sparc64_extract_struct_value_address (struct regcache *regcache) -{ - ULONGEST addr; - - regcache_cooked_read_unsigned (regcache, SPARC_O0_REGNUM, &addr); - return addr; -} void @@ -1130,8 +1117,6 @@ sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_push_dummy_call (gdbarch, sparc64_push_dummy_call); set_gdbarch_return_value (gdbarch, sparc64_return_value); - set_gdbarch_extract_struct_value_address - (gdbarch, sparc64_extract_struct_value_address); set_gdbarch_stabs_argument_has_addr (gdbarch, default_stabs_argument_has_addr); diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index fcb29edc257..b19372fe89c 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1109,8 +1109,6 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_value_to_register (gdbarch, i387_value_to_register); set_gdbarch_return_value (gdbarch, amd64_return_value); - /* Override, since this is handled by amd64_extract_return_value. */ - set_gdbarch_extract_struct_value_address (gdbarch, NULL); set_gdbarch_skip_prologue (gdbarch, amd64_skip_prologue); -- 2.30.2