2003-07-15 Andrew Cagney <cagney@redhat.com>

* frame.c (get_frame_id): Use frame_unwind_find_by_frame.
	(frame_register_unwind, create_new_frame): Ditto.
	(legacy_get_prev_frame, get_frame_type): Ditto.
	(get_frame_base_address): Use frame_base_find_by_frame.
	(get_frame_locals_address): Use frame_base_find_by_frame.
	(get_frame_args_address): Use frame_base_find_by_frame.
	* frame-base.h (frame_base_sniffer_ftype): Declare.
	(frame_base_append_sniffer): Declare.
	(frame_base_find_by_frame): Replace frame_base_find_by_pc.
	* frame-base.c (append_predicate): Add a "sniffer" parameter.
	(frame_base_append_sniffer): New function.
	(frame_base_append_predicate): Add a NULL sniffer.
	(frame_base_find_by_frame): Replace "frame_base_find_by_pc".
	(struct frame_base_table): Add "sniffer".
	(frame_base_free): Free the "sniffer" table.
	* frame-unwind.h (frame_unwind_sniffer_ftype): Define.
	(frame_unwind_append_sniffer): Declare.
	(frame_unwind_find_by_frame): Replace frame_unwind_find_by_pc.
	* frame-unwind.c (frame_unwind_free): Free the "sniffer" table.
	(struct frame_unwind_table): Add "sniffer", delete "middle".
	(append_predicate): Add "sniffer" parameter, append the sniffer.
	(frame_unwind_init): Update append_predicate call.
	(frame_unwind_append_sniffer): New function.
	(frame_unwind_append_predicate): Update append_predicate call.
	(frame_unwind_find_by_frame): Replace frame_unwind_find_by_pc.
This commit is contained in:
Andrew Cagney 2003-07-15 17:35:00 +00:00
parent 0714963c79
commit e8a89fe278
6 changed files with 142 additions and 63 deletions

View file

@ -229,8 +229,7 @@ get_frame_id (struct frame_info *fi)
/* Find the unwinder. */
if (fi->unwind == NULL)
{
fi->unwind = frame_unwind_find_by_pc (current_gdbarch,
get_frame_pc (fi));
fi->unwind = frame_unwind_find_by_frame (fi->next);
/* FIXME: cagney/2003-04-02: Rather than storing the frame's
type in the frame, the unwinder's type should be returned
directly. Unfortunatly, legacy code, called by
@ -517,8 +516,7 @@ frame_register_unwind (struct frame_info *frame, int regnum,
/* Find the unwinder. */
if (frame->unwind == NULL)
{
frame->unwind = frame_unwind_find_by_pc (current_gdbarch,
get_frame_pc (frame));
frame->unwind = frame_unwind_find_by_frame (frame->next);
/* FIXME: cagney/2003-04-02: Rather than storing the frame's
type in the frame, the unwinder's type should be returned
directly. Unfortunatly, legacy code, called by
@ -1206,7 +1204,7 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
/* Select/initialize both the unwind function and the frame's type
based on the PC. */
fi->unwind = frame_unwind_find_by_pc (current_gdbarch, pc);
fi->unwind = frame_unwind_find_by_frame (fi->next);
if (fi->unwind->type != UNKNOWN_FRAME)
fi->type = fi->unwind->type;
else
@ -1365,8 +1363,7 @@ legacy_get_prev_frame (struct frame_info *this_frame)
/* Set the unwind functions based on that identified PC. Ditto
for the "type" but strongly prefer the unwinder's frame type. */
prev->unwind = frame_unwind_find_by_pc (current_gdbarch,
get_frame_pc (prev));
prev->unwind = frame_unwind_find_by_frame (prev->next);
if (prev->unwind->type == UNKNOWN_FRAME)
prev->type = frame_type_from_pc (get_frame_pc (prev));
else
@ -1514,8 +1511,7 @@ legacy_get_prev_frame (struct frame_info *this_frame)
to the new frame code. Implement FRAME_CHAIN the way the
new frame will. */
/* Find PREV frame's unwinder. */
prev->unwind = frame_unwind_find_by_pc (current_gdbarch,
frame_pc_unwind (this_frame));
prev->unwind = frame_unwind_find_by_frame (this_frame->next);
/* FIXME: cagney/2003-04-02: Rather than storing the frame's
type in the frame, the unwinder's type should be returned
directly. Unfortunatly, legacy code, called by
@ -1676,8 +1672,7 @@ legacy_get_prev_frame (struct frame_info *this_frame)
If there isn't a FRAME_CHAIN, the code above will have already
done this. */
if (prev->unwind == NULL)
prev->unwind = frame_unwind_find_by_pc (current_gdbarch,
get_frame_pc (prev));
prev->unwind = frame_unwind_find_by_frame (prev->next);
/* If the unwinder provides a frame type, use it. Otherwize
continue on to that heuristic mess. */
@ -2090,7 +2085,7 @@ get_frame_base_address (struct frame_info *fi)
if (get_frame_type (fi) != NORMAL_FRAME)
return 0;
if (fi->base == NULL)
fi->base = frame_base_find_by_pc (current_gdbarch, get_frame_pc (fi));
fi->base = frame_base_find_by_frame (fi->next);
/* Sneaky: If the low-level unwind and high-level base code share a
common unwinder, let them share the prologue cache. */
if (fi->base->unwind == fi->unwind)
@ -2106,7 +2101,7 @@ get_frame_locals_address (struct frame_info *fi)
return 0;
/* If there isn't a frame address method, find it. */
if (fi->base == NULL)
fi->base = frame_base_find_by_pc (current_gdbarch, get_frame_pc (fi));
fi->base = frame_base_find_by_frame (fi->next);
/* Sneaky: If the low-level unwind and high-level base code share a
common unwinder, let them share the prologue cache. */
if (fi->base->unwind == fi->unwind)
@ -2124,7 +2119,7 @@ get_frame_args_address (struct frame_info *fi)
return 0;
/* If there isn't a frame address method, find it. */
if (fi->base == NULL)
fi->base = frame_base_find_by_pc (current_gdbarch, get_frame_pc (fi));
fi->base = frame_base_find_by_frame (fi->next);
/* Sneaky: If the low-level unwind and high-level base code share a
common unwinder, let them share the prologue cache. */
if (fi->base->unwind == fi->unwind)
@ -2163,8 +2158,7 @@ get_frame_type (struct frame_info *frame)
{
/* Initialize the frame's unwinder because it is that which
provides the frame's type. */
frame->unwind = frame_unwind_find_by_pc (current_gdbarch,
get_frame_pc (frame));
frame->unwind = frame_unwind_find_by_frame (frame->next);
/* FIXME: cagney/2003-04-02: Rather than storing the frame's
type in the frame, the unwinder's type should be returned
directly. Unfortunatly, legacy code, called by