2000-07-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 24 Jul 2000 14:29:23 +0000 (14:29 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 24 Jul 2000 14:29:23 +0000 (14:29 +0000)
         * 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.

gdb/ChangeLog
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/inferior.h

index d03e54a219f09f6f1cc2023c81ddbfd9b20871b8..1ff13d84419b4a63f6af6af8bcd3be5a919700ae 100644 (file)
@@ -1,3 +1,16 @@
+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.
+
 2000-07-24  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
 
        * gdbarch.sh: Add NUM_PSEUDO_REGS to the gdbarch structure.
index e0953ff4eb1ab8f0f12ae86a0dd8309f01fc9c97..31fb37fe0532513bf1c4c2fa184cf38b3f90f93b 100644 (file)
@@ -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)
 {
index 556141758b12278daeddc58dfc3c5b411ad6b8fa..51c83aa160a093b606bc22166009392294586dbe 100644 (file)
@@ -603,6 +603,34 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc
 #endif
 #endif
 
+/* Default (function) for non- multi-arch platforms. */
+#if (GDB_MULTI_ARCH == 0) && !defined (FETCH_PSEUDO_REGISTER)
+#define FETCH_PSEUDO_REGISTER(regnum) (internal_error ("FETCH_PSEUDO_REGISTER"), 0)
+#endif
+
+typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum);
+extern void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_fetch_pseudo_register_ftype *fetch_pseudo_register);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > 1) || !defined (FETCH_PSEUDO_REGISTER)
+#define FETCH_PSEUDO_REGISTER(regnum) (gdbarch_fetch_pseudo_register (current_gdbarch, regnum))
+#endif
+#endif
+
+/* Default (function) for non- multi-arch platforms. */
+#if (GDB_MULTI_ARCH == 0) && !defined (STORE_PSEUDO_REGISTER)
+#define STORE_PSEUDO_REGISTER(regnum) (internal_error ("STORE_PSEUDO_REGISTER"), 0)
+#endif
+
+typedef void (gdbarch_store_pseudo_register_ftype) (int regnum);
+extern void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum);
+extern void set_gdbarch_store_pseudo_register (struct gdbarch *gdbarch, gdbarch_store_pseudo_register_ftype *store_pseudo_register);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > 1) || !defined (STORE_PSEUDO_REGISTER)
+#define STORE_PSEUDO_REGISTER(regnum) (gdbarch_store_pseudo_register (current_gdbarch, regnum))
+#endif
+#endif
+
 /* Default (function) for non- multi-arch platforms. */
 #if (GDB_MULTI_ARCH == 0) && !defined (POINTER_TO_ADDRESS)
 #define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
index b7c592cc5ef64830c671b33d9b26554722842ddb..5925ecd294af0c873b3f780e98482bf349b02843 100755 (executable)
@@ -338,6 +338,14 @@ f:1:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized,
 f:1:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
 f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
 f:2:REGISTER_CONVERT_TO_RAW:void:register_convert_to_raw:struct type *type, int regnum, char *from, char *to:type, regnum, from, to:::0::0
+#This function is called when the value of a pseudo-register needs
+#to be updated.  Typically it will be defined on a per-architecture
+#basis.
+f:2:FETCH_PSEUDO_REGISTER:void:fetch_pseudo_register:int regnum:regnum:::0::0
+#This function is called when the value of a pseudo-register needs
+#to be set or stored.  Typically it will be defined on a per-architecture
+#basis.
+f:2:STORE_PSEUDO_REGISTER:void:store_pseudo_register:int regnum:regnum:::0::0
 #
 f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, void *buf:type, buf:::unsigned_pointer_to_address::0
 f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0
index eb947d1bf37baf9f35c161cf8aa8f9cc7de4ae2d..0281d249c5714d23d242be05c0c3ca7d0bde9af5 100644 (file)
@@ -59,20 +59,6 @@ extern void write_inferior_status_register (struct inferior_status
 #define ARCH_NUM_REGS NUM_REGS
 #endif
 
-/* This function is called when the value of a pseudo-register needs
-   to be updated.  Typically it will be defined on a per-architecture
-   basis.  FIXME: move into gdbarch.[ch].  */
-#ifndef ARCH_FETCH_PSEUDO_REGISTERS
-#define ARCH_FETCH_PSEUDO_REGISTERS(REGNUM) /* no-op */
-#endif
-
-/* This function is called when the value of a pseudo-register needs
-   to be set or stored.  Typically it will be defined on a per-architecture
-   basis.  FIXME: move into gdbarch.[ch].  */
-#ifndef ARCH_STORE_PSEUDO_REGISTERS
-#define ARCH_STORE_PSEUDO_REGISTERS(REGNUM) /* no-op */
-#endif
-
 extern void set_sigint_trap (void);
 
 extern void clear_sigint_trap (void);