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.
This commit is contained in:
Andrew Cagney 2002-11-24 19:48:13 +00:00
parent e5d2af146b
commit c193f6ac9c
25 changed files with 128 additions and 73 deletions

View file

@ -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. */