* sparc-tdep.c (sparc32_extract_struct_value_address): Rename from
authorMark Kettenis <kettenis@gnu.org>
Sun, 11 Jan 2004 20:47:53 +0000 (20:47 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 11 Jan 2004 20:47:53 +0000 (20:47 +0000)
sparc_extract_struct_value_address.
(sparc32_gdbarch_init): Set extract_struct_value_address.
* sparc64-tdep.c (sparc64_extract_struct_value_address): New
function.
(sparc64_init_abi): Set extract_struct_value_address.  Don't set
return_value_on_stack.

gdb/ChangeLog
gdb/sparc-tdep.c
gdb/sparc64-tdep.c

index c26ac148707ea89e31e7a6086fbbb336bb1f6d97..3fc95a8181f9c92b08d2c565309ded12534cb620 100644 (file)
@@ -1,5 +1,13 @@
 2004-01-11  Mark Kettenis  <kettenis@gnu.org>
 
+       * sparc-tdep.c (sparc32_extract_struct_value_address): Rename from
+       sparc_extract_struct_value_address.
+       (sparc32_gdbarch_init): Set extract_struct_value_address.
+       * sparc64-tdep.c (sparc64_extract_struct_value_address): New
+       function.
+       (sparc64_init_abi): Set extract_struct_value_address.  Don't set
+       return_value_on_stack.
+
        * NEWS: Mention that %cs and %ss have been added to the AMD64
        configurations
 
index 26d2c2431bb5ebdf2ad175e24a73792664b5433d..e79f038429f7726f1368b117b32023988a999c0c 100644 (file)
@@ -839,7 +839,7 @@ sparc32_return_value (struct gdbarch *gdbarch, struct type *type,
    CORE_ADDR.  */
 
 static CORE_ADDR
-sparc_extract_struct_value_address (struct regcache *regcache)
+sparc32_extract_struct_value_address (struct regcache *regcache)
 {
   ULONGEST sp;
 
@@ -1069,6 +1069,8 @@ 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);
 
index 2e56ec972a172e91619e3b3d7ebed6aa74170e4c..b32a24c51b2ea9375772450801a8f2520c8fa07a 100644 (file)
@@ -1086,6 +1086,19 @@ 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;
+}
 \f
 
 void
@@ -1117,8 +1130,8 @@ 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_return_value_on_stack
-    (gdbarch, generic_return_value_on_stack_not);
+  set_gdbarch_extract_struct_value_address
+    (gdbarch, sparc64_extract_struct_value_address);
   set_gdbarch_stabs_argument_has_addr
     (gdbarch, default_stabs_argument_has_addr);