2003-03-05 Andrew Cagney <cagney@redhat.com>

* frame.h (struct frame_info): Replace "id_unwind_cache_p" and
	"id_unwind_cache" with "id".
	(frame_id_unwind): Delete declaration.
	* frame.c (frame_id_unwind): Delete function.
	(get_prev_frame): Call the frame id unwind method directly.  Store
	the returned next frame's ID value in NEXT_FRAME.  Note that there
	is a problem with the wrong unwind ID being called with the wrong
	unwind cache.
This commit is contained in:
Andrew Cagney
2003-03-05 18:51:17 +00:00
parent ed363b1b5e
commit 218e59567e
3 changed files with 50 additions and 48 deletions

View File

@ -1,3 +1,14 @@
2003-03-05 Andrew Cagney <cagney@redhat.com>
* frame.h (struct frame_info): Replace "id_unwind_cache_p" and
"id_unwind_cache" with "id".
(frame_id_unwind): Delete declaration.
* frame.c (frame_id_unwind): Delete function.
(get_prev_frame): Call the frame id unwind method directly. Store
the returned next frame's ID value in NEXT_FRAME. Note that there
is a problem with the wrong unwind ID being called with the wrong
unwind cache.
2003-03-05 Daniel Jacobowitz <drow@mvista.com> 2003-03-05 Daniel Jacobowitz <drow@mvista.com>
* Makefile.in (FLAGS_TO_PASS): Add LDFLAGS. * Makefile.in (FLAGS_TO_PASS): Add LDFLAGS.

View File

@ -145,17 +145,6 @@ frame_pc_unwind (struct frame_info *frame)
return frame->pc_unwind_cache; return frame->pc_unwind_cache;
} }
struct frame_id
frame_id_unwind (struct frame_info *frame)
{
if (!frame->id_unwind_cache_p)
{
frame->unwind->id (frame, &frame->unwind_cache, &frame->id_unwind_cache);
frame->id_unwind_cache_p = 1;
}
return frame->id_unwind_cache;
}
void void
frame_pop (struct frame_info *frame) frame_pop (struct frame_info *frame)
{ {
@ -1344,36 +1333,42 @@ get_prev_frame (struct frame_info *next_frame)
/* FIXME: cagney/2003-01-13: A dummy frame doesn't need to unwind /* 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 frame ID because the frame ID comes from the previous frame.
The other frames do though. True? */ The other frames do though. True? */
{ /* FIXME: cagney/2003-03-04: The below call isn't right. It should
/* FIXME: cagney/2002-12-18: Instead of this hack, should just instead be doing something like "prev_frame -> unwind -> id
save the frame ID directly. */ (next_frame, & prev_frame -> unwind_cache, & prev_frame -> id)"
struct frame_id id = frame_id_unwind (next_frame); but that requires more extensive (pending) changes. */
/* Check that the unwound ID is valid. As of 2003-02-24 the next_frame->unwind->id (next_frame, &next_frame->unwind_cache,
x86-64 was returning an invalid frame ID when trying to do an &prev_frame->id);
unwind a sentinel frame that belonged to a frame dummy. */ /* Check that the unwound ID is valid. As of 2003-02-24 the x86-64
if (!frame_id_p (id)) was returning an invalid frame ID when trying to do an unwind a
{ sentinel frame that belonged to a frame dummy. */
if (frame_debug) if (!frame_id_p (prev_frame->id))
fprintf_unfiltered (gdb_stdlog, {
"Outermost frame - unwound frame ID invalid\n"); if (frame_debug)
return NULL; fprintf_unfiltered (gdb_stdlog,
} "Outermost frame - unwound frame ID invalid\n");
/* Check that the new frame isn't inner to (younger, below, next) return NULL;
the old frame. If that happens the frame unwind is going }
backwards. */ /* Check that the new frame isn't inner to (younger, below, next)
/* FIXME: cagney/2003-02-25: Ignore the sentinel frame since that the old frame. If that happens the frame unwind is going
doesn't have a valid frame ID. Should instead set the sentinel backwards. */
frame's frame ID to a `sentinel'. Leave it until after the /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since that
switch to storing the frame ID, instead of the frame base, in doesn't have a valid frame ID. Should instead set the sentinel
the frame object. */ frame's frame ID to a `sentinel'. Leave it until after the
if (next_frame->level >= 0 switch to storing the frame ID, instead of the frame base, in the
&& frame_id_inner (id, get_frame_id (next_frame))) frame object. */
error ("Unwound frame inner-to selected frame (corrupt stack?)"); if (next_frame->level >= 0
/* Note that, due to frameless functions, the stronger test of the && frame_id_inner (prev_frame->id, get_frame_id (next_frame)))
new frame being outer to the old frame can't be used - error ("Unwound frame inner-to selected frame (corrupt stack?)");
frameless functions differ by only their PC value. */ /* Note that, due to frameless functions, the stronger test of the
prev_frame->frame = id.base; new frame being outer to the old frame can't be used - frameless
} functions differ by only their PC value. */
/* FIXME: cagney/2002-12-18: Instead of this hack, should only store
the frame ID in PREV_FRAME. Unfortunatly, some architectures
(HP/UX) still reply on EXTRA_FRAME_INFO and, hence, still poke at
the "struct frame_info" object directly. */
prev_frame->frame = prev_frame->id.base;
/* Link it in. */ /* Link it in. */
next_frame->prev = prev_frame; next_frame->prev = prev_frame;

View File

@ -310,10 +310,6 @@ extern const char *frame_map_regnum_to_name (int regnum);
extern CORE_ADDR frame_pc_unwind (struct frame_info *frame); extern CORE_ADDR frame_pc_unwind (struct frame_info *frame);
/* Unwind the frame ID. Return an ID that uniquely identifies the
caller's frame. */
extern struct frame_id frame_id_unwind (struct frame_info *frame);
/* Discard the specified frame. Restoring the registers to the state /* Discard the specified frame. Restoring the registers to the state
of the caller. */ of the caller. */
extern void frame_pop (struct frame_info *frame); extern void frame_pop (struct frame_info *frame);
@ -412,9 +408,9 @@ struct frame_info
int pc_unwind_cache_p; int pc_unwind_cache_p;
CORE_ADDR pc_unwind_cache; CORE_ADDR pc_unwind_cache;
/* Cached copy of the previous frame's ID. */ /* This frame's ID. Note that the frame's ID, base and PC contain
int id_unwind_cache_p; redundant information. */
struct frame_id id_unwind_cache; struct frame_id id;
/* Pointers to the next (down, inner, younger) and previous (up, /* Pointers to the next (down, inner, younger) and previous (up,
outer, older) frame_info's in the frame cache. */ outer, older) frame_info's in the frame cache. */