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 DEPRECATED_VALUE_RETURNED_FROM_STACK


How that hand_call_function unconditionally uses the structure return address (when available) to extract the return-value, HP's value_returned_from_stack is no longer needed.

deleted,
Andrew
2003-11-22  Andrew Cagney  <cagney@redhat.com>

	* hppa-tdep.c (hppa_value_returned_from_stack): Delete function.
	* config/pa/tm-hppa.h (hppa_value_returned_from_stack): Delete
	declaration.
	(DEPRECATED_VALUE_RETURNED_FROM_STACK): Delete macro.
	* infcall.c (call_function_by_hand): Delete #ifdef
	DEPRECATED_VALUE_RETURNED_FROM_STACK code.
	* infcmd.c (print_return_value): Ditto.

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.105
diff -u -r1.105 hppa-tdep.c
--- hppa-tdep.c	16 Oct 2003 16:35:26 -0000	1.105
+++ hppa-tdep.c	22 Nov 2003 22:03:59 -0000
@@ -2060,30 +2060,6 @@
 
 #endif
 
-/* elz: this function returns a value which is built looking at the given address.
-   It is called from call_function_by_hand, in case we need to return a 
-   value which is larger than 64 bits, and it is stored in the stack rather than 
-   in the registers r28 and r29 or fr4.
-   This function does the same stuff as value_being_returned in values.c, but
-   gets the value from the stack rather than from the buffer where all the
-   registers were saved when the function called completed. */
-/* FIXME: cagney/2003-09-27: This function is no longer needed.  The
-   inferior function call code now directly handles the case described
-   above.  */
-struct value *
-hppa_value_returned_from_stack (struct type *valtype, CORE_ADDR addr)
-{
-  struct value *val;
-
-  val = allocate_value (valtype);
-  CHECK_TYPEDEF (valtype);
-  target_read_memory (addr, VALUE_CONTENTS_RAW (val), TYPE_LENGTH (valtype));
-
-  return val;
-}
-
-
-
 /* elz: Used to lookup a symbol in the shared libraries.
    This function calls shl_findsym, indirectly through a
    call to __d_shl_get. __d_shl_get is in end.c, which is always
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.35
diff -u -r1.35 infcall.c
--- infcall.c	24 Oct 2003 17:37:03 -0000	1.35
+++ infcall.c	22 Nov 2003 22:04:14 -0000
@@ -1075,22 +1075,6 @@
   do_cleanups (inf_status_cleanup);
 
   /* Figure out the value returned by the function.  */
-  /* elz: I defined this new macro for the hppa architecture only.
-     this gives us a way to get the value returned by the function
-     from the stack, at the same address we told the function to put
-     it.  We cannot assume on the pa that r28 still contains the
-     address of the returned structure. Usually this will be
-     overwritten by the callee.  I don't know about other
-     architectures, so I defined this macro */
-  /* FIXME: cagney/2003-09-27: This is no longer needed.  The problem
-     is now handled directly be by the code below.  */
-#ifdef DEPRECATED_VALUE_RETURNED_FROM_STACK
-  if (struct_return)
-    {
-      do_cleanups (retbuf_cleanup);
-      return DEPRECATED_VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
-    }
-#endif
   if (struct_return)
     {
       /* NOTE: cagney/2003-09-27: This assumes that PUSH_DUMMY_CALL
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.98
diff -u -r1.98 infcmd.c
--- infcmd.c	24 Oct 2003 17:37:03 -0000	1.98
+++ infcmd.c	22 Nov 2003 22:04:30 -0000
@@ -1086,13 +1086,7 @@
      a more complicated case of what is already being done in in the
      inferior function call code.  In fact, when inferior function
      calls are made async, this will likely be made the norm.  */
-#ifdef DEPRECATED_VALUE_RETURNED_FROM_STACK
-#define DEPRECATED_VALUE_RETURNED_FROM_STACK_P 1
-#else
-#define DEPRECATED_VALUE_RETURNED_FROM_STACK_P 0
-#endif
-  else if (gdbarch_return_value_p (current_gdbarch)
-	   || DEPRECATED_VALUE_RETURNED_FROM_STACK_P)
+  else if (gdbarch_return_value_p (current_gdbarch))
     /* We cannot determine the contents of the structure because it is
        on the stack, and we don't know where, since we did not
        initiate the call, as opposed to the call_function_by_hand
Index: config/pa/tm-hppa.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa.h,v
retrieving revision 1.60
diff -u -r1.60 tm-hppa.h
--- config/pa/tm-hppa.h	31 Oct 2003 22:38:22 -0000	1.60
+++ config/pa/tm-hppa.h	22 Nov 2003 22:04:38 -0000
@@ -109,24 +109,6 @@
 #define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
 #endif
 
-/* elz: Return a large value, which is stored on the stack at addr.
-   This is defined only for the hppa, at this moment.  The above macro
-   DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS is not called anymore,
-   because it assumes that on exit from a called function which
-   returns a large structure on the stack, the address of the ret
-   structure is still in register 28. Unfortunately this register is
-   usually overwritten by the called function itself, on hppa. This is
-   specified in the calling convention doc. As far as I know, the only
-   way to get the return value is to have the caller tell us where it
-   told the callee to put it, rather than have the callee tell us.  */
-struct value *hppa_value_returned_from_stack (struct type *valtype,
-					      CORE_ADDR addr);
-/* FIXME: cagney/2003-09-27: This method should now be redundant.
-   Instead, when "struct return convention", the inferior function
-   call code always saves and uses the struct return's stack address.  */
-#define DEPRECATED_VALUE_RETURNED_FROM_STACK(valtype,addr) \
-  hppa_value_returned_from_stack (valtype, addr)
-
 extern void hppa_frame_init_saved_regs (struct frame_info *);
 #define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) \
   hppa_frame_init_saved_regs (FI)

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