summaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-07-15 17:35:00 +0000
committerAndrew Cagney <cagney@redhat.com>2003-07-15 17:35:00 +0000
commit6177ae02a3565617f4b3ca95b4ef36c52f4e994c (patch)
tree54ee0c148200a0139879523f0e62af988ac1600a /gdb/frame.c
parentcb77b194aa678d52713ebe70dbff1593e09e9800 (diff)
downloadgdb-6177ae02a3565617f4b3ca95b4ef36c52f4e994c.tar.gz
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.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 73895e24631..9b95e9caec1 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -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