This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Delete some deprecated extract struct value address


Hello,

This eliminates a number of the deprecated struct value address implementations. See: [RFC] Struct return values
http://sources.redhat.com/ml/gdb/2004-01/msg00123.html
for additional background.


Andrew
2004-01-17  Andrew Cagney  <cagney@redhat.com>

	* mcore-tdep.c: Update copyright.
	(mcore_extract_struct_value_address): Delete function.  Update
	comments.
	(mcore_gdbarch_init): Update.
	* mn10300-tdep.c: Update copyright.
	(mn10300_extract_struct_value_address): Delete function.
	(mn10300_gdbarch_init): Update.
	* v850-tdep.c: Update copyright.
	(v850_extract_struct_value_address): Delete.
	(v850_gdbarch_init): Update.
	* ns32k-tdep.c: Update copyright.
	(ns32k_extract_struct_value_address): Delete.
	(ns32k_gdbarch_init): Update.
	* hppa-tdep.c (hppa_extract_struct_value_address): Delete.
	(hppa_gdbarch_init): Update.
	* vax-tdep.c: Update copyright.
	(vax_extract_struct_value_address): Delete.
	(vax_gdbarch_init): Update.

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.112
diff -u -r1.112 hppa-tdep.c
--- hppa-tdep.c	17 Jan 2004 17:01:32 -0000	1.112
+++ hppa-tdep.c	17 Jan 2004 18:43:11 -0000
@@ -194,7 +194,6 @@
 int hppa64_use_struct_convention (int gcc_p, struct type *type);
 void hppa32_store_return_value (struct type *type, char *valbuf);
 void hppa64_store_return_value (struct type *type, char *valbuf);
-CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
 int hppa_cannot_store_register (int regnum);
 void hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame);
 CORE_ADDR hppa_frame_chain (struct frame_info *frame);
@@ -5009,26 +5008,6 @@
 {
   write_register (28, addr);
 }
-
-CORE_ADDR
-hppa_extract_struct_value_address (char *regbuf)
-{
-  /* 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).  */
-  /* FIXME: brobecker 2002-12-26.
-     The current implementation is historical, but we should eventually
-     implement it in a more robust manner as it relies on the fact that
-     the address size is equal to the size of an int* _on the host_...
-     One possible implementation that crossed my mind is to use
-     extract_address.  */
-  /* FIXME: cagney/2003-09-27: This function can probably go.  ELZ
-     writes: We cannot assume on the pa that r28 still contains the
-     address of the returned structure. Usually this will be
-     overwritten by the callee.  */
-  return (*(int *)(regbuf + DEPRECATED_REGISTER_BYTE (28)));
-}
-
 /* Return True if REGNUM is not a register available to the user
    through ptrace().  */
 
@@ -5208,8 +5187,6 @@
   set_gdbarch_deprecated_max_register_raw_size (gdbarch, tdep->bytes_per_address);
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
   set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
-  set_gdbarch_deprecated_extract_struct_value_address
-    (gdbarch, hppa_extract_struct_value_address);
   set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, hppa_init_extra_frame_info);
   set_gdbarch_deprecated_frame_chain (gdbarch, hppa_frame_chain);
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.82
diff -u -r1.82 mcore-tdep.c
--- mcore-tdep.c	17 Jan 2004 15:34:12 -0000	1.82
+++ mcore-tdep.c	17 Jan 2004 18:43:15 -0000
@@ -1,5 +1,7 @@
 /* Target-machine dependent code for Motorola MCore for GDB, the GNU debugger
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -917,16 +919,13 @@
    argument.
 
    For gdb, this leaves us two routes, based on what
-   USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns.
-   If this macro returns 1, gdb will call STORE_STRUCT_RETURN and
-   EXTRACT_STRUCT_VALUE_ADDRESS.
-
-   If USE_STRUCT_CONVENTION retruns 0, then gdb uses STORE_RETURN_VALUE
-   and EXTRACT_RETURN_VALUE to store/fetch the functions return value. */
-
-/* Should we use 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). */
+   USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns.  If
+   this macro returns 1, gdb will call STORE_STRUCT_RETURN to store
+   the return value.
+
+   If USE_STRUCT_CONVENTION returns 0, then gdb uses
+   STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE to store/fetch the
+   functions return value.  */
 
 static int
 mcore_use_struct_convention (int gcc_p, struct type *type)
@@ -934,16 +933,6 @@
   return (TYPE_LENGTH (type) > 8);
 }
 
-/* Where is the return value saved? For MCore, a pointer to 
-   this buffer was passed as a hidden first argument, so
-   just return that address. */
-
-static CORE_ADDR
-mcore_extract_struct_value_address (char *regbuf)
-{
-  return extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
-}
-
 /* Given a function which returns a value of type TYPE, extract the
    the function's return value and place the result into VALBUF.
    REGBUF is the register contents of the target. */
@@ -1085,8 +1074,6 @@
   set_gdbarch_deprecated_extract_return_value (gdbarch, 
 					       mcore_extract_return_value);
   set_gdbarch_deprecated_store_struct_return (gdbarch, mcore_store_struct_return);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, 
-						       mcore_extract_struct_value_address);
   set_gdbarch_skip_prologue (gdbarch, mcore_skip_prologue);
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_deprecated_frame_args_address (gdbarch, mcore_frame_args_address);
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.97
diff -u -r1.97 mn10300-tdep.c
--- mn10300-tdep.c	17 Jan 2004 15:34:12 -0000	1.97
+++ mn10300-tdep.c	17 Jan 2004 18:43:15 -0000
@@ -1,7 +1,7 @@
 /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
 
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
-   Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -130,13 +130,6 @@
     memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (type));
 }
 
-static CORE_ADDR
-mn10300_extract_struct_value_address (char *regbuf)
-{
-  return extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (4),
-				   DEPRECATED_REGISTER_RAW_SIZE (4));
-}
-
 static void
 mn10300_store_return_value (struct type *type, char *valbuf)
 {
@@ -1182,8 +1175,6 @@
   set_gdbarch_deprecated_frame_chain (gdbarch, mn10300_frame_chain);
   set_gdbarch_deprecated_frame_saved_pc (gdbarch, mn10300_frame_saved_pc);
   set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address
-    (gdbarch, mn10300_extract_struct_value_address);
   set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value);
   set_gdbarch_deprecated_store_struct_return (gdbarch, mn10300_store_struct_return);
   set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame);
Index: ns32k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ns32k-tdep.c,v
retrieving revision 1.64
diff -u -r1.64 ns32k-tdep.c
--- ns32k-tdep.c	17 Jan 2004 15:34:12 -0000	1.64
+++ ns32k-tdep.c	17 Jan 2004 18:43:15 -0000
@@ -1,6 +1,7 @@
 /* Target dependent code for the NS32000, for GDB.
-   Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -495,12 +496,6 @@
 				   TYPE_LENGTH (valtype));
 }
 
-static CORE_ADDR
-ns32k_extract_struct_value_address (char *regbuf)
-{
-  return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0), DEPRECATED_REGISTER_RAW_SIZE (0)));
-}
-
 void
 ns32k_gdbarch_init_32082 (struct gdbarch *gdbarch)
 {
@@ -582,8 +577,6 @@
   set_gdbarch_deprecated_store_struct_return (gdbarch, ns32k_store_struct_return);
   set_gdbarch_deprecated_extract_return_value (gdbarch, ns32k_extract_return_value);
   set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch,
-                                            ns32k_extract_struct_value_address);
 
   /* Call dummy info */
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.78
diff -u -r1.78 v850-tdep.c
--- v850-tdep.c	17 Jan 2004 15:34:13 -0000	1.78
+++ v850-tdep.c	17 Jan 2004 18:43:15 -0000
@@ -1,6 +1,7 @@
 /* Target-dependent code for the NEC V850 for GDB, the GNU debugger.
-   Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1088,13 +1089,6 @@
   return breakpoint;
 }
 
-static CORE_ADDR
-v850_extract_struct_value_address (char *regbuf)
-{
-  return extract_unsigned_integer (regbuf + v850_register_byte (E_V0_REGNUM),
-				   v850_register_raw_size (E_V0_REGNUM));
-}
-
 static void
 v850_store_return_value (struct type *type, char *valbuf)
 {
@@ -1272,7 +1266,6 @@
   set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame);
   set_gdbarch_deprecated_store_struct_return (gdbarch, v850_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention);
   set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
   set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
Index: vax-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.c,v
retrieving revision 1.66
diff -u -r1.66 vax-tdep.c
--- vax-tdep.c	17 Jan 2004 15:34:13 -0000	1.66
+++ vax-tdep.c	17 Jan 2004 18:43:16 -0000
@@ -1,6 +1,7 @@
 /* Print VAX instructions for GDB, the GNU debugger.
-   Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000,
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -41,8 +42,6 @@
 static gdbarch_deprecated_frame_chain_ftype vax_frame_chain;
 
 static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
-static gdbarch_deprecated_extract_struct_value_address_ftype
-    vax_extract_struct_value_address;
 
 static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
 
@@ -275,13 +274,6 @@
 {
   deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
 }
-
-static CORE_ADDR
-vax_extract_struct_value_address (char *regbuf)
-{
-  return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0),
-				    DEPRECATED_REGISTER_RAW_SIZE (0)));
-}
 
 static const unsigned char *
 vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
@@ -391,7 +383,6 @@
   set_gdbarch_deprecated_store_struct_return (gdbarch, vax_store_struct_return);
   set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value);
   set_gdbarch_deprecated_store_return_value (gdbarch, vax_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, vax_extract_struct_value_address);
 
   /* Call dummy info */
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]