This is the mail archive of the gdb-patches@sourceware.org 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]

[RFA] Support for multiple calling conventions, patch 2/3: Add function type argument to gdbarch_return_value


This is part two of the multiple calling convention patch.

The calling convention is stored on a per function type base.  However,
the gdbarch_return_value function only gets the function's target type
as argument.  There's no other argument which allows to get other
information about the function, so there's apparently no way to retrieve
the calling convention to behave accordingly.  It's a big patch, but
it really only adds the function type to the gdbarch_return_value, which
requires follow up changes in calling functions.  Mainly this also
requires to add function type arguments to print_return_value and
using_struct_return.

Ok to apply?


Thanks,
Corinna


        * gdbarch.sh (return_value): Add func_type argument.
        * gdbarch.c: Regenerate.
        * gdbarch.h: Ditto.
        * eval.c (evaluate_subexp_standard): Rename local variable value_type to
        val_type so as not to collide with value_type function.  Call
        using_struct_return with additional function type argument.
        * infcall.c (call_function_by_hand): Call using_struct_return and
        gdbarch_return_value with additional function type argument.
        * infcmd.c (print_return_value): Take addition func_type argument.
        Call gdbarch_return_value with additional function type argument.
        (finish_command_continuation): Call print_return_value with additional
        function type argument.
        (finish_command): Ditto.
        * sparc-tdep.c (sparc32_push_dummy_code): Call using_struct_return with
        additional function type argument.
        * stack.c (return_command): Call using_struct_return and
        gdbarch_return_value with additional function type argument.
        * value.c (using_struct_return): Take additional function type argument.
        * value.h (using_struct_return): Accommodate declaration.
        * alpha-tdep.c (alpha_return_value): Add func_type argument.
        * amd64-tdep.c (amd64_return_value): Ditto.
        * arm-tdep.c (arm_return_value): Ditto.
        * avr-tdep.c (avr_return_value): Ditto.
        * cris-tdep.c (cris_return_value): Ditto.
        * frv-tdep.c (frv_return_value): Ditto.
        * h8300-tdep.c (h8300_return_value): Ditto.
        (h8300h_return_value): Ditto.
        * hppa-tdep.c (hppa32_return_value): Ditto.
        (hppa64_return_value): Ditto.
        * i386-tdep.c (i386_return_value): Ditto.
        * ia64-tdep.c (ia64_return_value): Ditto.
        * iq2000-tdep.c (iq2000_return_value): Ditto.
        * m32c-tdep.c (m32c_return_value): Ditto.
        * m32r-tdep.c (m32r_return_value): Ditto.
        * m68hc11-tdep.c (m68hc11_return_value): Ditto.
        * m68k-tdep.c (m68k_return_value): Ditto.
        (m68k_svr4_return_value): Ditto.
        * m88k-tdep.c  (m88k_return_value): Ditto.
        * mep-tdep.c (mep_return_value): Ditto.
        * mips-tdep.c (mips_eabi_return_value): Ditto.
        (mips_n32n64_return_value): Ditto.
        (mips_o32_return_value): Ditto.
        (mips_o64_return_value): Ditto.
        * mn10300-tdep.c (mn10300_return_value): Ditto.
        * mt-tdep.c (mt_return_value): Ditto.
        * ppc-linux-tdep.c (ppc_linux_return_value): Ditto.
        * ppc-sysv-tdep.c (ppc_sysv_abi_return_value): Ditto.
        (ppc_sysv_abi_broken_return_value): Ditto.
        (ppc64_sysv_abi_return_value): Ditto.
        * ppc-tdep.h (ppc_sysv_abi_return_value): Ditto.
        (ppc_sysv_abi_broken_return_value): Ditto.
        (ppc64_sysv_abi_return_value): Ditto.
        * ppcnbsd-tdep.c (ppcnbsd_return_value): Ditto.
        * rs6000-tdep.c (rs6000_return_value): Ditto.
        * s390-tdep.c (s390_return_value): Ditto.
        * score-tdep.c (score_return_value): Ditto.
        * sh-tdep.c (sh_return_value_nofpu): Ditto.
        (sh_return_value_fpu): Ditto.
        * sh64-tdep.c (sh64_return_value): Ditto.
        * sparc-tdep.c (sparc32_return_value): Ditto.
        * sparc64-tdep.c (sparc64_return_value): Ditto.
        * spu-tdep.c (spu_return_value): Ditto.
        * v850-tdep.c (v850_return_value): Ditto.
        * vax-tdep.c (vax_return_value): Ditto.
        * xstormy16-tdep.c (xstormy16_return_value): Ditto.
        * xtensa-tdep.c (xtensa_return_value): Ditto.


Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.183
diff -u -p -r1.183 alpha-tdep.c
--- alpha-tdep.c	13 Mar 2008 12:22:11 -0000	1.183
+++ alpha-tdep.c	15 Apr 2008 11:23:59 -0000
@@ -564,9 +564,9 @@ alpha_store_return_value (struct type *v
 }
 
 static enum return_value_convention
-alpha_return_value (struct gdbarch *gdbarch, struct type *type,
-		    struct regcache *regcache, gdb_byte *readbuf,
-		    const gdb_byte *writebuf)
+alpha_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		    struct type *type, struct regcache *regcache,
+		    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum type_code code = TYPE_CODE (type);
 
Index: amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.48
diff -u -p -r1.48 amd64-tdep.c
--- amd64-tdep.c	11 Mar 2008 05:21:38 -0000	1.48
+++ amd64-tdep.c	15 Apr 2008 11:23:59 -0000
@@ -392,8 +392,8 @@ amd64_classify (struct type *type, enum 
 }
 
 static enum return_value_convention
-amd64_return_value (struct gdbarch *gdbarch, struct type *type,
-		    struct regcache *regcache,
+amd64_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		    struct type *type, struct regcache *regcache,
 		    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum amd64_reg_class class[2];
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.257
diff -u -p -r1.257 arm-tdep.c
--- arm-tdep.c	20 Feb 2008 14:34:42 -0000	1.257
+++ arm-tdep.c	15 Apr 2008 11:23:59 -0000
@@ -2373,9 +2373,9 @@ arm_store_return_value (struct type *typ
 /* Handle function return values.  */
 
 static enum return_value_convention
-arm_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		  struct regcache *regcache, gdb_byte *readbuf,
-		  const gdb_byte *writebuf)
+arm_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		  struct type *valtype, struct regcache *regcache,
+		  gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
Index: avr-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/avr-tdep.c,v
retrieving revision 1.106
diff -u -p -r1.106 avr-tdep.c
--- avr-tdep.c	11 Jan 2008 13:19:59 -0000	1.106
+++ avr-tdep.c	15 Apr 2008 11:24:00 -0000
@@ -834,9 +834,9 @@ avr_extract_return_value (struct type *t
    from WRITEBUF into REGCACHE.  */
 
 enum return_value_convention
-avr_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		  struct regcache *regcache, gdb_byte *readbuf,
-		  const gdb_byte *writebuf)
+avr_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		  struct type *valtype, struct regcache *regcache,
+		  gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   int struct_return = ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
 			|| TYPE_CODE (valtype) == TYPE_CODE_UNION
Index: cris-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/cris-tdep.c,v
retrieving revision 1.160
diff -u -p -r1.160 cris-tdep.c
--- cris-tdep.c	11 Jan 2008 14:43:14 -0000	1.160
+++ cris-tdep.c	15 Apr 2008 11:24:00 -0000
@@ -1924,9 +1924,9 @@ cris_extract_return_value (struct type *
 /* Handle the CRIS return value convention.  */
 
 static enum return_value_convention
-cris_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache, gdb_byte *readbuf,
-		   const gdb_byte *writebuf)
+cris_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT 
       || TYPE_CODE (type) == TYPE_CODE_UNION
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.81
diff -u -p -r1.81 eval.c
--- eval.c	21 Mar 2008 15:02:37 -0000	1.81
+++ eval.c	15 Apr 2008 11:24:02 -0000
@@ -918,26 +918,27 @@ evaluate_subexp_standard (struct type *e
 	  {
 	    struct block *b;
 	    CORE_ADDR funaddr;
-	    struct type *value_type;
+	    struct type *val_type;
 
-	    funaddr = find_function_addr (method, &value_type);
+	    funaddr = find_function_addr (method, &val_type);
 
 	    b = block_for_pc (funaddr);
 
-	    CHECK_TYPEDEF (value_type);
+	    CHECK_TYPEDEF (val_type);
 	  
-	    if ((value_type == NULL) 
-		|| (TYPE_CODE(value_type) == TYPE_CODE_ERROR))
+	    if ((val_type == NULL) 
+		|| (TYPE_CODE(val_type) == TYPE_CODE_ERROR))
 	      {
 		if (expect_type != NULL)
-		  value_type = expect_type;
+		  val_type = expect_type;
 	      }
 
-	    struct_return = using_struct_return (value_type);
+	    struct_return = using_struct_return (value_type (method), val_type);
 	  }
 	else if (expect_type != NULL)
 	  {
-	    struct_return = using_struct_return (check_typedef (expect_type));
+	    struct_return = using_struct_return (NULL,
+						 check_typedef (expect_type));
 	  }
 	
 	/* Found a function symbol.  Now we will substitute its
Index: frv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/frv-tdep.c,v
retrieving revision 1.119
diff -u -p -r1.119 frv-tdep.c
--- frv-tdep.c	13 Mar 2008 12:22:12 -0000	1.119
+++ frv-tdep.c	15 Apr 2008 11:24:02 -0000
@@ -1248,9 +1248,9 @@ frv_store_return_value (struct type *typ
 }
 
 enum return_value_convention
-frv_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		  struct regcache *regcache, gdb_byte *readbuf,
-		  const gdb_byte *writebuf)
+frv_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		  struct type *valtype, struct regcache *regcache,
+		  gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   int struct_return = TYPE_CODE (valtype) == TYPE_CODE_STRUCT
 		      || TYPE_CODE (valtype) == TYPE_CODE_UNION
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.421
diff -u -p -r1.421 gdbarch.c
--- gdbarch.c	20 Feb 2008 14:31:40 -0000	1.421
+++ gdbarch.c	15 Apr 2008 11:24:02 -0000
@@ -2041,13 +2041,13 @@ gdbarch_return_value_p (struct gdbarch *
 }
 
 enum return_value_convention
-gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
+gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->return_value != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
-  return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
+  return gdbarch->return_value (gdbarch, functype, valtype, regcache, readbuf, writebuf);
 }
 
 void
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.375
diff -u -p -r1.375 gdbarch.h
--- gdbarch.h	20 Feb 2008 14:31:40 -0000	1.375
+++ gdbarch.h	15 Apr 2008 11:24:02 -0000
@@ -366,8 +366,8 @@ extern void set_gdbarch_integer_to_addre
 
 extern int gdbarch_return_value_p (struct gdbarch *gdbarch);
 
-typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
-extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
+typedef enum return_value_convention (gdbarch_return_value_ftype) (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
+extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf);
 extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
 
 typedef CORE_ADDR (gdbarch_skip_prologue_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip);
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.461
diff -u -p -r1.461 gdbarch.sh
--- gdbarch.sh	20 Feb 2008 14:31:40 -0000	1.461
+++ gdbarch.sh	15 Apr 2008 11:24:02 -0000
@@ -474,7 +474,7 @@ M:CORE_ADDR:integer_to_address:struct ty
 # should take the type/value of the function to be called and not the
 # return type.  This is left as an exercise for the reader.
 
-M:enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf:valtype, regcache, readbuf, writebuf
+M:enum return_value_convention:return_value:struct type *functype, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf:functype, valtype, regcache, readbuf, writebuf
 
 m:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0
 f:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0
Index: h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.115
diff -u -p -r1.115 h8300-tdep.c
--- h8300-tdep.c	11 Jan 2008 14:43:14 -0000	1.115
+++ h8300-tdep.c	15 Apr 2008 11:24:03 -0000
@@ -909,8 +909,8 @@ h8300h_store_return_value (struct type *
 }
 
 static enum return_value_convention
-h8300_return_value (struct gdbarch *gdbarch, struct type *type,
-		    struct regcache *regcache,
+h8300_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		    struct type *type, struct regcache *regcache,
 		    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (h8300_use_struct_convention (type))
@@ -923,8 +923,8 @@ h8300_return_value (struct gdbarch *gdba
 }
 
 static enum return_value_convention
-h8300h_return_value (struct gdbarch *gdbarch, struct type *type,
-		     struct regcache *regcache,
+h8300h_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		     struct type *type, struct regcache *regcache,
 		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (h8300h_use_struct_convention (type))
Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.248
diff -u -p -r1.248 hppa-tdep.c
--- hppa-tdep.c	13 Mar 2008 12:22:12 -0000	1.248
+++ hppa-tdep.c	15 Apr 2008 11:24:03 -0000
@@ -1105,7 +1105,7 @@ hppa64_push_dummy_call (struct gdbarch *
 /* Handle 32/64-bit struct return conventions.  */
 
 static enum return_value_convention
-hppa32_return_value (struct gdbarch *gdbarch,
+hppa32_return_value (struct gdbarch *gdbarch, struct type *func_type,
 		     struct type *type, struct regcache *regcache,
 		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
@@ -1145,7 +1145,7 @@ hppa32_return_value (struct gdbarch *gdb
 }
 
 static enum return_value_convention
-hppa64_return_value (struct gdbarch *gdbarch,
+hppa64_return_value (struct gdbarch *gdbarch, struct type *func_type,
 		     struct type *type, struct regcache *regcache,
 		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.253
diff -u -p -r1.253 i386-tdep.c
--- i386-tdep.c	17 Mar 2008 19:32:56 -0000	1.253
+++ i386-tdep.c	15 Apr 2008 11:24:03 -0000
@@ -1560,9 +1560,9 @@ i386_reg_struct_return_p (struct gdbarch
    from WRITEBUF into REGCACHE.  */
 
 static enum return_value_convention
-i386_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache, gdb_byte *readbuf,
-		   const gdb_byte *writebuf)
+i386_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum type_code code = TYPE_CODE (type);
 
@@ -1611,7 +1611,8 @@ i386_return_value (struct gdbarch *gdbar
   if (code == TYPE_CODE_STRUCT && TYPE_NFIELDS (type) == 1)
     {
       type = check_typedef (TYPE_FIELD_TYPE (type, 0));
-      return i386_return_value (gdbarch, type, regcache, readbuf, writebuf);
+      return i386_return_value (gdbarch, func_type, type, regcache,
+				readbuf, writebuf);
     }
 
   if (readbuf)
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.173
diff -u -p -r1.173 ia64-tdep.c
--- ia64-tdep.c	31 Mar 2008 03:38:48 -0000	1.173
+++ ia64-tdep.c	15 Apr 2008 11:24:04 -0000
@@ -3059,9 +3059,9 @@ ia64_store_return_value (struct type *ty
 }
   
 static enum return_value_convention
-ia64_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		   struct regcache *regcache, gdb_byte *readbuf,
-		   const gdb_byte *writebuf)
+ia64_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *valtype, struct regcache *regcache,
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   int struct_return = ia64_use_struct_convention (valtype);
 
Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.95
diff -u -p -r1.95 infcall.c
--- infcall.c	21 Mar 2008 15:02:37 -0000	1.95
+++ infcall.c	15 Apr 2008 11:24:04 -0000
@@ -493,7 +493,7 @@ call_function_by_hand (struct value *fun
     }
   else
     {
-      struct_return = using_struct_return (values_type);
+      struct_return = using_struct_return (value_type (function), values_type);
       target_values_type = values_type;
     }
 
@@ -853,14 +853,14 @@ the function call)."), name);
     else
       {
 	switch (gdbarch_return_value (gdbarch, target_values_type,
-				      NULL, NULL, NULL))
+				      value_type (function), NULL, NULL, NULL))
 	  {
 	  case RETURN_VALUE_REGISTER_CONVENTION:
 	  case RETURN_VALUE_ABI_RETURNS_ADDRESS:
 	  case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
 	    retval = allocate_value (values_type);
-	    gdbarch_return_value (gdbarch, values_type, retbuf,
-				  value_contents_raw (retval), NULL);
+	    gdbarch_return_value (gdbarch, values_type, value_type (function),
+				  retbuf, value_contents_raw (retval), NULL);
 	    break;
 	  case RETURN_VALUE_STRUCT_CONVENTION:
 	    retval = value_at (values_type, struct_addr);
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.174
diff -u -p -r1.174 infcmd.c
--- infcmd.c	17 Mar 2008 17:30:29 -0000	1.174
+++ infcmd.c	15 Apr 2008 11:24:04 -0000
@@ -68,7 +68,8 @@ void interrupt_target_command (char *arg
 
 static void nofp_registers_info (char *, int);
 
-static void print_return_value (struct type *value_type);
+static void print_return_value (struct type *func_type,
+				struct type *value_type);
 
 static void finish_command_continuation (struct continuation_arg *);
 
@@ -1182,7 +1183,7 @@ advance_command (char *arg, int from_tty
 /* Print the result of a function at the end of a 'finish' command.  */
 
 static void
-print_return_value (struct type *value_type)
+print_return_value (struct type *func_type, struct type *value_type)
 {
   struct gdbarch *gdbarch = current_gdbarch;
   struct cleanup *old_chain;
@@ -1199,13 +1200,14 @@ print_return_value (struct type *value_t
      inferior function call code.  In fact, when inferior function
      calls are made async, this will likely be made the norm.  */
 
-  switch (gdbarch_return_value (gdbarch, value_type, NULL, NULL, NULL))
+  switch (gdbarch_return_value (gdbarch, value_type, func_type,
+  				NULL, NULL, NULL))
     {
     case RETURN_VALUE_REGISTER_CONVENTION:
     case RETURN_VALUE_ABI_RETURNS_ADDRESS:
     case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
       value = allocate_value (value_type);
-      gdbarch_return_value (gdbarch, value_type, stop_registers,
+      gdbarch_return_value (gdbarch, value_type, func_type, stop_registers,
 			    value_contents_raw (value), NULL);
       break;
     case RETURN_VALUE_STRUCT_CONVENTION:
@@ -1269,7 +1271,7 @@ finish_command_continuation (struct cont
 			_("finish_command: function has no target type"));
 
       if (TYPE_CODE (value_type) != TYPE_CODE_VOID)
-	print_return_value (value_type); 
+	print_return_value (SYMBOL_TYPE (function), value_type); 
     }
 
   do_exec_cleanups (cleanups);
@@ -1383,7 +1385,7 @@ finish_command (char *arg, int from_tty)
 			    _("finish_command: function has no target type"));
 
 	  if (TYPE_CODE (value_type) != TYPE_CODE_VOID)
-	    print_return_value (value_type); 
+	    print_return_value (SYMBOL_TYPE (function), value_type); 
 	}
 
       do_cleanups (old_chain);
Index: iq2000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/iq2000-tdep.c,v
retrieving revision 1.12
diff -u -p -r1.12 iq2000-tdep.c
--- iq2000-tdep.c	11 Jan 2008 13:20:01 -0000	1.12
+++ iq2000-tdep.c	15 Apr 2008 11:24:04 -0000
@@ -591,8 +591,8 @@ iq2000_extract_return_value (struct type
 }
 
 static enum return_value_convention
-iq2000_return_value (struct gdbarch *gdbarch, struct type *type,
-		     struct regcache *regcache,
+iq2000_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		     struct type *type, struct regcache *regcache,
 		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (iq2000_use_struct_convention (type))
Index: m32c-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32c-tdep.c,v
retrieving revision 1.22
diff -u -p -r1.22 m32c-tdep.c
--- m32c-tdep.c	11 Jan 2008 14:43:14 -0000	1.22
+++ m32c-tdep.c	15 Apr 2008 11:24:05 -0000
@@ -2198,6 +2198,7 @@ m32c_return_by_passed_buf (struct type *
 
 static enum return_value_convention
 m32c_return_value (struct gdbarch *gdbarch,
+		   struct type *func_type,
 		   struct type *valtype,
 		   struct regcache *regcache,
 		   gdb_byte *readbuf,
Index: m32r-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32r-tdep.c,v
retrieving revision 1.54
diff -u -p -r1.54 m32r-tdep.c
--- m32r-tdep.c	20 Feb 2008 14:31:40 -0000	1.54
+++ m32r-tdep.c	15 Apr 2008 11:24:05 -0000
@@ -786,9 +786,9 @@ m32r_extract_return_value (struct type *
 }
 
 enum return_value_convention
-m32r_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		   struct regcache *regcache, gdb_byte *readbuf,
-		   const gdb_byte *writebuf)
+m32r_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *valtype, struct regcache *regcache,
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (TYPE_LENGTH (valtype) > 8)
     return RETURN_VALUE_STRUCT_CONVENTION;
Index: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.123
diff -u -p -r1.123 m68hc11-tdep.c
--- m68hc11-tdep.c	11 Jan 2008 14:43:14 -0000	1.123
+++ m68hc11-tdep.c	15 Apr 2008 11:24:05 -0000
@@ -1311,9 +1311,9 @@ m68hc11_extract_return_value (struct typ
 }
 
 enum return_value_convention
-m68hc11_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		      struct regcache *regcache, gdb_byte *readbuf,
-		      const gdb_byte *writebuf)
+m68hc11_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		      struct type *valtype, struct regcache *regcache,
+		      gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
       || TYPE_CODE (valtype) == TYPE_CODE_UNION
Index: m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.133
diff -u -p -r1.133 m68k-tdep.c
--- m68k-tdep.c	11 Jan 2008 14:43:14 -0000	1.133
+++ m68k-tdep.c	15 Apr 2008 11:24:05 -0000
@@ -372,9 +372,9 @@ m68k_reg_struct_return_p (struct gdbarch
    from WRITEBUF into REGCACHE.  */
 
 static enum return_value_convention
-m68k_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache, gdb_byte *readbuf,
-		   const gdb_byte *writebuf)
+m68k_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum type_code code = TYPE_CODE (type);
 
@@ -407,9 +407,9 @@ m68k_return_value (struct gdbarch *gdbar
 }
 
 static enum return_value_convention
-m68k_svr4_return_value (struct gdbarch *gdbarch, struct type *type,
-			struct regcache *regcache, gdb_byte *readbuf,
-			const gdb_byte *writebuf)
+m68k_svr4_return_value (struct gdbarch *gdbarch, struct type *func_type,
+			struct type *type, struct regcache *regcache,
+			gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum type_code code = TYPE_CODE (type);
 
@@ -446,7 +446,7 @@ m68k_svr4_return_value (struct gdbarch *
   if (code == TYPE_CODE_STRUCT && TYPE_NFIELDS (type) == 1)
     {
       type = check_typedef (TYPE_FIELD_TYPE (type, 0));
-      return m68k_svr4_return_value (gdbarch, type, regcache,
+      return m68k_svr4_return_value (gdbarch, func_type, type, regcache,
 				     readbuf, writebuf);
     }
 
Index: m88k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m88k-tdep.c,v
retrieving revision 1.28
diff -u -p -r1.28 m88k-tdep.c
--- m88k-tdep.c	11 Jan 2008 13:20:02 -0000	1.28
+++ m88k-tdep.c	15 Apr 2008 11:24:05 -0000
@@ -381,9 +381,9 @@ m88k_unwind_dummy_id (struct gdbarch *ar
    from WRITEBUF into REGCACHE.  */
 
 static enum return_value_convention
-m88k_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache, gdb_byte *readbuf,
-		   const gdb_byte *writebuf)
+m88k_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
+		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   int len = TYPE_LENGTH (type);
   gdb_byte buf[8];
Index: mep-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mep-tdep.c,v
retrieving revision 1.13
diff -u -p -r1.13 mep-tdep.c
--- mep-tdep.c	11 Jan 2008 13:20:02 -0000	1.13
+++ mep-tdep.c	15 Apr 2008 11:24:06 -0000
@@ -2195,9 +2195,9 @@ mep_store_return_value (struct gdbarch *
 }
 
 enum return_value_convention
-mep_return_value (struct gdbarch *gdbarch, struct type *type,
-		  struct regcache *regcache, gdb_byte *readbuf,
-		  const gdb_byte *writebuf)
+mep_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		  struct type *type, struct regcache *regcache,
+		  gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (mep_use_struct_convention (type))
     {
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.471
diff -u -p -r1.471 mips-tdep.c
--- mips-tdep.c	15 Mar 2008 00:00:48 -0000	1.471
+++ mips-tdep.c	15 Apr 2008 11:24:06 -0000
@@ -2955,7 +2955,7 @@ mips_eabi_push_dummy_call (struct gdbarc
 /* Determine the return value convention being used.  */
 
 static enum return_value_convention
-mips_eabi_return_value (struct gdbarch *gdbarch,
+mips_eabi_return_value (struct gdbarch *gdbarch, struct type *func_type,
 			struct type *type, struct regcache *regcache,
 			gdb_byte *readbuf, const gdb_byte *writebuf)
 {
@@ -3265,7 +3265,7 @@ mips_n32n64_push_dummy_call (struct gdba
 }
 
 static enum return_value_convention
-mips_n32n64_return_value (struct gdbarch *gdbarch,
+mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type,
 			  struct type *type, struct regcache *regcache,
 			  gdb_byte *readbuf, const gdb_byte *writebuf)
 {
@@ -3723,8 +3723,8 @@ mips_o32_push_dummy_call (struct gdbarch
 }
 
 static enum return_value_convention
-mips_o32_return_value (struct gdbarch *gdbarch, struct type *type,
-		       struct regcache *regcache,
+mips_o32_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		       struct type *type, struct regcache *regcache,
 		       gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -4112,7 +4112,7 @@ mips_o64_push_dummy_call (struct gdbarch
 }
 
 static enum return_value_convention
-mips_o64_return_value (struct gdbarch *gdbarch,
+mips_o64_return_value (struct gdbarch *gdbarch, struct type *func_type,
 		       struct type *type, struct regcache *regcache,
 		       gdb_byte *readbuf, const gdb_byte *writebuf)
 {
Index: mn10300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v
retrieving revision 1.156
diff -u -p -r1.156 mn10300-tdep.c
--- mn10300-tdep.c	7 Apr 2008 11:45:58 -0000	1.156
+++ mn10300-tdep.c	15 Apr 2008 11:24:07 -0000
@@ -196,9 +196,9 @@ mn10300_extract_return_value (struct gdb
    from WRITEBUF into REGCACHE.  */
 
 static enum return_value_convention
-mn10300_return_value (struct gdbarch *gdbarch, struct type *type,
-		      struct regcache *regcache, gdb_byte *readbuf,
-		      const gdb_byte *writebuf)
+mn10300_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		      struct type *type, struct regcache *regcache,
+		      gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (mn10300_use_struct_convention (type))
     return RETURN_VALUE_STRUCT_CONVENTION;
Index: mt-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mt-tdep.c,v
retrieving revision 1.17
diff -u -p -r1.17 mt-tdep.c
--- mt-tdep.c	11 Jan 2008 13:20:02 -0000	1.17
+++ mt-tdep.c	15 Apr 2008 11:24:07 -0000
@@ -332,9 +332,9 @@ mt_register_reggroup_p (struct gdbarch *
    values.  */
 
 static enum return_value_convention
-mt_return_value (struct gdbarch *gdbarch, struct type *type,
-		  struct regcache *regcache, gdb_byte *readbuf,
-		  const gdb_byte *writebuf)
+mt_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		 struct type *type, struct regcache *regcache,
+		 gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (TYPE_LENGTH (type) > 4)
     {
Index: ppc-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v
retrieving revision 1.95
diff -u -p -r1.95 ppc-linux-tdep.c
--- ppc-linux-tdep.c	13 Mar 2008 12:22:13 -0000	1.95
+++ ppc-linux-tdep.c	15 Apr 2008 11:24:07 -0000
@@ -308,9 +308,9 @@ ppc_linux_memory_remove_breakpoint (stru
    which were added later, do get returned in a register though.  */
 
 static enum return_value_convention
-ppc_linux_return_value (struct gdbarch *gdbarch, struct type *valtype,
-			struct regcache *regcache, gdb_byte *readbuf,
-			const gdb_byte *writebuf)
+ppc_linux_return_value (struct gdbarch *gdbarch, struct type *func_type,
+			struct type *valtype, struct regcache *regcache,
+			gdb_byte *readbuf, const gdb_byte *writebuf)
 {  
   if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
        || TYPE_CODE (valtype) == TYPE_CODE_UNION)
@@ -318,8 +318,8 @@ ppc_linux_return_value (struct gdbarch *
 	   && TYPE_VECTOR (valtype)))
     return RETURN_VALUE_STRUCT_CONVENTION;
   else
-    return ppc_sysv_abi_return_value (gdbarch, valtype, regcache, readbuf,
-				      writebuf);
+    return ppc_sysv_abi_return_value (gdbarch, func_type, valtype, regcache,
+				      readbuf, writebuf);
 }
 
 /* Macros for matching instructions.  Note that, since all the
Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.48
diff -u -p -r1.48 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c	2 Feb 2008 00:07:57 -0000	1.48
+++ ppc-sysv-tdep.c	15 Apr 2008 11:24:07 -0000
@@ -805,9 +805,9 @@ do_ppc_sysv_return_value (struct gdbarch
 }
 
 enum return_value_convention
-ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *valtype,
-			   struct regcache *regcache, gdb_byte *readbuf,
-			   const gdb_byte *writebuf)
+ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type,
+			   struct type *valtype, struct regcache *regcache,
+			   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   return do_ppc_sysv_return_value (gdbarch, valtype, regcache, readbuf,
 				   writebuf, 0);
@@ -815,6 +815,7 @@ ppc_sysv_abi_return_value (struct gdbarc
 
 enum return_value_convention
 ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
+				  struct type *func_type,
 				  struct type *valtype,
 				  struct regcache *regcache,
 				  gdb_byte *readbuf, const gdb_byte *writebuf)
@@ -1322,9 +1323,9 @@ ppc64_sysv_abi_push_dummy_call (struct g
    location; when READBUF is non-NULL, fill the buffer from the
    corresponding register return-value location.  */
 enum return_value_convention
-ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *valtype,
-			     struct regcache *regcache, gdb_byte *readbuf,
-			     const gdb_byte *writebuf)
+ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type,
+			     struct type *valtype, struct regcache *regcache,
+			     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
Index: ppc-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/ppc-tdep.h,v
retrieving revision 1.65
diff -u -p -r1.65 ppc-tdep.h
--- ppc-tdep.h	20 Feb 2008 14:31:40 -0000	1.65
+++ ppc-tdep.h	15 Apr 2008 11:24:07 -0000
@@ -29,11 +29,13 @@ struct type;
 
 /* From ppc-linux-tdep.c... */
 enum return_value_convention ppc_sysv_abi_return_value (struct gdbarch *gdbarch,
+							struct type *func_type,
 							struct type *valtype,
 							struct regcache *regcache,
 							gdb_byte *readbuf,
 							const gdb_byte *writebuf);
 enum return_value_convention ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch,
+							       struct type *func_type,
 							       struct type *valtype,
 							       struct regcache *regcache,
 							       gdb_byte *readbuf,
@@ -60,6 +62,7 @@ const struct regset *ppc_linux_gregset (
 const struct regset *ppc_linux_fpregset (void);
 
 enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarch,
+							  struct type *func_type,
 							  struct type *valtype,
 							  struct regcache *regcache,
 							  gdb_byte *readbuf,
Index: ppcnbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppcnbsd-tdep.c,v
retrieving revision 1.36
diff -u -p -r1.36 ppcnbsd-tdep.c
--- ppcnbsd-tdep.c	1 Jan 2008 22:53:12 -0000	1.36
+++ ppcnbsd-tdep.c	15 Apr 2008 11:24:07 -0000
@@ -77,9 +77,9 @@ ppcnbsd_regset_from_core_section (struct
    the moment use the broken convention.  Ulgh!.  */
 
 static enum return_value_convention
-ppcnbsd_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		      struct regcache *regcache, gdb_byte *readbuf,
-		      const gdb_byte *writebuf)
+ppcnbsd_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		      struct type *valtype, struct regcache *regcache,
+		      gdb_byte *readbuf, const gdb_byte *writebuf)
 {
 #if 0
   if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
@@ -93,8 +93,8 @@ ppcnbsd_return_value (struct gdbarch *gd
     return RETURN_VALUE_STRUCT_CONVENTION;
   else
 #endif
-    return ppc_sysv_abi_broken_return_value (gdbarch, valtype, regcache,
-					     readbuf, writebuf);
+    return ppc_sysv_abi_broken_return_value (gdbarch, func_type, valtype,
+					     regcache, readbuf, writebuf);
 }
 
 
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.307
diff -u -p -r1.307 rs6000-tdep.c
--- rs6000-tdep.c	20 Feb 2008 14:34:43 -0000	1.307
+++ rs6000-tdep.c	15 Apr 2008 11:24:08 -0000
@@ -2095,9 +2095,9 @@ ran_out_of_registers_for_arguments:
 }
 
 static enum return_value_convention
-rs6000_return_value (struct gdbarch *gdbarch, struct type *valtype,
-		     struct regcache *regcache, gdb_byte *readbuf,
-		     const gdb_byte *writebuf)
+rs6000_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		     struct type *valtype, struct regcache *regcache,
+		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   gdb_byte buf[8];
Index: s390-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/s390-tdep.c,v
retrieving revision 1.171
diff -u -p -r1.171 s390-tdep.c
--- s390-tdep.c	13 Mar 2008 12:22:13 -0000	1.171
+++ s390-tdep.c	15 Apr 2008 11:24:08 -0000
@@ -2175,9 +2175,9 @@ s390_return_value_convention (struct gdb
 }
 
 static enum return_value_convention
-s390_return_value (struct gdbarch *gdbarch, struct type *type, 
-		   struct regcache *regcache, gdb_byte *out,
-		   const gdb_byte *in)
+s390_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
+		   gdb_byte *out, const gdb_byte *in)
 {
   int word_size = gdbarch_ptr_bit (gdbarch) / 8;
   int length = TYPE_LENGTH (type);
Index: score-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/score-tdep.c,v
retrieving revision 1.14
diff -u -p -r1.14 score-tdep.c
--- score-tdep.c	11 Jan 2008 14:43:15 -0000	1.14
+++ score-tdep.c	15 Apr 2008 11:24:08 -0000
@@ -414,8 +414,8 @@ score_xfer_register (struct regcache *re
 }
 
 static enum return_value_convention
-score_return_value (struct gdbarch *gdbarch, struct type *type,
-                    struct regcache *regcache,
+score_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		    struct type *type, struct regcache *regcache,
                     gdb_byte * readbuf, const gdb_byte * writebuf)
 {
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT
Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.214
diff -u -p -r1.214 sh-tdep.c
--- sh-tdep.c	11 Jan 2008 13:20:02 -0000	1.214
+++ sh-tdep.c	15 Apr 2008 11:24:08 -0000
@@ -1292,8 +1292,8 @@ sh_store_return_value_fpu (struct type *
 }
 
 static enum return_value_convention
-sh_return_value_nofpu (struct gdbarch *gdbarch, struct type *type,
-		       struct regcache *regcache,
+sh_return_value_nofpu (struct gdbarch *gdbarch, struct type *func_type,
+		       struct type *type, struct regcache *regcache,
 		       gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (sh_use_struct_convention (0, type))
@@ -1306,8 +1306,8 @@ sh_return_value_nofpu (struct gdbarch *g
 }
 
 static enum return_value_convention
-sh_return_value_fpu (struct gdbarch *gdbarch, struct type *type,
-		     struct regcache *regcache,
+sh_return_value_fpu (struct gdbarch *gdbarch, struct type *func_type,
+		     struct type *type, struct regcache *regcache,
 		     gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (sh_use_struct_convention (0, type))
Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.58
diff -u -p -r1.58 sh64-tdep.c
--- sh64-tdep.c	11 Jan 2008 13:20:02 -0000	1.58
+++ sh64-tdep.c	15 Apr 2008 11:24:09 -0000
@@ -1301,8 +1301,8 @@ sh64_store_return_value (struct type *ty
 }
 
 static enum return_value_convention
-sh64_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache,
+sh64_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
 		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (sh64_use_struct_convention (type))
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.194
diff -u -p -r1.194 sparc-tdep.c
--- sparc-tdep.c	13 Mar 2008 12:22:13 -0000	1.194
+++ sparc-tdep.c	15 Apr 2008 11:24:09 -0000
@@ -388,7 +388,7 @@ sparc32_push_dummy_code (struct gdbarch 
   *bp_addr = sp - 4;
   *real_pc = funcaddr;
 
-  if (using_struct_return (value_type))
+  if (using_struct_return (find_pc_function (funcaddr), value_type))
     {
       gdb_byte buf[4];
 
@@ -1148,9 +1148,9 @@ sparc32_store_return_value (struct type 
 }
 
 static enum return_value_convention
-sparc32_return_value (struct gdbarch *gdbarch, struct type *type,
-		      struct regcache *regcache, gdb_byte *readbuf,
-		      const gdb_byte *writebuf)
+sparc32_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		      struct type *type, struct regcache *regcache,
+		      gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   /* The psABI says that "...every stack frame reserves the word at
      %fp+64.  If a function returns a structure, union, or
Index: sparc64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v
retrieving revision 1.36
diff -u -p -r1.36 sparc64-tdep.c
--- sparc64-tdep.c	11 Jan 2008 14:43:15 -0000	1.36
+++ sparc64-tdep.c	15 Apr 2008 11:24:09 -0000
@@ -1067,9 +1067,9 @@ sparc64_store_return_value (struct type 
 }
 
 static enum return_value_convention
-sparc64_return_value (struct gdbarch *gdbarch, struct type *type,
-		      struct regcache *regcache, gdb_byte *readbuf,
-		      const gdb_byte *writebuf)
+sparc64_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		      struct type *type, struct regcache *regcache,
+		      gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (TYPE_LENGTH (type) > 32)
     return RETURN_VALUE_STRUCT_CONVENTION;
Index: spu-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-tdep.c,v
retrieving revision 1.28
diff -u -p -r1.28 spu-tdep.c
--- spu-tdep.c	10 Mar 2008 12:36:08 -0000	1.28
+++ spu-tdep.c	15 Apr 2008 11:24:09 -0000
@@ -1204,8 +1204,9 @@ spu_unwind_dummy_id (struct gdbarch *gdb
 /* Function return value access.  */
 
 static enum return_value_convention
-spu_return_value (struct gdbarch *gdbarch, struct type *type,
-                  struct regcache *regcache, gdb_byte *out, const gdb_byte *in)
+spu_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		  struct type *type, struct regcache *regcache,
+		  gdb_byte *out, const gdb_byte *in)
 {
   enum return_value_convention rvc;
 
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.164
diff -u -p -r1.164 stack.c
--- stack.c	17 Mar 2008 15:05:42 -0000	1.164
+++ stack.c	15 Apr 2008 11:24:09 -0000
@@ -1834,7 +1834,7 @@ return_command (char *retval_exp, int fr
            is discarded, side effects such as "return i++" still
            occur.  */
 	return_value = NULL;
-      else if (using_struct_return (return_type))
+      else if (using_struct_return (SYMBOL_TYPE (thisfun), return_type))
 	{
 	  query_prefix = "\
 The location at which to store the function's return value is unknown.\n\
@@ -1888,9 +1888,10 @@ If you continue, the return value that y
     {
       struct type *return_type = value_type (return_value);
       struct gdbarch *gdbarch = get_regcache_arch (get_current_regcache ());
-      gdb_assert (gdbarch_return_value (gdbarch, return_type, NULL, NULL, NULL)
+      gdb_assert (gdbarch_return_value (gdbarch, return_type,
+					SYMBOL_TYPE (thisfun), NULL, NULL, NULL)
 		  == RETURN_VALUE_REGISTER_CONVENTION);
-      gdbarch_return_value (gdbarch, return_type,
+      gdbarch_return_value (gdbarch, return_type, SYMBOL_TYPE (thisfun),
 			    get_current_regcache (), NULL /*read*/,
 			    value_contents (return_value) /*write*/);
     }
Index: v850-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/v850-tdep.c,v
retrieving revision 1.105
diff -u -p -r1.105 v850-tdep.c
--- v850-tdep.c	11 Jan 2008 13:20:02 -0000	1.105
+++ v850-tdep.c	15 Apr 2008 11:24:09 -0000
@@ -790,8 +790,8 @@ v850_store_return_value (struct type *ty
 }
 
 static enum return_value_convention
-v850_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache,
+v850_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		   struct type *type, struct regcache *regcache,
 		   gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (v850_use_struct_convention (type))
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.57
diff -u -p -r1.57 value.c
--- value.c	18 Jan 2008 17:07:40 -0000	1.57
+++ value.c	15 Apr 2008 11:24:10 -0000
@@ -1705,7 +1705,7 @@ coerce_enum (struct value *arg)
    address as a hidden first parameter).  */
 
 int
-using_struct_return (struct type *value_type)
+using_struct_return (struct type *func_type, struct type *value_type)
 {
   enum type_code code = TYPE_CODE (value_type);
 
@@ -1718,7 +1718,7 @@ using_struct_return (struct type *value_
     return 0;
 
   /* Probe the architecture for the return-value convention.  */
-  return (gdbarch_return_value (current_gdbarch, value_type,
+  return (gdbarch_return_value (current_gdbarch, value_type, func_type,
 				NULL, NULL, NULL)
 	  != RETURN_VALUE_REGISTER_CONVENTION);
 }
Index: value.h
===================================================================
RCS file: /cvs/src/src/gdb/value.h,v
retrieving revision 1.110
diff -u -p -r1.110 value.h
--- value.h	6 Apr 2008 08:56:36 -0000	1.110
+++ value.h	15 Apr 2008 11:24:10 -0000
@@ -410,7 +410,8 @@ extern struct value *value_in (struct va
 extern int value_bit_index (struct type *type, const gdb_byte *addr,
 			    int index);
 
-extern int using_struct_return (struct type *value_type);
+extern int using_struct_return (struct type *func_type,
+				struct type *value_type);
 
 extern struct value *evaluate_expression (struct expression *exp);
 
Index: vax-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.c,v
retrieving revision 1.100
diff -u -p -r1.100 vax-tdep.c
--- vax-tdep.c	11 Jan 2008 13:20:02 -0000	1.100
+++ vax-tdep.c	15 Apr 2008 11:24:10 -0000
@@ -201,9 +201,9 @@ vax_unwind_dummy_id (struct gdbarch *gdb
 
 
 static enum return_value_convention
-vax_return_value (struct gdbarch *gdbarch, struct type *type,
-		  struct regcache *regcache, gdb_byte *readbuf,
-		  const gdb_byte *writebuf)
+vax_return_value (struct gdbarch *gdbarch, struct type *func_type,
+		  struct type *type, struct regcache *regcache,
+		  gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   int len = TYPE_LENGTH (type);
   gdb_byte buf[8];
Index: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.101
diff -u -p -r1.101 xstormy16-tdep.c
--- xstormy16-tdep.c	11 Jan 2008 13:20:02 -0000	1.101
+++ xstormy16-tdep.c	15 Apr 2008 11:24:10 -0000
@@ -198,8 +198,8 @@ xstormy16_store_return_value (struct typ
 }
 
 static enum return_value_convention
-xstormy16_return_value (struct gdbarch *gdbarch, struct type *type,
-			struct regcache *regcache,
+xstormy16_return_value (struct gdbarch *gdbarch, struct type *func_type,
+			struct type *type, struct regcache *regcache,
 			gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   if (xstormy16_use_struct_convention (type))
Index: xtensa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xtensa-tdep.c,v
retrieving revision 1.22
diff -u -p -r1.22 xtensa-tdep.c
--- xtensa-tdep.c	11 Feb 2008 21:58:41 -0000	1.22
+++ xtensa-tdep.c	15 Apr 2008 11:24:10 -0000
@@ -1519,6 +1519,7 @@ xtensa_store_return_value (struct type *
 
 static enum return_value_convention
 xtensa_return_value (struct gdbarch *gdbarch,
+		     struct type *func_type,
 		     struct type *valtype,
 		     struct regcache *regcache,
 		     gdb_byte *readbuf,


-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


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