* [PATCH] Activate extract_struct_value_address for SPARC and UltraSPARC
@ 2004-01-11 20:48 Mark Kettenis
2004-01-11 21:12 ` Andrew Cagney
0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2004-01-11 20:48 UTC (permalink / raw)
To: gdb-patches
Andrews -Wunused-function message pointed out that this wasn't hooked
up. So some of my previous patches were absolutely useless. Anyway,
this corrects the problem, and hooks things up. No regressions in
structs.exp on NetBSD/sparc and FreeBSD/sparc64.
Committed,
Mark
Index: ChangeLog
from 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.
Index: sparc-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-tdep.c,v
retrieving revision 1.138
diff -u -p -r1.138 sparc-tdep.c
--- sparc-tdep.c 10 Jan 2004 23:43:25 -0000 1.138
+++ sparc-tdep.c 11 Jan 2004 20:42:13 -0000
@@ -839,7 +839,7 @@ sparc32_return_value (struct gdbarch *gd
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_inf
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: sparc64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 sparc64-tdep.c
--- sparc64-tdep.c 4 Jan 2004 12:18:25 -0000 1.8
+++ sparc64-tdep.c 11 Jan 2004 20:42:13 -0000
@@ -1086,6 +1086,19 @@ sparc64_return_value (struct gdbarch *gd
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 in
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);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Activate extract_struct_value_address for SPARC and UltraSPARC
2004-01-11 20:48 [PATCH] Activate extract_struct_value_address for SPARC and UltraSPARC Mark Kettenis
@ 2004-01-11 21:12 ` Andrew Cagney
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2004-01-11 21:12 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
> Andrews -Wunused-function message pointed out that this wasn't hooked
> up. So some of my previous patches were absolutely useless. Anyway,
> this corrects the problem, and hooks things up. No regressions in
> structs.exp on NetBSD/sparc and FreeBSD/sparc64.
Um,
> + set_gdbarch_extract_struct_value_address
> + (gdbarch, sparc32_extract_struct_value_address);
Is this one ever called?
> +/* 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;
> +}
and does this work reliably?
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-11 21:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-11 20:48 [PATCH] Activate extract_struct_value_address for SPARC and UltraSPARC Mark Kettenis
2004-01-11 21:12 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox