summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-07 22:53:09 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-07 22:53:09 +0000
commitdeded1412f30a4feb63b27c40d4c4c7770d68bca (patch)
treeeca184f1b4aa2d0610d7a3ad4747b3a1cbe395a2
parentb8790c9db4c455158a200fa816e0acfd9c8b2579 (diff)
downloadgdb-deded1412f30a4feb63b27c40d4c4c7770d68bca.tar.gz
2003-01-07 Andrew Cagney <cagney@redhat.com>
* frame.c (deprecated_get_frame_context): New function. (deprecated_set_frame_context): New function. * frame.h (deprecated_get_frame_context): Declare. (deprecated_set_frame_context): Declare. * dwarf2cfi.c (UNWIND_CONTEXT): Use deprecated_get_frame_context. (cfi_init_extra_frame_info): Use deprecated_set_frame_context.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/dwarf2cfi.c4
-rw-r--r--gdb/frame.c13
-rw-r--r--gdb/frame.h12
4 files changed, 36 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 611d249b2d1..3b4b3606b0a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2003-01-07 Andrew Cagney <cagney@redhat.com>
+ * frame.c (deprecated_get_frame_context): New function.
+ (deprecated_set_frame_context): New function.
+ * frame.h (deprecated_get_frame_context): Declare.
+ (deprecated_set_frame_context): Declare.
+ * dwarf2cfi.c (UNWIND_CONTEXT): Use deprecated_get_frame_context.
+ (cfi_init_extra_frame_info): Use deprecated_set_frame_context.
+
+2003-01-07 Andrew Cagney <cagney@redhat.com>
+
* frame.c (deprecated_set_frame_next_hack): New function.
(deprecated_set_frame_prev_hack): New function.
* frame.h (deprecated_set_frame_next_hack): Declare.
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c
index 22b99830c34..a2ce1a50035 100644
--- a/gdb/dwarf2cfi.c
+++ b/gdb/dwarf2cfi.c
@@ -156,7 +156,7 @@ enum ptr_encoding
PE_funcrel = DW_EH_PE_funcrel
};
-#define UNWIND_CONTEXT(fi) ((struct context *) (fi->context))
+#define UNWIND_CONTEXT(fi) ((struct context *) (deprecated_get_frame_context (fi)))
static struct cie_unit *cie_chunks;
@@ -1770,7 +1770,7 @@ cfi_init_extra_frame_info (int fromleaf, struct frame_info *fi)
unwind_tmp_obstack_init ();
fs = frame_state_alloc ();
- fi->context = frame_obstack_alloc (sizeof (struct context));
+ deprecated_set_frame_context (fi, frame_obstack_alloc (sizeof (struct context)));
UNWIND_CONTEXT (fi)->reg =
frame_obstack_alloc (sizeof (struct context_reg) * NUM_REGS);
memset (UNWIND_CONTEXT (fi)->reg, 0,
diff --git a/gdb/frame.c b/gdb/frame.c
index f09a47b4268..ec2aab1b3fb 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1322,6 +1322,19 @@ deprecated_set_frame_prev_hack (struct frame_info *fi,
fi->prev = prev;
}
+struct context *
+deprecated_get_frame_context (struct frame_info *fi)
+{
+ return fi->context;
+}
+
+void
+deprecated_set_frame_context (struct frame_info *fi,
+ struct context *context)
+{
+ fi->context = context;
+}
+
struct frame_info *
deprecated_frame_xmalloc (void)
{
diff --git a/gdb/frame.h b/gdb/frame.h
index 2f50eebd878..f32021cf0fa 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -701,4 +701,16 @@ extern void deprecated_set_frame_next_hack (struct frame_info *fi,
extern void deprecated_set_frame_prev_hack (struct frame_info *fi,
struct frame_info *prev);
+/* FIXME: cagney/2003-01-07: Instead of the dwarf2cfi having its own
+ dedicated `struct frame_info . context' field, the code should use
+ the per frame `unwind_cache' that is passed to the
+ frame_pc_unwind(), frame_register_unwind() and frame_id_unwind()
+ methods.
+
+ See "dummy-frame.c" for an example of how a cfi-frame object can be
+ implemented using this. */
+extern struct context *deprecated_get_frame_context (struct frame_info *fi);
+extern void deprecated_set_frame_context (struct frame_info *fi,
+ struct context *context);
+
#endif /* !defined (FRAME_H) */