aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-24 19:48:13 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-24 19:48:13 +0000
commitc193f6ac9cadbfcaf4bae1a46d01b6c2a4f66bb4 (patch)
tree94e43a5b7c11851202f9ea9b4f725dd041f7b7a8 /gdb/frame.c
parente5d2af146b35918deacdec7270a9e6890410e1a5 (diff)
downloadgdb-c193f6ac9cadbfcaf4bae1a46d01b6c2a4f66bb4.zip
gdb-c193f6ac9cadbfcaf4bae1a46d01b6c2a4f66bb4.tar.gz
gdb-c193f6ac9cadbfcaf4bae1a46d01b6c2a4f66bb4.tar.bz2
2002-11-19 Andrew Cagney <ac131313@redhat.com>
* frame.h (FRAME_FP): Delete macro. (get_frame_base): New function declaration. * frame.c (get_frame_base): New function. (get_frame_id): Use ->frame. (frame_find_by_id): Rewrite to use get_frame_id. * blockframe.c: Use get_frame_base instead of FRAME_FP. * cris-tdep.c, d10v-tdep.c, findvar.c, h8500-tdep.c: Ditto. * hppa-tdep.c, i386-tdep.c, infcmd.c, infrun.c: Ditto. * m68hc11-tdep.c, m68k-tdep.c, mcore-tdep.c, mips-tdep.c: Ditto. * mn10200-tdep.c, mn10300-tdep.c, rs6000-tdep.c: Ditto. * sh-tdep.c, sparc-tdep.c, stack.c, tracepoint.c: Ditto. * v850-tdep.c, valops.c, z8k-tdep.c: Ditto.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index ba692c5..cf7f2b9 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -47,7 +47,7 @@ get_frame_id (struct frame_info *fi, struct frame_id *id)
}
else
{
- id->base = FRAME_FP (fi);
+ id->base = fi->frame;
id->pc = fi->pc;
}
}
@@ -66,19 +66,21 @@ frame_find_by_id (struct frame_id id)
frame != NULL;
frame = get_prev_frame (frame))
{
- if (INNER_THAN (FRAME_FP (frame), id.base))
+ struct frame_id this;
+ get_frame_id (frame, &this);
+ if (INNER_THAN (this.base, id.base))
/* ``inner/current < frame < id.base''. Keep looking along
the frame chain. */
continue;
- if (INNER_THAN (id.base, FRAME_FP (frame)))
+ if (INNER_THAN (id.base, this.base))
/* ``inner/current < id.base < frame''. Oops, gone past it.
Just give up. */
return NULL;
/* FIXME: cagney/2002-04-21: This isn't sufficient. It should
- use id.pc to check that the two frames belong to the same
- function. Otherwise we'll do things like match dummy frames
- or mis-match frameless functions. However, until someone
- notices, stick with the existing behavour. */
+ use id.pc / this.pc to check that the two frames belong to
+ the same function. Otherwise we'll do things like match
+ dummy frames or mis-match frameless functions. However,
+ until someone notices, stick with the existing behavour. */
return frame;
}
return NULL;
@@ -826,7 +828,7 @@ get_prev_frame (struct frame_info *next_frame)
/* FIXME: 2002-11-09: There isn't any reason to special case this
edge condition. Instead the per-architecture code should hande
it locally. */
- address = FRAME_FP (next_frame);
+ address = get_frame_base (next_frame);
else
{
/* Two macros defined in tm.h specify the machine-dependent
@@ -1018,6 +1020,14 @@ get_frame_pc (struct frame_info *frame)
return frame->pc;
}
+/* Per "frame.h", return the ``address'' of the frame. Code should
+ really be using get_frame_id(). */
+CORE_ADDR
+get_frame_base (struct frame_info *fi)
+{
+ return fi->frame;
+}
+
/* Level of the selected frame: 0 for innermost, 1 for its caller, ...
or -1 for a NULL frame. */