2003-04-05 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sun, 6 Apr 2003 01:13:59 +0000 (01:13 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 6 Apr 2003 01:13:59 +0000 (01:13 +0000)
Eliminate FRAME_FIND_SAVED_REGS.
* config/pa/tm-hppah.h (hppa_hpux_frame_find_saved_regs_in_sigtramp):
Change FSR parameter to a pointer.
* config/pa/tm-hppa64.h (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP):
Assume FSR parameter is a pointer.
* hppa-hpux-tdep.c (hppa_hpux_frame_find_saved_regs_in_sigtramp):
Make fsr a pointer.
* hppa-tdep.c (hppa_frame_find_saved_regs): New function.
(hppa_frame_saved_pc): Call hppa_frame_init_saved_regs.  Make
saved_regs a pointer.
(hppa_frame_saved_pc): Ditto.
(find_dummy_frame_regs): Make frame_saved_regs a pointer
(hppa_pop_frame): Call hppa_frame_init_saved_regs.  Make fsr a
pointer.
(restore_pc_queue): Make fsr a pointer.
(hppa_frame_find_saved_regs): Make frame_saved_regs a pointer.
(hppa_frame_chain): Make saved_regs a pointer, call
hppa_frame_init_saved_regs.
* sparc-tdep.c: Include "gdb_assert.h".
(sparc_frame_find_saved_regs): Replace internal_error with
gdb_assert.
* remote-vxsparc.c (vx_read_register): Delete reference to
FRAME_FIND_SAVED_REGS.
* gdbarch.sh: Delete check for FRAME_FIND_SAVED_REGS.
* gdbarch.h: Regenerate.
* frame.h (DEPRECATED_FRAME_INIT_SAVED_REGS): Delete macro.
(deprecated_get_frame_saved_regs): Delete declaration.
(struct frame_saved_regs): Delete definition.
* frame.c (deprecated_get_frame_saved_regs): Delete function.
* config/pa/tm-hppa.h (hppa_frame_init_saved_regs): Declare.
(hppa_frame_find_saved_regs): Delete declaration.
(FRAME_FIND_SAVED_REGS): Delete macro.
(DEPRECATED_FRAME_INIT_SAVED_REGS): Define.
* config/i386/tm-ptx.h (FRAME_FIND_SAVED_REGS): Delete
FRAME_FIND_SAVED_REGS in comment.

14 files changed:
gdb/ChangeLog
gdb/Makefile.in
gdb/config/i386/tm-ptx.h
gdb/config/pa/tm-hppa.h
gdb/config/pa/tm-hppa64.h
gdb/config/pa/tm-hppah.h
gdb/frame.c
gdb/frame.h
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/hppa-hpux-tdep.c
gdb/hppa-tdep.c
gdb/remote-vxsparc.c
gdb/sparc-tdep.c

index b45380c792ff11ad6a26e2589d479fedfeb8da29..43b2999d77788048711fd227172ddd9b9f1dd407 100644 (file)
@@ -1,3 +1,41 @@
+2003-04-05  Andrew Cagney  <cagney@redhat.com>
+
+       Eliminate FRAME_FIND_SAVED_REGS.
+       * config/pa/tm-hppah.h (hppa_hpux_frame_find_saved_regs_in_sigtramp):
+       Change FSR parameter to a pointer.
+       * config/pa/tm-hppa64.h (FRAME_FIND_SAVED_REGS_IN_SIGTRAMP):
+       Assume FSR parameter is a pointer.
+       * hppa-hpux-tdep.c (hppa_hpux_frame_find_saved_regs_in_sigtramp):
+       Make fsr a pointer.
+       * hppa-tdep.c (hppa_frame_find_saved_regs): New function.
+       (hppa_frame_saved_pc): Call hppa_frame_init_saved_regs.  Make
+       saved_regs a pointer.
+       (hppa_frame_saved_pc): Ditto.
+       (find_dummy_frame_regs): Make frame_saved_regs a pointer
+       (hppa_pop_frame): Call hppa_frame_init_saved_regs.  Make fsr a
+       pointer.
+       (restore_pc_queue): Make fsr a pointer.
+       (hppa_frame_find_saved_regs): Make frame_saved_regs a pointer.
+       (hppa_frame_chain): Make saved_regs a pointer, call
+       hppa_frame_init_saved_regs.
+       * sparc-tdep.c: Include "gdb_assert.h".
+       (sparc_frame_find_saved_regs): Replace internal_error with
+       gdb_assert.
+       * remote-vxsparc.c (vx_read_register): Delete reference to
+       FRAME_FIND_SAVED_REGS.
+       * gdbarch.sh: Delete check for FRAME_FIND_SAVED_REGS.
+       * gdbarch.h: Regenerate.
+       * frame.h (DEPRECATED_FRAME_INIT_SAVED_REGS): Delete macro.
+       (deprecated_get_frame_saved_regs): Delete declaration.
+       (struct frame_saved_regs): Delete definition.
+       * frame.c (deprecated_get_frame_saved_regs): Delete function.
+       * config/pa/tm-hppa.h (hppa_frame_init_saved_regs): Declare.
+       (hppa_frame_find_saved_regs): Delete declaration.
+       (FRAME_FIND_SAVED_REGS): Delete macro.
+       (DEPRECATED_FRAME_INIT_SAVED_REGS): Define.
+       * config/i386/tm-ptx.h (FRAME_FIND_SAVED_REGS): Delete
+       FRAME_FIND_SAVED_REGS in comment.
+
 2003-04-05  Andrew Cagney  <cagney@redhat.com>
 
        * frame.c (frame_func_unwind, get_frame_func): New functions.
index a825d7a2a0f2fe6c5f367e9cf6110f8119f41fde..21255fe9142f38505d8b789ae103f114d4355a3a 100644 (file)
@@ -2208,9 +2208,9 @@ sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(gregset_h)
 sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
        $(regcache_h) $(gdb_wait_h)
 sparc-stub.o: sparc-stub.c
-sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
-       $(inferior_h) $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) \
-       $(regcache_h) $(osabi_h) $(gregset_h) $(gdbcore_h) $(symfile_h)
+sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
+       $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(regcache_h) \
+       $(osabi_h) $(gregset_h) $(gdbcore_h) $(gdb_assert_h) $(symfile_h)
 sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
        $(sparcnbsd_tdep_h)
 sparcl-stub.o: sparcl-stub.c
index 80026e3568ea14cb9e460e2939fc35cf598be025..2f2bba3e58b0770e99f6142784f0ce5a8c060cd3 100644 (file)
@@ -191,10 +191,4 @@ extern const struct floatformat floatformat_i387_ext;      /* from floatformat.h */
 #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
   symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
 
-/*
-   #undef  FRAME_FIND_SAVED_REGS
-   #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-   { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
- */
-
 #endif /* ifndef TM_PTX_H */
index 9c26c798258ce92357870fb02411a9ef454c7426..6089b32b52678500ada62789fcae5736ac10bae8 100644 (file)
@@ -441,11 +441,9 @@ extern int hppa_frame_num_args (struct frame_info *frame);
 #define FRAME_ARGS_SKIP 0
 #endif
 
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
-  hppa_frame_find_saved_regs (frame_info, &frame_saved_regs)
-extern void hppa_frame_find_saved_regs (struct frame_info *,
-                                       struct frame_saved_regs *);
-\f
+extern void hppa_frame_init_saved_regs (struct frame_info *);
+#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) \
+  hppa_frame_init_saved_regs (FI)
 
 /* Things needed for making the inferior call functions.  */
 
index b2b98e408952206df9f40894fa16800abee65b96..503e42688dfa9244c73f9afcce49db50d1418ac6 100644 (file)
@@ -312,11 +312,11 @@ call_dummy
   for (i = 0; i < NUM_REGS; i++) \
     { \
       if (i == SP_REGNUM) \
-        (FSR)->regs[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
+        (FSR)[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
       else if (i >= FP0_REGNUM) \
-        (FSR)->regs[i] = TMP2 + (i - FP0_REGNUM) * 8; \
+        (FSR)[i] = TMP2 + (i - FP0_REGNUM) * 8; \
       else \
-        (FSR)->regs[i] = TMP1 + i * 8; \
+        (FSR)[i] = TMP1 + i * 8; \
     } \
 }
 
index 4e68de992f1d50e1dd2a2e22aac541fff89a72c0..5a457a9db3ac766e1fb7360c854a2bc401cd017e 100644 (file)
@@ -46,9 +46,8 @@ extern void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
 #define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
   hppa_hpux_frame_base_before_sigtramp (FRAME, TMP)
 
-struct frame_saved_regs;
 extern void hppa_hpux_frame_find_saved_regs_in_sigtramp
-              (struct frame_info *fi, struct frame_saved_regs *fsr);
+              (struct frame_info *fi, CORE_ADDR *fsr);
 #define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
   hppa_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
 
index b58900b7f00c4c6a8e7c7245efb7b3ae55d03b7f..5e7f6f1ec05d3ca7f914a501d775fcb58d9f49b5 100644 (file)
@@ -1776,34 +1776,6 @@ deprecated_set_frame_type (struct frame_info *frame, enum frame_type type)
   frame->type = type;
 }
 
-#ifdef FRAME_FIND_SAVED_REGS
-/* XXX - deprecated.  This is a compatibility function for targets
-   that do not yet implement DEPRECATED_FRAME_INIT_SAVED_REGS.  */
-/* Find the addresses in which registers are saved in FRAME.  */
-
-void
-deprecated_get_frame_saved_regs (struct frame_info *frame,
-                                struct frame_saved_regs *saved_regs_addr)
-{
-  if (frame->saved_regs == NULL)
-    {
-      frame->saved_regs = (CORE_ADDR *)
-       frame_obstack_zalloc (SIZEOF_FRAME_SAVED_REGS);
-    }
-  if (saved_regs_addr == NULL)
-    {
-      struct frame_saved_regs saved_regs;
-      FRAME_FIND_SAVED_REGS (frame, saved_regs);
-      memcpy (frame->saved_regs, &saved_regs, SIZEOF_FRAME_SAVED_REGS);
-    }
-  else
-    {
-      FRAME_FIND_SAVED_REGS (frame, *saved_regs_addr);
-      memcpy (frame->saved_regs, saved_regs_addr, SIZEOF_FRAME_SAVED_REGS);
-    }
-}
-#endif
-
 struct frame_extra_info *
 get_frame_extra_info (struct frame_info *fi)
 {
index 1d26209cede51d1cacf3c3368301958ddc8e5659..f928b9c11ba1f1b514930b93fecaf811b8b61c74 100644 (file)
@@ -324,24 +324,6 @@ extern CORE_ADDR frame_pc_unwind (struct frame_info *frame);
    of the caller.  */
 extern void frame_pop (struct frame_info *frame);
 
-/* Describe the saved registers of a frame.  */
-
-#if defined (FRAME_FIND_SAVED_REGS)
-/* XXXX - deprecated */
-struct frame_saved_regs
-  {
-    /* For each register R (except the SP), regs[R] is the address at
-       which it was saved on entry to the frame, or zero if it was not
-       saved on entry to this frame.  This includes special registers
-       such as pc and fp saved in special ways in the stack frame.
-
-       regs[SP_REGNUM] is different.  It holds the actual SP, not the
-       address at which it was saved.  */
-
-    CORE_ADDR regs[NUM_REGS];
-  };
-#endif
-
 /* We keep a cache of stack frames, each of which is a "struct
    frame_info".  The innermost one gets allocated (in
    wait_for_inferior) each time the inferior stops; current_frame
@@ -480,14 +462,6 @@ extern int frame_chain_valid (CORE_ADDR, struct frame_info *);
 
 extern void generic_save_dummy_frame_tos (CORE_ADDR sp);
 
-
-#ifdef FRAME_FIND_SAVED_REGS
-/* XXX - deprecated */
-#define DEPRECATED_FRAME_INIT_SAVED_REGS(FI) deprecated_get_frame_saved_regs (FI, NULL)
-extern void deprecated_get_frame_saved_regs (struct frame_info *,
-                                            struct frame_saved_regs *);
-#endif
-
 extern struct block *get_frame_block (struct frame_info *,
                                       CORE_ADDR *addr_in_block);
 
index 8246bc1b42c7a5d59af159aeabb5249a98d97005..ab1db71cc2bf723173d09d73276d5af9e046fcf1 100644 (file)
@@ -55,12 +55,6 @@ extern struct gdbarch *current_gdbarch;
 /* If any of the following are defined, the target wasn't correctly
    converted. */
 
-#if GDB_MULTI_ARCH
-#if defined (FRAME_FIND_SAVED_REGS)
-#error "FRAME_FIND_SAVED_REGS: replaced by DEPRECATED_FRAME_INIT_SAVED_REGS"
-#endif
-#endif
-
 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
 #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
 #endif
index 7f85063b15b1bfe3cdedfcad35b690a28241be5d..89e640d16befed98cfb30bb85c3994e4eb3234a6 100755 (executable)
@@ -820,12 +820,6 @@ extern struct gdbarch *current_gdbarch;
 /* If any of the following are defined, the target wasn't correctly
    converted. */
 
-#if GDB_MULTI_ARCH
-#if defined (FRAME_FIND_SAVED_REGS)
-#error "FRAME_FIND_SAVED_REGS: replaced by DEPRECATED_FRAME_INIT_SAVED_REGS"
-#endif
-#endif
-
 #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
 #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
 #endif
index 3d1ca88ce50c1363eb5e0f5c4138a9725e7ee5b7..1e1cb917820d98c08d3c9f18ee7c2ff56c688981 100644 (file)
@@ -35,7 +35,7 @@ void hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
 void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
                                            CORE_ADDR *tmp);
 void hppa_hpux_frame_find_saved_regs_in_sigtramp
-      (struct frame_info *fi, struct frame_saved_regs *fsr);
+      (struct frame_info *fi, CORE_ADDR *fsr);
 
 int
 hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
@@ -79,7 +79,7 @@ hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
 
 void
 hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
-                                             struct frame_saved_regs *fsr)
+                                            CORE_ADDR *fsr)
 {
   int i;
   const CORE_ADDR tmp = (fi)->frame + (10 * 4);
@@ -87,9 +87,9 @@ hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
   for (i = 0; i < NUM_REGS; i++)
     {
       if (i == SP_REGNUM)
-       (fsr)->regs[SP_REGNUM] = read_memory_integer (tmp + SP_REGNUM * 4, 4);
+       fsr[SP_REGNUM] = read_memory_integer (tmp + SP_REGNUM * 4, 4);
       else
-       (fsr)->regs[i] = tmp + i * 4;
+       fsr[i] = tmp + i * 4;
     }
 }
 
index c9826e0f9d98300d3bf44413dbf89f30dc42e606..896d638e9e7825a062a9ce0510ab93fab2cfdee9 100644 (file)
@@ -78,8 +78,7 @@ static unsigned extract_5R_store (unsigned int);
 
 static unsigned extract_5r_store (unsigned int);
 
-static void find_dummy_frame_regs (struct frame_info *,
-                                  struct frame_saved_regs *);
+static void find_dummy_frame_regs (struct frame_info *, CORE_ADDR *);
 
 static int find_proc_framesize (CORE_ADDR);
 
@@ -103,7 +102,7 @@ static int low_sign_extend (unsigned int, unsigned int);
 
 static int sign_extend (unsigned int, unsigned int);
 
-static int restore_pc_queue (struct frame_saved_regs *);
+static int restore_pc_queue (CORE_ADDR *);
 
 static int hppa_alignof (struct type *);
 
@@ -943,13 +942,13 @@ hppa_frame_saved_pc (struct frame_info *frame)
          && ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
              || pc_in_interrupt_handler (frame->next->pc)))
        {
-         struct frame_saved_regs saved_regs;
-
-         deprecated_get_frame_saved_regs (frame->next, &saved_regs);
-         if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
+         CORE_ADDR *saved_regs;
+         hppa_frame_init_saved_regs (frame->next);
+         saved_regs = get_frame_saved_regs (frame->next);
+         if (read_memory_integer (saved_regs[FLAGS_REGNUM],
                                   TARGET_PTR_BIT / 8) & 0x2)
            {
-             pc = read_memory_integer (saved_regs.regs[31],
+             pc = read_memory_integer (saved_regs[31],
                                        TARGET_PTR_BIT / 8) & ~0x3;
 
              /* Syscalls are really two frames.  The syscall stub itself
@@ -957,11 +956,11 @@ hppa_frame_saved_pc (struct frame_info *frame)
                 a return pointer in %r31.  We return the %rp variant
                 if %r31 is the same as frame->pc.  */
              if (pc == frame->pc)
-               pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
+               pc = read_memory_integer (saved_regs[RP_REGNUM],
                                          TARGET_PTR_BIT / 8) & ~0x3;
            }
          else
-           pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
+           pc = read_memory_integer (saved_regs[RP_REGNUM],
                                      TARGET_PTR_BIT / 8) & ~0x3;
        }
       else
@@ -983,13 +982,13 @@ hppa_frame_saved_pc (struct frame_info *frame)
          && ((get_frame_type (frame->next) == SIGTRAMP_FRAME)
              || pc_in_interrupt_handler (frame->next->pc)))
        {
-         struct frame_saved_regs saved_regs;
-
-         deprecated_get_frame_saved_regs (frame->next, &saved_regs);
-         if (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
+         CORE_ADDR *saved_regs;
+         hppa_frame_init_saved_regs (frame->next);
+         saved_regs = get_frame_saved_regs (frame->next);
+         if (read_memory_integer (saved_regs[FLAGS_REGNUM],
                                   TARGET_PTR_BIT / 8) & 0x2)
            {
-             pc = read_memory_integer (saved_regs.regs[31],
+             pc = read_memory_integer (saved_regs[31],
                                        TARGET_PTR_BIT / 8) & ~0x3;
 
              /* Syscalls are really two frames.  The syscall stub itself
@@ -997,11 +996,11 @@ hppa_frame_saved_pc (struct frame_info *frame)
                 a return pointer in %r31.  We return the %rp variant
                 if %r31 is the same as frame->pc.  */
              if (pc == frame->pc)
-               pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
+               pc = read_memory_integer (saved_regs[RP_REGNUM],
                                          TARGET_PTR_BIT / 8) & ~0x3;
            }
          else
-           pc = read_memory_integer (saved_regs.regs[RP_REGNUM],
+           pc = read_memory_integer (saved_regs[RP_REGNUM],
                                      TARGET_PTR_BIT / 8) & ~0x3;
        }
       else if (rp_offset == 0)
@@ -1129,9 +1128,9 @@ hppa_frame_chain (struct frame_info *frame)
 
   /* A frame in the current frame list, or zero.  */
   struct frame_info *saved_regs_frame = 0;
-  /* Where the registers were saved in saved_regs_frame.
-     If saved_regs_frame is zero, this is garbage.  */
-  struct frame_saved_regs saved_regs;
+  /* Where the registers were saved in saved_regs_frame.  If
+     saved_regs_frame is zero, this is garbage.  */
+  CORE_ADDR *saved_regs = NULL;
 
   CORE_ADDR caller_pc;
 
@@ -1258,11 +1257,12 @@ hppa_frame_chain (struct frame_info *frame)
          /* The unwind entry claims that r3 is saved here.  However,
             in optimized code, GCC often doesn't actually save r3.
             We'll discover this if we look at the prologue.  */
-         deprecated_get_frame_saved_regs (tmp_frame, &saved_regs);
+         hppa_frame_init_saved_regs (tmp_frame);
+         saved_regs = get_frame_saved_regs (tmp_frame);
          saved_regs_frame = tmp_frame;
 
          /* If we have an address for r3, that's good.  */
-         if (saved_regs.regs[FP_REGNUM])
+         if (saved_regs[FP_REGNUM])
            break;
        }
     }
@@ -1307,21 +1307,24 @@ hppa_frame_chain (struct frame_info *frame)
             system call has a variable sized stack frame.  */
 
          if (tmp_frame != saved_regs_frame)
-           deprecated_get_frame_saved_regs (tmp_frame, &saved_regs);
+           {
+             hppa_frame_init_saved_regs (tmp_frame);
+             saved_regs = get_frame_saved_regs (tmp_frame);
+           }
 
          /* Abominable hack.  */
          if (current_target.to_has_execution == 0
-             && ((saved_regs.regs[FLAGS_REGNUM]
-                  && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
+             && ((saved_regs[FLAGS_REGNUM]
+                  && (read_memory_integer (saved_regs[FLAGS_REGNUM],
                                            TARGET_PTR_BIT / 8)
                       & 0x2))
-                 || (saved_regs.regs[FLAGS_REGNUM] == 0
+                 || (saved_regs[FLAGS_REGNUM] == 0
                      && read_register (FLAGS_REGNUM) & 0x2)))
            {
              u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
              if (!u)
                {
-                 return read_memory_integer (saved_regs.regs[FP_REGNUM],
+                 return read_memory_integer (saved_regs[FP_REGNUM],
                                              TARGET_PTR_BIT / 8);
                }
              else
@@ -1330,7 +1333,7 @@ hppa_frame_chain (struct frame_info *frame)
                }
            }
 
-         return read_memory_integer (saved_regs.regs[FP_REGNUM],
+         return read_memory_integer (saved_regs[FP_REGNUM],
                                      TARGET_PTR_BIT / 8);
        }
     }
@@ -1342,21 +1345,24 @@ hppa_frame_chain (struct frame_info *frame)
        tmp_frame = tmp_frame->next;
 
       if (tmp_frame != saved_regs_frame)
-       deprecated_get_frame_saved_regs (tmp_frame, &saved_regs);
+       {
+         hppa_frame_init_saved_regs (tmp_frame);
+         saved_regs = get_frame_saved_regs (tmp_frame);
+       }
 
       /* Abominable hack.  See above.  */
       if (current_target.to_has_execution == 0
-         && ((saved_regs.regs[FLAGS_REGNUM]
-              && (read_memory_integer (saved_regs.regs[FLAGS_REGNUM],
+         && ((saved_regs[FLAGS_REGNUM]
+              && (read_memory_integer (saved_regs[FLAGS_REGNUM],
                                        TARGET_PTR_BIT / 8)
                   & 0x2))
-             || (saved_regs.regs[FLAGS_REGNUM] == 0
+             || (saved_regs[FLAGS_REGNUM] == 0
                  && read_register (FLAGS_REGNUM) & 0x2)))
        {
          u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
          if (!u)
            {
-             return read_memory_integer (saved_regs.regs[FP_REGNUM],
+             return read_memory_integer (saved_regs[FP_REGNUM],
                                          TARGET_PTR_BIT / 8);
            }
          else
@@ -1496,26 +1502,26 @@ hppa_push_dummy_frame (void)
 
 static void
 find_dummy_frame_regs (struct frame_info *frame,
-                      struct frame_saved_regs *frame_saved_regs)
+                      CORE_ADDR frame_saved_regs[])
 {
   CORE_ADDR fp = frame->frame;
   int i;
 
   /* The 32bit and 64bit ABIs save RP into different locations.  */
   if (REGISTER_SIZE == 8)
-    frame_saved_regs->regs[RP_REGNUM] = (fp - 16) & ~0x3;
+    frame_saved_regs[RP_REGNUM] = (fp - 16) & ~0x3;
   else
-    frame_saved_regs->regs[RP_REGNUM] = (fp - 20) & ~0x3;
+    frame_saved_regs[RP_REGNUM] = (fp - 20) & ~0x3;
 
-  frame_saved_regs->regs[FP_REGNUM] = fp;
+  frame_saved_regs[FP_REGNUM] = fp;
 
-  frame_saved_regs->regs[1] = fp + (2 * REGISTER_SIZE);
+  frame_saved_regs[1] = fp + (2 * REGISTER_SIZE);
 
   for (fp += 3 * REGISTER_SIZE, i = 3; i < 32; i++)
     {
       if (i != FP_REGNUM)
        {
-         frame_saved_regs->regs[i] = fp;
+         frame_saved_regs[i] = fp;
          fp += REGISTER_SIZE;
        }
     }
@@ -1525,14 +1531,14 @@ find_dummy_frame_regs (struct frame_info *frame,
     fp += 4;
 
   for (i = FP0_REGNUM; i < NUM_REGS; i++, fp += 8)
-    frame_saved_regs->regs[i] = fp;
-
-  frame_saved_regs->regs[IPSW_REGNUM] = fp;
-  frame_saved_regs->regs[SAR_REGNUM] = fp + REGISTER_SIZE;
-  frame_saved_regs->regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
-  frame_saved_regs->regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
-  frame_saved_regs->regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
-  frame_saved_regs->regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
+    frame_saved_regs[i] = fp;
+
+  frame_saved_regs[IPSW_REGNUM] = fp;
+  frame_saved_regs[SAR_REGNUM] = fp + REGISTER_SIZE;
+  frame_saved_regs[PCOQ_HEAD_REGNUM] = fp + 2 * REGISTER_SIZE;
+  frame_saved_regs[PCSQ_HEAD_REGNUM] = fp + 3 * REGISTER_SIZE;
+  frame_saved_regs[PCOQ_TAIL_REGNUM] = fp + 4 * REGISTER_SIZE;
+  frame_saved_regs[PCSQ_TAIL_REGNUM] = fp + 5 * REGISTER_SIZE;
 }
 
 void
@@ -1541,44 +1547,45 @@ hppa_pop_frame (void)
   register struct frame_info *frame = get_current_frame ();
   register CORE_ADDR fp, npc, target_pc;
   register int regnum;
-  struct frame_saved_regs fsr;
+  CORE_ADDR *fsr;
   double freg_buffer;
 
   fp = get_frame_base (frame);
-  deprecated_get_frame_saved_regs (frame, &fsr);
+  hppa_frame_init_saved_regs (frame);
+  fsr = get_frame_saved_regs (frame);
 
 #ifndef NO_PC_SPACE_QUEUE_RESTORE
-  if (fsr.regs[IPSW_REGNUM])   /* Restoring a call dummy frame */
-    restore_pc_queue (&fsr);
+  if (fsr[IPSW_REGNUM])        /* Restoring a call dummy frame */
+    restore_pc_queue (fsr);
 #endif
 
   for (regnum = 31; regnum > 0; regnum--)
-    if (fsr.regs[regnum])
-      write_register (regnum, read_memory_integer (fsr.regs[regnum],
+    if (fsr[regnum])
+      write_register (regnum, read_memory_integer (fsr[regnum],
                      REGISTER_SIZE));
 
   for (regnum = NUM_REGS - 1; regnum >= FP0_REGNUM; regnum--)
-    if (fsr.regs[regnum])
+    if (fsr[regnum])
       {
-       read_memory (fsr.regs[regnum], (char *) &freg_buffer, 8);
+       read_memory (fsr[regnum], (char *) &freg_buffer, 8);
        deprecated_write_register_bytes (REGISTER_BYTE (regnum),
                                         (char *) &freg_buffer, 8);
       }
 
-  if (fsr.regs[IPSW_REGNUM])
+  if (fsr[IPSW_REGNUM])
     write_register (IPSW_REGNUM,
-                   read_memory_integer (fsr.regs[IPSW_REGNUM],
+                   read_memory_integer (fsr[IPSW_REGNUM],
                                         REGISTER_SIZE));
 
-  if (fsr.regs[SAR_REGNUM])
+  if (fsr[SAR_REGNUM])
     write_register (SAR_REGNUM,
-                   read_memory_integer (fsr.regs[SAR_REGNUM],
+                   read_memory_integer (fsr[SAR_REGNUM],
                                         REGISTER_SIZE));
 
   /* If the PC was explicitly saved, then just restore it.  */
-  if (fsr.regs[PCOQ_TAIL_REGNUM])
+  if (fsr[PCOQ_TAIL_REGNUM])
     {
-      npc = read_memory_integer (fsr.regs[PCOQ_TAIL_REGNUM],
+      npc = read_memory_integer (fsr[PCOQ_TAIL_REGNUM],
                                 REGISTER_SIZE);
       write_register (PCOQ_TAIL_REGNUM, npc);
     }
@@ -1591,7 +1598,7 @@ hppa_pop_frame (void)
 
   write_register (FP_REGNUM, read_memory_integer (fp, REGISTER_SIZE));
 
-  if (fsr.regs[IPSW_REGNUM])   /* call dummy */
+  if (fsr[IPSW_REGNUM])        /* call dummy */
     write_register (SP_REGNUM, fp - 48);
   else
     write_register (SP_REGNUM, fp);
@@ -1604,7 +1611,7 @@ hppa_pop_frame (void)
 
      Don't skip through the trampoline if we're popping a dummy frame.  */
   target_pc = SKIP_TRAMPOLINE_CODE (npc & ~0x3) & ~0x3;
-  if (target_pc && !fsr.regs[IPSW_REGNUM])
+  if (target_pc && !fsr[IPSW_REGNUM])
     {
       struct symtab_and_line sal;
       struct breakpoint *breakpoint;
@@ -1635,10 +1642,10 @@ hppa_pop_frame (void)
    queue space registers. */
 
 static int
-restore_pc_queue (struct frame_saved_regs *fsr)
+restore_pc_queue (CORE_ADDR *fsr)
 {
   CORE_ADDR pc = read_pc ();
-  CORE_ADDR new_pc = read_memory_integer (fsr->regs[PCOQ_HEAD_REGNUM],
+  CORE_ADDR new_pc = read_memory_integer (fsr[PCOQ_HEAD_REGNUM],
                                          TARGET_PTR_BIT / 8);
   struct target_waitstatus w;
   int insn_count;
@@ -1657,7 +1664,7 @@ restore_pc_queue (struct frame_saved_regs *fsr)
      So, load up the registers and single step until we are in the
      right place. */
 
-  write_register (21, read_memory_integer (fsr->regs[PCSQ_HEAD_REGNUM],
+  write_register (21, read_memory_integer (fsr[PCSQ_HEAD_REGNUM],
                                           REGISTER_SIZE));
   write_register (22, new_pc);
 
@@ -3842,15 +3849,15 @@ hppa_skip_prologue (CORE_ADDR pc)
     return (skip_prologue_hard_way (pc));
 }
 
-/* Put here the code to store, into a struct frame_saved_regs,
-   the addresses of the saved registers of frame described by FRAME_INFO.
-   This includes special registers such as pc and fp saved in special
-   ways in the stack frame.  sp is even more special:
-   the address we return for it IS the sp for the next frame.  */
+/* Put here the code to store, into the SAVED_REGS, the addresses of
+   the saved registers of frame described by FRAME_INFO.  This
+   includes special registers such as pc and fp saved in special ways
+   in the stack frame.  sp is even more special: the address we return
+   for it IS the sp for the next frame.  */
 
 void
 hppa_frame_find_saved_regs (struct frame_info *frame_info,
-                           struct frame_saved_regs *frame_saved_regs)
+                           CORE_ADDR frame_saved_regs[])
 {
   CORE_ADDR pc;
   struct unwind_table_entry *u;
@@ -3861,7 +3868,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
   int final_iteration;
 
   /* Zero out everything.  */
-  memset (frame_saved_regs, '\0', sizeof (struct frame_saved_regs));
+  memset (frame_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
 
   /* Call dummy frames always look the same, so there's no need to
      examine the dummy code to determine locations of saved registers;
@@ -3892,11 +3899,11 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
        {
          /* SP is a little special.  */
          if (i == SP_REGNUM)
-           frame_saved_regs->regs[SP_REGNUM]
+           frame_saved_regs[SP_REGNUM]
              = read_memory_integer (frame_info->frame + SP_REGNUM * 4,
                                     TARGET_PTR_BIT / 8);
          else
-           frame_saved_regs->regs[i] = frame_info->frame + i * 4;
+           frame_saved_regs[i] = frame_info->frame + i * 4;
        }
       return;
     }
@@ -3945,7 +3952,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
   /* The frame always represents the value of %sp at entry to the
      current function (and is thus equivalent to the "saved" stack
      pointer.  */
-  frame_saved_regs->regs[SP_REGNUM] = frame_info->frame;
+  frame_saved_regs[SP_REGNUM] = frame_info->frame;
 
   /* Loop until we find everything of interest or hit a branch.
 
@@ -3980,12 +3987,12 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
       if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
        {
          save_rp = 0;
-         frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 20;
+         frame_saved_regs[RP_REGNUM] = frame_info->frame - 20;
        }
       else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
        {
          save_rp = 0;
-         frame_saved_regs->regs[RP_REGNUM] = frame_info->frame - 16;
+         frame_saved_regs[RP_REGNUM] = frame_info->frame - 16;
        }
 
       /* Note if we saved SP into the stack.  This also happens to indicate
@@ -3993,7 +4000,7 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
       if (   (inst & 0xffffc000) == 0x6fc10000  /* stw,ma r1,N(sr0,sp) */
           || (inst & 0xffffc00c) == 0x73c10008) /* std,ma r1,N(sr0,sp) */
        {
-         frame_saved_regs->regs[FP_REGNUM] = frame_info->frame;
+         frame_saved_regs[FP_REGNUM] = frame_info->frame;
          save_sp = 0;
        }
 
@@ -4007,10 +4014,10 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
          /* stwm with a positive displacement is a *post modify*.  */
          if ((inst >> 26) == 0x1b
              && extract_14 (inst) >= 0)
-           frame_saved_regs->regs[reg] = frame_info->frame;
+           frame_saved_regs[reg] = frame_info->frame;
          /* A std has explicit post_modify forms.  */
          else if ((inst & 0xfc00000c0) == 0x70000008)
-           frame_saved_regs->regs[reg] = frame_info->frame;
+           frame_saved_regs[reg] = frame_info->frame;
          else
            {
              CORE_ADDR offset;
@@ -4024,10 +4031,10 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
 
              /* Handle code with and without frame pointers.  */
              if (u->Save_SP)
-               frame_saved_regs->regs[reg]
+               frame_saved_regs[reg]
                  = frame_info->frame + offset;
              else
-               frame_saved_regs->regs[reg]
+               frame_saved_regs[reg]
                  = (frame_info->frame + (u->Total_frame_size << 3)
                     + offset);
            }
@@ -4060,12 +4067,12 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
              /* 1st HP CC FP register store.  After this instruction
                 we've set enough state that the GCC and HPCC code are
                 both handled in the same manner.  */
-             frame_saved_regs->regs[reg + FP4_REGNUM + 4] = frame_info->frame;
+             frame_saved_regs[reg + FP4_REGNUM + 4] = frame_info->frame;
              fp_loc = 8;
            }
          else
            {
-             frame_saved_regs->regs[reg + FP0_REGNUM + 4]
+             frame_saved_regs[reg + FP0_REGNUM + 4]
                = frame_info->frame + fp_loc;
              fp_loc += 8;
            }
@@ -4085,6 +4092,17 @@ hppa_frame_find_saved_regs (struct frame_info *frame_info,
     }
 }
 
+/* XXX - deprecated.  This is a compatibility function for targets
+   that do not yet implement DEPRECATED_FRAME_INIT_SAVED_REGS.  */
+/* Find the addresses in which registers are saved in FRAME.  */
+
+void
+hppa_frame_init_saved_regs (struct frame_info *frame)
+{
+  if (get_frame_saved_regs (frame) == NULL)
+    frame_saved_regs_zalloc (frame);
+  hppa_frame_find_saved_regs (frame, get_frame_saved_regs (frame));
+}
 
 /* Exception handling support for the HP-UX ANSI C++ compiler.
    The compiler (aCC) provides a callback for exception events;
index eb59b9fb43a70437b6768f4c9122229132d370ac..a97c18eed997f4e3681bd194b6a2ace147e039b3 100644 (file)
@@ -97,10 +97,9 @@ vx_read_register (int regno)
   bcopy (&sparc_greg_packet[SPARC_R_Y],
         &deprecated_registers[REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
 
-  /* Now write the local and in registers to the register window
-     spill area in the frame.  VxWorks does not do this for the
-     active frame automatically; it greatly simplifies debugging
-     (FRAME_FIND_SAVED_REGS, in particular, depends on this).  */
+  /* Now write the local and in registers to the register window spill
+     area in the frame.  VxWorks does not do this for the active frame
+     automatically; it greatly simplifies debugging.  */
 
   sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
                        REGISTER_RAW_SIZE (SP_REGNUM));
index 0e57aefd9d5ffc24651d9c395a083ef43ecaa547..da50574aba33aa36aed611379186696859cb3474 100644 (file)
@@ -41,6 +41,7 @@
 #endif
 
 #include "gdbcore.h"
+#include "gdb_assert.h"
 
 #include "symfile.h"   /* for 'entry_point_address' */
 
@@ -1133,9 +1134,7 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
   register int regnum;
   CORE_ADDR frame_addr = get_frame_base (fi);
 
-  if (!fi)
-    internal_error (__FILE__, __LINE__,
-                   "Bad frame info struct in FRAME_FIND_SAVED_REGS");
+  gdb_assert (fi != NULL);
 
   memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR));