This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Add legacy_frame_p()
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 13 Mar 2003 13:11:05 -0500
- Subject: [commit] Add legacy_frame_p()
FYI,
Committed the attached. Provides a generic way of determining if the
frame code is `running in compatibility mode'.
Andrew
2003-03-13 Andrew Cagney <cagney at redhat dot com>
* frame.c (legacy_frame_p): New function.
(get_prev_frame): Use legacy_frame_p.
* frame.h (legacy_frame_p): Declare.
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.80
diff -u -r1.80 frame.c
--- frame.c 12 Mar 2003 23:55:36 -0000 1.80
+++ frame.c 13 Mar 2003 18:08:37 -0000
@@ -1327,10 +1327,7 @@
the legacy get_prev_frame method. Just don't try to unwind a
sentinel frame using that method - it doesn't work. All sentinal
frames use the new unwind code. */
- if ((DEPRECATED_INIT_FRAME_PC_P ()
- || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
- || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
- || FRAME_CHAIN_P ())
+ if (legacy_frame_p (current_gdbarch)
&& this_frame->level >= 0)
{
prev_frame = legacy_get_prev_frame (this_frame);
@@ -1694,6 +1691,15 @@
make_cleanup (xfree, frame->extra_info);
}
return frame;
+}
+
+int
+legacy_frame_p (struct gdbarch *current_gdbarch)
+{
+ return (DEPRECATED_INIT_FRAME_PC_P ()
+ || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
+ || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
+ || FRAME_CHAIN_P ());
}
void
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.71
diff -u -r1.71 frame.h
--- frame.h 5 Mar 2003 18:51:17 -0000 1.71
+++ frame.h 13 Mar 2003 18:08:38 -0000
@@ -701,4 +701,8 @@
extern void deprecated_set_frame_context (struct frame_info *fi,
struct context *context);
+/* Return non-zero if the architecture is relying on legacy frame
+ code. */
+extern int legacy_frame_p (struct gdbarch *gdbarch);
+
#endif /* !defined (FRAME_H) */