This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfc] Add a sentinel frame
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Michal Ludvig <mludvig at suse dot cz>
- Cc: GDB Patches <gdb-patches at sources dot redhat dot com>
- Date: Wed, 05 Mar 2003 13:25:04 -0500
- Subject: Re: [patch/rfc] Add a sentinel frame
- References: <3E305670.3020700@redhat.com> <3E48378E.6090007@suse.cz> <3E492953.8010001@redhat.com> <3E52173B.1030800@suse.cz> <3E538770.6070209@redhat.com> <3E5B98D8.3030002@suse.cz> <3E5BAB7D.8090801@redhat.com> <3E5BD957.9010605@suse.cz> <3E5BDCBD.2030205@redhat.com> <3E5C7512.2080207@suse.cz> <3E5E58FC.3080704@redhat.com> <3E5F5DEE.3030505@suse.cz> <3E5F8559.1020708@redhat.com> <3E663605.6030105@suse.cz>
+struct frame_id
+generic_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *frame)
+{
+ static struct frame_id id;
+
+ id.base = dummy_frame_stack->top;
+ id.pc = frame->pc;
+
+ return id;
+}
+
No. That would make unwind dummy id's implementation circular. The
ID's value is needed to find the correct dummy frame in the
dummy_frame_stack.
This method needs to unwind register value's from the NEXT_FRAME and
then use that to determine the dummy frame's ID. The d10v's
implementation (not yet committed) looks like:
/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that
dummy frame. The frame ID's base needs to match the TOS value
saved by save_dummy_frame_tos(), and the PC match the dummy frame's
breakpoint. */
static struct frame_id
d10v_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info
*next_frame)
{
ULONGEST base;
struct frame_id id;
id.pc = frame_pc_unwind (next_frame);
frame_unwind_unsigned_register (next_frame, SP_REGNUM, &base);
id.base = d10v_make_daddr (base);
return id;
}
Andrew