aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-07-24 14:29:23 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-07-24 14:29:23 +0000
commit7f1b25859d7894b8ec513894c42352243988e6a5 (patch)
tree75e878058fbab2cc1fa24e96fd52fdf68328b156 /gdb/gdbarch.c
parent0aba1244556ea8cb395fa0590d772e74fb9512b5 (diff)
downloadgdb-7f1b25859d7894b8ec513894c42352243988e6a5.zip
gdb-7f1b25859d7894b8ec513894c42352243988e6a5.tar.gz
gdb-7f1b25859d7894b8ec513894c42352243988e6a5.tar.bz2
2000-07-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* gdbarch.sh: Add FETCH_PSEUDO_REGISTER and STORE_PSEUDO_REGISTER to the gdbarch structure. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * inferior.h (FETCH_PSEUDO_REGISTER, STORE_PSEUDO_REGISTER): Delete macros. * regcache.c (write_register, read_register, write_register_bytes, write_register_gen, read_register_bytes, read_register_gen): Rename ARCH_FECTH_PSEUDO_REGISTERS to FETCH_PSEUDO_REGISTERS and ARCH_STORE_PSEUDO_REGISTER to STORE_PSEUDO_REGISTER.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index e0953ff..31fb37f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -182,6 +182,8 @@ struct gdbarch
gdbarch_register_convertible_ftype *register_convertible;
gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
+ gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register;
+ gdbarch_store_pseudo_register_ftype *store_pseudo_register;
gdbarch_pointer_to_address_ftype *pointer_to_address;
gdbarch_address_to_pointer_ftype *address_to_pointer;
gdbarch_return_value_on_stack_ftype *return_value_on_stack;
@@ -342,6 +344,8 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
+ 0,
/* startup_gdbarch() */
};
@@ -564,6 +568,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of register_convertible, invalid_p == 0 */
/* Skip verify of register_convert_to_virtual, invalid_p == 0 */
/* Skip verify of register_convert_to_raw, invalid_p == 0 */
+ /* Skip verify of fetch_pseudo_register, invalid_p == 0 */
+ /* Skip verify of store_pseudo_register, invalid_p == 0 */
/* Skip verify of pointer_to_address, invalid_p == 0 */
/* Skip verify of address_to_pointer, invalid_p == 0 */
/* Skip verify of return_value_on_stack, invalid_p == 0 */
@@ -980,6 +986,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
XSTRING (REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
#endif
+#if defined (FETCH_PSEUDO_REGISTER) && GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FETCH_PSEUDO_REGISTER(regnum)",
+ XSTRING (FETCH_PSEUDO_REGISTER (regnum)));
+#endif
+#if defined (STORE_PSEUDO_REGISTER) && GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STORE_PSEUDO_REGISTER(regnum)",
+ XSTRING (STORE_PSEUDO_REGISTER (regnum)));
+#endif
#ifdef POINTER_TO_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1569,6 +1589,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->register_convert_to_raw
/*REGISTER_CONVERT_TO_RAW ()*/);
#endif
+#ifdef FETCH_PSEUDO_REGISTER
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FETCH_PSEUDO_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->fetch_pseudo_register
+ /*FETCH_PSEUDO_REGISTER ()*/);
+#endif
+#ifdef STORE_PSEUDO_REGISTER
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STORE_PSEUDO_REGISTER = 0x%08lx\n",
+ (long) current_gdbarch->store_pseudo_register
+ /*STORE_PSEUDO_REGISTER ()*/);
+#endif
#ifdef POINTER_TO_ADDRESS
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
@@ -2800,6 +2834,40 @@ set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch,
gdbarch->register_convert_to_raw = register_convert_to_raw;
}
+void
+gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum)
+{
+ if (gdbarch->fetch_pseudo_register == 0)
+ internal_error ("gdbarch: gdbarch_fetch_pseudo_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n");
+ gdbarch->fetch_pseudo_register (regnum);
+}
+
+void
+set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch,
+ gdbarch_fetch_pseudo_register_ftype fetch_pseudo_register)
+{
+ gdbarch->fetch_pseudo_register = fetch_pseudo_register;
+}
+
+void
+gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum)
+{
+ if (gdbarch->store_pseudo_register == 0)
+ internal_error ("gdbarch: gdbarch_store_pseudo_register invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n");
+ gdbarch->store_pseudo_register (regnum);
+}
+
+void
+set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch,
+ gdbarch_store_pseudo_register_ftype store_pseudo_register)
+{
+ gdbarch->store_pseudo_register = store_pseudo_register;
+}
+
CORE_ADDR
gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf)
{