aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-19 18:56:32 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-19 18:56:32 +0000
commit102a6c5ab462bb4625f9f812d05566bd72b11e8d (patch)
tree067eb0d053b15dd7e41971c54b7ef429bc9b542f
parent95b0f7acf7a81a5c76d8744171c318f95de054dd (diff)
downloadgdb-102a6c5ab462bb4625f9f812d05566bd72b11e8d.zip
gdb-102a6c5ab462bb4625f9f812d05566bd72b11e8d.tar.gz
gdb-102a6c5ab462bb4625f9f812d05566bd72b11e8d.tar.bz2
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.
-rw-r--r--gdb/ChangeLog18
-rw-r--r--gdb/d10v-frame.c2
-rw-r--r--gdb/d10v-tdep.c16
-rw-r--r--gdb/frame.c38
4 files changed, 44 insertions, 30 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1ab5710..1029e85 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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_
diff --git a/gdb/d10v-frame.c b/gdb/d10v-frame.c
index 5b29545..45e2dd9 100644
--- a/gdb/d10v-frame.c
+++ b/gdb/d10v-frame.c
@@ -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));
}
}
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index e6152e4..353efe2 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -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);
}
}
diff --git a/gdb/frame.c b/gdb/frame.c
index 2176623..bcad061 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -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, ...