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]

[PATCH] Print in-memory return values for VAX


Committed.  Improves things a wee bit on OpenBSD/vax.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* vax-tdep.c (vax_return_value): Implement
	RETURN_VALUE_ABI_RETURNS_ADDRESS.

Index: vax-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.c,v
retrieving revision 1.79
diff -u -p -r1.79 vax-tdep.c
--- vax-tdep.c 17 May 2004 21:56:19 -0000 1.79
+++ vax-tdep.c 17 May 2004 22:10:00 -0000
@@ -212,7 +212,21 @@ vax_return_value (struct gdbarch *gdbarc
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT
       || TYPE_CODE (type) == TYPE_CODE_UNION
       || TYPE_CODE (type) == TYPE_CODE_ARRAY)
-    return RETURN_VALUE_STRUCT_CONVENTION;
+    {
+      /* The default on VAX is to return structures in static memory.
+         Consequently a function must return the address where we can
+         find the return value.  */
+
+      if (readbuf)
+	{
+	  ULONGEST addr;
+
+	  regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
+	  read_memory (addr, readbuf, len);
+	}
+
+      return RETURN_VALUE_ABI_RETURNS_ADDRESS;
+    }
 
   if (readbuf)
     {


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