2004-05-01 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sat, 1 May 2004 22:41:34 +0000 (22:41 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 1 May 2004 22:41:34 +0000 (22:41 +0000)
* frame.c (deprecated_generic_get_saved_register): Delete
function, moved to "xstormy16-tdep.c".
* xstormy16-tdep.c (xstormy16_get_saved_register): Inline
deprecated_generic_get_saved_register from "frame.c".
(xstormy16_frame_saved_register): Call
xstormy16_get_saved_register.
* dummy-frame.c (deprecated_find_dummy_frame_regcache): Make
static.
* dummy-frame.h (deprecated_find_dummy_frame_regcache): Delete.
* frame.h (deprecated_generic_get_saved_register): Delete.

gdb/ChangeLog
gdb/dummy-frame.c
gdb/dummy-frame.h
gdb/frame.c
gdb/frame.h
gdb/xstormy16-tdep.c

index fd62e367d5b60c504e7b722261fa8c5515699ed9..35833c622a84368c2d5bfd805f3171e216e39ee4 100644 (file)
@@ -1,3 +1,16 @@
+2004-05-01  Andrew Cagney  <cagney@redhat.com>
+
+       * frame.c (deprecated_generic_get_saved_register): Delete
+       function, moved to "xstormy16-tdep.c".
+       * xstormy16-tdep.c (xstormy16_get_saved_register): Inline
+       deprecated_generic_get_saved_register from "frame.c".
+       (xstormy16_frame_saved_register): Call
+       xstormy16_get_saved_register.
+       * dummy-frame.c (deprecated_find_dummy_frame_regcache): Make
+       static.
+       * dummy-frame.h (deprecated_find_dummy_frame_regcache): Delete.
+       * frame.h (deprecated_generic_get_saved_register): Delete.
+
 2004-05-01  Michael Chastain  <mec.gnu@mindspring.com>
 
        * dwarfread.c: Update documentation on the state of dwarf-1.
@@ -21,8 +34,6 @@
        * s390-tdep.c (s390_prologue_frame_unwind_cache): Delete calls to
        frame_relative_level.
 
-2004-05-01  Andrew Cagney  <cagney@redhat.com>
-
        * frame.h (deprecated_set_frame_type): Delete declaration.
        * frame.c (deprecated_set_frame_type): Delete function, update
        comments.
index 216db678ba9f69162aeaeeda52542c140a8efef6..d55b3bd4e004d40b3783d56de5d4a26b87416eaa 100644 (file)
@@ -112,7 +112,7 @@ find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
   return NULL;
 }
 
-struct regcache *
+static struct regcache *
 deprecated_find_dummy_frame_regcache (CORE_ADDR pc, CORE_ADDR fp)
 {
   struct dummy_frame *dummy = find_dummy_frame (pc, fp);
index 7f4c38f69629c8c54c9b632e017c83a5d26717ef..07f8f5a57fa124b5a2691da18c510dad570ebf63 100644 (file)
@@ -32,12 +32,4 @@ struct frame_id;
 
 extern const struct frame_unwind *dummy_frame_sniffer (struct frame_info *next_frame);
 
-/* Return the regcache that belongs to the dummy-frame identifed by PC
-   and FP, or NULL if no such frame exists.  */
-/* FIXME: cagney/2002-11-08: The function only exists because of
-   deprecated_generic_get_saved_register.  Eliminate that function and
-   this, to, can go.  */
-
-extern struct regcache *deprecated_find_dummy_frame_regcache (CORE_ADDR pc,
-                                                             CORE_ADDR fp);
 #endif /* !defined (DUMMY_FRAME_H)  */
index 5359fd323a10d9d5558cd1025ce5e3a3eb4ea8bf..8fb0344220218f226f72cfdd1a473b15ba97a301 100644 (file)
@@ -1057,109 +1057,6 @@ const struct frame_unwind legacy_saved_regs_unwinder = {
 };
 const struct frame_unwind *legacy_saved_regs_unwind = &legacy_saved_regs_unwinder;
 
-
-/* Function: deprecated_generic_get_saved_register
-   Find register number REGNUM relative to FRAME and put its (raw,
-   target format) contents in *RAW_BUFFER.
-
-   Set *OPTIMIZED if the variable was optimized out (and thus can't be
-   fetched).  Note that this is never set to anything other than zero
-   in this implementation.
-
-   Set *LVAL to lval_memory, lval_register, or not_lval, depending on
-   whether the value was fetched from memory, from a register, or in a
-   strange and non-modifiable way (e.g. a frame pointer which was
-   calculated rather than fetched).  We will use not_lval for values
-   fetched from generic dummy frames.
-
-   Set *ADDRP to the address, either in memory or as a
-   DEPRECATED_REGISTER_BYTE offset into the registers array.  If the
-   value is stored in a dummy frame, set *ADDRP to zero.
-
-   The argument RAW_BUFFER must point to aligned memory.  */
-
-void
-deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
-                                      CORE_ADDR *addrp,
-                                      struct frame_info *frame, int regnum,
-                                      enum lval_type *lval)
-{
-  if (!target_has_registers)
-    error ("No registers.");
-
-  /* Normal systems don't optimize out things with register numbers.  */
-  if (optimized != NULL)
-    *optimized = 0;
-
-  if (addrp)                   /* default assumption: not found in memory */
-    *addrp = 0;
-
-  /* Note: since the current frame's registers could only have been
-     saved by frames INTERIOR TO the current frame, we skip examining
-     the current frame itself: otherwise, we would be getting the
-     previous frame's registers which were saved by the current frame.  */
-
-  if (frame != NULL)
-    {
-      for (frame = get_next_frame (frame);
-          frame_relative_level (frame) >= 0;
-          frame = get_next_frame (frame))
-       {
-         if (get_frame_type (frame) == DUMMY_FRAME)
-           {
-             if (lval)         /* found it in a CALL_DUMMY frame */
-               *lval = not_lval;
-             if (raw_buffer)
-               /* FIXME: cagney/2002-06-26: This should be via the
-                  gdbarch_register_read() method so that it, on the
-                  fly, constructs either a raw or pseudo register
-                  from the raw register cache.  */
-               regcache_raw_read
-                 (deprecated_find_dummy_frame_regcache (get_frame_pc (frame),
-                                                        get_frame_base (frame)),
-                  regnum, raw_buffer);
-             return;
-           }
-
-         DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
-         if (deprecated_get_frame_saved_regs (frame) != NULL
-             && deprecated_get_frame_saved_regs (frame)[regnum] != 0)
-           {
-             if (lval)         /* found it saved on the stack */
-               *lval = lval_memory;
-             if (regnum == SP_REGNUM)
-               {
-                 if (raw_buffer)       /* SP register treated specially */
-                   /* NOTE: cagney/2003-05-09: In-line store_address()
-                       with it's body - store_unsigned_integer().  */
-                   store_unsigned_integer (raw_buffer,
-                                           DEPRECATED_REGISTER_RAW_SIZE (regnum),
-                                           deprecated_get_frame_saved_regs (frame)[regnum]);
-               }
-             else
-               {
-                 if (addrp)    /* any other register */
-                   *addrp = deprecated_get_frame_saved_regs (frame)[regnum];
-                 if (raw_buffer)
-                   read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer,
-                                DEPRECATED_REGISTER_RAW_SIZE (regnum));
-               }
-             return;
-           }
-       }
-    }
-
-  /* If we get thru the loop to this point, it means the register was
-     not saved in any frame.  Return the actual live-register value.  */
-
-  if (lval)                    /* found it in a live register */
-    *lval = lval_register;
-  if (addrp)
-    *addrp = DEPRECATED_REGISTER_BYTE (regnum);
-  if (raw_buffer)
-    deprecated_read_register_gen (regnum, raw_buffer);
-}
-
 /* Determine the frame's type based on its PC.  */
 
 static enum frame_type
index a6e84a6c94786f544202cb108834ed0b6e50b595..2ab8b8edf6b3adaee9341ad18abc7566271d8c8f 100644 (file)
@@ -574,13 +574,6 @@ extern int deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp,
 extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
 
 
-/* The DEPRECATED_GET_SAVED_REGISTER architecture interface is
-   entirely redundant.  New architectures should implement per-frame
-   unwinders (ref "frame-unwind.h").  */
-extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *,
-                                                  struct frame_info *, int,
-                                                  enum lval_type *);
-
 extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
 
 /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a
index 9e7b016f1c6fe3afe307ee48b90f0e72f5538448..6ca97331aac6e6bf41bc2666f2336c4f2dd3de5e 100644 (file)
@@ -167,16 +167,116 @@ xstormy16_reg_virtual_type (int regnum)
 }
 
 /* Function: xstormy16_get_saved_register
-   Find a register's saved value on the call stack. */
+   Find a register's saved value on the call stack.
+
+   Find register number REGNUM relative to FRAME and put its (raw,
+   target format) contents in *RAW_BUFFER.
+
+   Set *OPTIMIZED if the variable was optimized out (and thus can't be
+   fetched).  Note that this is never set to anything other than zero
+   in this implementation.
+
+   Set *LVAL to lval_memory, lval_register, or not_lval, depending on
+   whether the value was fetched from memory, from a register, or in a
+   strange and non-modifiable way (e.g. a frame pointer which was
+   calculated rather than fetched).  We will use not_lval for values
+   fetched from generic dummy frames.
+
+   Set *ADDRP to the address, either in memory or as a
+   DEPRECATED_REGISTER_BYTE offset into the registers array.  If the
+   value is stored in a dummy frame, set *ADDRP to zero.
+
+   The argument RAW_BUFFER must point to aligned memory.
+
+   The GET_SAVED_REGISTER architecture interface is entirely
+   redundant.  New architectures should implement per-frame unwinders
+   (ref "frame-unwind.h").  */
 
 static void
-xstormy16_get_saved_register (char *raw_buffer,
-                             int *optimized,
+xstormy16_get_saved_register (char *raw_buffer, int *optimized,
                              CORE_ADDR *addrp,
-                             struct frame_info *fi,
-                             int regnum, enum lval_type *lval)
+                             struct frame_info *frame, int regnum,
+                             enum lval_type *lval)
 {
-  deprecated_generic_get_saved_register (raw_buffer, optimized, addrp, fi, regnum, lval);
+  if (!target_has_registers)
+    error ("No registers.");
+
+  /* Normal systems don't optimize out things with register numbers.  */
+  if (optimized != NULL)
+    *optimized = 0;
+
+  if (addrp)                   /* default assumption: not found in memory */
+    *addrp = 0;
+
+  /* Note: since the current frame's registers could only have been
+     saved by frames INTERIOR TO the current frame, we skip examining
+     the current frame itself: otherwise, we would be getting the
+     previous frame's registers which were saved by the current frame.  */
+
+  if (frame != NULL)
+    {
+      for (frame = get_next_frame (frame);
+          get_frame_type (frame) != SENTINEL_FRAME;
+          frame = get_next_frame (frame))
+       {
+         if (get_frame_type (frame) == DUMMY_FRAME)
+           {
+             if (lval)         /* found it in a CALL_DUMMY frame */
+               *lval = not_lval;
+             if (raw_buffer)
+               {
+                 LONGEST val;
+                 /* FIXME: cagney/2002-06-26: This should be via the
+                    gdbarch_register_read() method so that it, on the
+                    fly, constructs either a raw or pseudo register
+                    from the raw register cache.  */
+                 val = deprecated_read_register_dummy (get_frame_pc (frame),
+                                                       get_frame_base (frame),
+                                                       regnum);
+                 store_unsigned_integer (raw_buffer,
+                                         DEPRECATED_REGISTER_RAW_SIZE (regnum),
+                                         val);
+               }
+             return;
+           }
+
+         DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
+         if (deprecated_get_frame_saved_regs (frame) != NULL
+             && deprecated_get_frame_saved_regs (frame)[regnum] != 0)
+           {
+             if (lval)         /* found it saved on the stack */
+               *lval = lval_memory;
+             if (regnum == SP_REGNUM)
+               {
+                 if (raw_buffer)       /* SP register treated specially */
+                   /* NOTE: cagney/2003-05-09: In-line store_address()
+                       with it's body - store_unsigned_integer().  */
+                   store_unsigned_integer (raw_buffer,
+                                           DEPRECATED_REGISTER_RAW_SIZE (regnum),
+                                           deprecated_get_frame_saved_regs (frame)[regnum]);
+               }
+             else
+               {
+                 if (addrp)    /* any other register */
+                   *addrp = deprecated_get_frame_saved_regs (frame)[regnum];
+                 if (raw_buffer)
+                   read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer,
+                                DEPRECATED_REGISTER_RAW_SIZE (regnum));
+               }
+             return;
+           }
+       }
+    }
+
+  /* If we get thru the loop to this point, it means the register was
+     not saved in any frame.  Return the actual live-register value.  */
+
+  if (lval)                    /* found it in a live register */
+    *lval = lval_register;
+  if (addrp)
+    *addrp = DEPRECATED_REGISTER_BYTE (regnum);
+  if (raw_buffer)
+    deprecated_read_register_gen (regnum, raw_buffer);
 }
 
 /* Function: xstormy16_type_is_scalar
@@ -433,7 +533,7 @@ xstormy16_frame_saved_register (struct frame_info *fi, int regnum)
   int size = xstormy16_register_raw_size (regnum);
   char *buf = (char *) alloca (size);
 
-  deprecated_generic_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
+  xstormy16_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
   return (CORE_ADDR) extract_unsigned_integer (buf, size);
 }