This is the mail archive of the
mailing list for the GDB project.
[patch/rfc] Make `struct frame_info' opaque ish
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 08 Jan 2003 16:40:55 -0500
- Subject: [patch/rfc] Make `struct frame_info' opaque ish
This one needs some thought,
It `hacks' "frame.h" and "frame.c" so that, except for old old
non-multi-arch targets that use EXTRA_FRAME_INFO, the `struct
frame_info' object is opaque.
The objective is to stop existing code accessing frame info internals -
the next step in the frame overhaul involves changing certain internals
and I'd like to be certain that nothing is assessing the old internal
In the long run, the `struct frame_info' would be moved to "frame.c".
Sooner or later, there will need to be a flag day when this patch is
committed (I'd prefer sooner so it is well before the 5.4 branch).
In the mean time, I get to try this patch out on various platforms and
fix any breakage. I encourage others to do the same on their platform.
2003-01-08 Andrew Cagney <firstname.lastname@example.org>
* frame.h (struct frame_info): Only declare when either FRAME_C or
EXTRA_FRAME_INFO is defined.
* frame.c (FRAME_C): Define.
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.55
diff -u -r1.55 frame.c
--- frame.c 7 Jan 2003 22:53:09 -0000 1.55
+++ frame.c 8 Jan 2003 20:34:33 -0000
@@ -20,6 +20,12 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* FIXME: 2003-01-08: "frame.h" uses this macro as a trigger to
+ declare `struct frame_info'. Once all architectures are
+ multi-arched, that declaration can be moved to this file, and this
+ macro define deleted. */
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.58
diff -u -r1.58 frame.h
--- frame.h 7 Jan 2003 22:53:09 -0000 1.58
+++ frame.h 8 Jan 2003 20:34:33 -0000
@@ -356,6 +356,10 @@
+/* FIXME: cagney/2003-01-08: Once all architectures are multi-arched,
+ this conditional declaration can be moved to "frame.c". */
+#if defined (FRAME_C) || defined (EXTRA_FRAME_INFO)
/* We keep a cache of stack frames, each of which is a "struct
frame_info". The innermost one gets allocated (in
wait_for_inferior) each time the inferior stops; current_frame
@@ -446,6 +450,7 @@
struct frame_info *prev; /* up, outer, older */
/* Values for the source flag to be used in print_frame_info_base(). */