This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[obish:sh64,xstormy16] Update extract_struct_value_address
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com,Elena Zannoni <ezannoni at redhat dot com>,Corinna Vinschen <vinschen at redhat dot com>
- Date: Sat, 17 Jan 2004 14:37:26 -0500
- Subject: [obish:sh64,xstormy16] Update extract_struct_value_address
FYI,
This updates the sh64 and xstormy16 files to today's
extract_struct_value_address interface, a fairly mechanical task.
Can I encourage each of you to check the relevant ABI and see if it
specifies that the return value address register should be preserved.
If it doesn't this function can simply be deleted.
committed as obish,
Andrew
2004-01-17 Andrew Cagney <cagney@redhat.com>
* xstormy16-tdep.c: Update copyright.
(xstormy16_extract_struct_value_address): Update to current
extract struct value address interface.
(xstormy16_gdbarch_init): Set extract_struct_value_address.
* sh64-tdep.c (sh64_extract_struct_value_address): Update to
current extract struct value address interface.
(sh64_gdbarch_init): Set extract_struct_value_address.
Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.18
diff -u -r1.18 sh64-tdep.c
--- sh64-tdep.c 17 Jan 2004 15:34:12 -0000 1.18
+++ sh64-tdep.c 17 Jan 2004 19:32:37 -0000
@@ -1342,11 +1342,14 @@
}
static CORE_ADDR
-sh64_extract_struct_value_address (char *regbuf)
+sh64_extract_struct_value_address (struct regcache *regcache)
{
- return (extract_unsigned_integer ((regbuf + DEPRECATED_REGISTER_BYTE (STRUCT_RETURN_REGNUM)),
- register_size (current_gdbarch,
- STRUCT_RETURN_REGNUM)));
+ /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return
+ address regster is preserved across function calls? Probably
+ not, making this function wrong. */
+ ULONGEST val;
+ regcache_raw_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &val);
+ return val;
}
static CORE_ADDR
@@ -2884,7 +2887,7 @@
set_gdbarch_deprecated_push_return_address (gdbarch, sh64_push_return_address);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
set_gdbarch_deprecated_store_struct_return (gdbarch, sh64_store_struct_return);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
+ set_gdbarch_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame);
set_gdbarch_elf_make_msymbol_special (gdbarch,
Index: xstormy16-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/xstormy16-tdep.c,v
retrieving revision 1.68
diff -u -r1.68 xstormy16-tdep.c
--- xstormy16-tdep.c 17 Jan 2004 15:34:13 -0000 1.68
+++ xstormy16-tdep.c 17 Jan 2004 19:32:50 -0000
@@ -1,6 +1,6 @@
/* Target-dependent code for the Sanyo Xstormy16a (LC590000) processor.
- Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
@@ -409,10 +409,14 @@
*/
static CORE_ADDR
-xstormy16_extract_struct_value_address (char *regbuf)
+xstormy16_extract_struct_value_address (struct regcache *regcache)
{
- return extract_unsigned_integer (regbuf + xstormy16_register_byte (E_PTR_RET_REGNUM),
- xstormy16_reg_size);
+ /* FIXME: cagney/2004-01-17: Does the ABI guarantee that the return
+ address regster is preserved across function calls? Probably
+ not, making this function wrong. */
+ ULONGEST val;
+ regcache_raw_read_unsigned (regcache, E_PTR_RET_REGNUM, &val);
+ return val;
}
/* Function: xstormy16_use_struct_convention
@@ -1082,7 +1086,7 @@
set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame);
set_gdbarch_deprecated_store_struct_return (gdbarch, xstormy16_store_struct_return);
set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
+ set_gdbarch_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
set_gdbarch_use_struct_convention (gdbarch,
xstormy16_use_struct_convention);
set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);