]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2003-01-19 Andrew Cagney <ac131313@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Sun, 19 Jan 2003 18:56:32 +0000 (18:56 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 19 Jan 2003 18:56:32 +0000 (18:56 +0000)
* d10v-frame.c: Use D10V_RET1_REGNUM.
(saved_regs_unwinder): Don't use get_frame_saved_regs.
* frame.c (get_prev_frame): Always initialize frame.frame.
(get_frame_base): Return frame.frame.

gdb/ChangeLog
gdb/d10v-frame.c
gdb/d10v-tdep.c
gdb/frame.c

index 1ab571050f7c0162fe9c5a6aaa49ebe79613dab5..1029e8564c813b34ee5d6d9eb222501e005a8876 100644 (file)
@@ -1,3 +1,21 @@
+2003-01-19  Andrew Cagney  <ac131313@redhat.com>
+
+       * d10v-frame.c: Use D10V_RET1_REGNUM.
+       (saved_regs_unwinder): Don't use get_frame_saved_regs.
+       * frame.c (get_prev_frame): Always initialize frame.frame.
+       (get_frame_base): Return frame.frame.
+
+2003-01-13  Andrew Cagney  <ac131313@redhat.com>
+
+       * gdbarch.sh (FRAME_INIT_SAVED_REGS): Change to function with
+       predicate.
+       * gdbarch.h, gdbarch.c: Regenerate.
+       * stack.c (frame_info): Only initialize the saved registers when
+       FRAME_INIT_SAVED_REGS_P.
+       * frame.c (frame_saved_regs_register_unwind): Assert
+       FRAME_INIT_SAVED_REGS_P.
+       (deprecated_generic_get_saved_register): Ditto.
+
 2003-01-13  Andrew Cagney  <ac131313@redhat.com>
 
        * d10v-tdep.c: Include "d10v-tdep.h".  Update to use D10V_
index 5b29545c535cf6a1107d2dde8329ee0d90c3562f..45e2dd9417f8f9900d12b45bd723adaedd1c1498 100644 (file)
@@ -311,7 +311,7 @@ saved_regs_unwinder (struct frame_info *frame,
          if (bufferp != NULL)
            {
              /* Read the value in from memory.  */
-             read_memory (get_frame_saved_regs (frame)[regnum], bufferp,
+             read_memory (saved_regs[regnum], bufferp,
                           REGISTER_RAW_SIZE (regnum));
            }
        }
index e6152e41b4698955403e06a3d3c2b868421b2d05..353efe25b5ddf000a3cb62dcdfb42537b72cba4f 100644 (file)
@@ -459,7 +459,7 @@ d10v_store_return_value (struct type *type, struct regcache *regcache,
     {
       bfd_byte tmp[2];
       tmp[1] = *(bfd_byte *)valbuf;
-      regcache_cooked_write (regcache, RET1_REGNUM, tmp);
+      regcache_cooked_write (regcache, D10V_RET1_REGNUM, tmp);
     }
   else
     {
@@ -471,7 +471,7 @@ d10v_store_return_value (struct type *type, struct regcache *regcache,
          out any dangling byte at the end of the buffer.  */
       for (reg = 0; (reg * 2) + 1 < TYPE_LENGTH (type); reg++)
        {
-         regcache_cooked_write (regcache, RET1_REGNUM + reg,
+         regcache_cooked_write (regcache, D10V_RET1_REGNUM + reg,
                                 (bfd_byte *) valbuf + reg * 2);
        }
       /* Write out any dangling byte at the end of the buffer.  */
@@ -489,8 +489,8 @@ static CORE_ADDR
 d10v_extract_struct_value_address (struct regcache *regcache)
 {
   ULONGEST addr;
-  regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &addr);
-  return (addr | DMEM_START);
+  regcache_cooked_read_unsigned (regcache, D10V_ARG1_REGNUM, &addr);
+  return (addr | D10V_DMEM_START);
 }
 
 static CORE_ADDR
@@ -1093,7 +1093,7 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache,
   if (TYPE_LENGTH (type) == 1)
     {
       ULONGEST c;
-      regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &c);
+      regcache_cooked_read_unsigned (regcache, D10V_RET1_REGNUM, &c);
       store_unsigned_integer (valbuf, 1, c);
     }
   else
@@ -1103,11 +1103,11 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache,
         remaining bytes in remaining registers. Interestingly, when
         such values are passed in, the last byte is in the most
         significant byte of that same register - wierd. */
-      int reg = RET1_REGNUM;
+      int reg = D10V_RET1_REGNUM;
       int off = 0;
       if (TYPE_LENGTH (type) & 1)
        {
-         regcache_cooked_read_part (regcache, RET1_REGNUM, 1, 1,
+         regcache_cooked_read_part (regcache, D10V_RET1_REGNUM, 1, 1,
                                     (bfd_byte *)valbuf + off);
          off++;
          reg++;
@@ -1115,7 +1115,7 @@ d10v_extract_return_value (struct type *type, struct regcache *regcache,
       /* Transfer the remaining registers.  */
       for (; off < TYPE_LENGTH (type); reg++, off += 2)
        {
-         regcache_cooked_read (regcache, RET1_REGNUM + reg,
+         regcache_cooked_read (regcache, D10V_RET1_REGNUM + reg,
                                (bfd_byte *) valbuf + off);
        }
     }
index 217662381ebdc2d0c3a9f88dcd0927f2ef8f656a..bcad061eed506be202dfb5e04fd201872209a4df 100644 (file)
@@ -973,27 +973,17 @@ get_prev_frame (struct frame_info *next_frame)
   prev_frame->unwind = frame_unwind_find_by_pc (current_gdbarch,
                                                prev_frame->pc);
 
-  /* Now figure out how to initialize this new frame.  Perhaphs one
-     day, this will too, be selected by set_unwind_by_pc().  */
-  if (prev_frame->type != DUMMY_FRAME)
-    {
-      /* A dummy frame doesn't need to unwind the frame ID because the
-        frame ID comes from the previous frame.  The other frames do
-        though.  True?  */
-#if 0
-      /* Oops, the frame doesn't chain.  Treat this as the last frame.  */
-      prev_frame->id = frame_id_unwind (next_frame);
-      if (!frame_id_p (prev_frame->id))
-       return NULL;
-#else      
-      /* FIXME: cagney/2002-12-18: Instead of this hack, should just
-        save the frame ID directly.  */
-      struct frame_id id = frame_id_unwind (next_frame);
-      if (!frame_id_p (id))
-       return NULL;
-      prev_frame->frame = id.base;
-#endif
-    }
+  /* FIXME: cagney/2003-01-13: A dummy frame doesn't need to unwind
+     the frame ID because the frame ID comes from the previous frame.
+     The other frames do though.  True?  */
+  {
+    /* FIXME: cagney/2002-12-18: Instead of this hack, should just
+       save the frame ID directly.  */
+    struct frame_id id = frame_id_unwind (next_frame);
+    if (!frame_id_p (id))
+      return NULL;
+    prev_frame->frame = id.base;
+  }
 
   /* Link it in.  */
   next_frame->prev = prev_frame;
@@ -1077,8 +1067,14 @@ find_frame_sal (struct frame_info *frame, struct symtab_and_line *sal)
 CORE_ADDR
 get_frame_base (struct frame_info *fi)
 {
+#if 1
+  /* FIXME: cagney/2003-01-13: Should be using the frame base obtained
+     by unwinding the previous frame.  */
+  return fi->frame;
+#else
   struct frame_id id = frame_id_unwind (fi->next);
   return id.base;
+#endif
 }
 
 /* Level of the selected frame: 0 for innermost, 1 for its caller, ...