aboutsummaryrefslogtreecommitdiff
path: root/gdb/dummy-frame.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2014-05-14 14:01:24 -0600
committerJan Kratochvil <jan.kratochvil@redhat.com>2014-12-12 22:25:15 +0100
commit233a8fb382c88d7faa6da1cd93a7e21b77e36df4 (patch)
treea4a8a2bba3dafe8a4a964b7c342465dc1b69fb6a /gdb/dummy-frame.h
parentf1660027106d583c639c9f37096519944d5c20e9 (diff)
downloadgdb-233a8fb382c88d7faa6da1cd93a7e21b77e36df4.zip
gdb-233a8fb382c88d7faa6da1cd93a7e21b77e36df4.tar.gz
gdb-233a8fb382c88d7faa6da1cd93a7e21b77e36df4.tar.bz2
add dummy frame destructor
The compiler code needed a hook into dummy frame destruction, so that some state could be kept while the inferior call is made and then destroyed when the inferior call finishes. This patch adds an optional destructor to dummy frames and a new API to access it. gdb/ChangeLog 2014-12-12 Jan Kratochvil <jan.kratochvil@redhat.com> * dummy-frame.c (struct dummy_frame) <dtor, dtor_data>: New fields. (pop_dummy_frame): Call the destructor if it exists. (register_dummy_frame_dtor, find_dummy_frame_dtor): New functions. * dummy-frame.h (dummy_frame_dtor_ftype): New typedef. (register_dummy_frame_dtor, find_dummy_frame_dtor): Declare.
Diffstat (limited to 'gdb/dummy-frame.h')
-rw-r--r--gdb/dummy-frame.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
index bac1aac..8c1a1d0 100644
--- a/gdb/dummy-frame.h
+++ b/gdb/dummy-frame.h
@@ -54,4 +54,17 @@ extern void dummy_frame_discard (struct frame_id dummy_id, ptid_t ptid);
extern const struct frame_unwind dummy_frame_unwind;
+/* Call DTOR with DTOR_DATA when DUMMY_ID frame of thread PTID gets discarded.
+ Dummy frame with DUMMY_ID must exist. There must be no other call of
+ register_dummy_frame_dtor for that dummy frame. */
+typedef void (dummy_frame_dtor_ftype) (void *data);
+extern void register_dummy_frame_dtor (struct frame_id dummy_id, ptid_t ptid,
+ dummy_frame_dtor_ftype *dtor,
+ void *dtor_data);
+
+/* Return 1 if there exists dummy frame with registered DTOR and DTOR_DATA.
+ Return 0 otherwise. */
+extern int find_dummy_frame_dtor (dummy_frame_dtor_ftype *dtor,
+ void *dtor_data);
+
#endif /* !defined (DUMMY_FRAME_H) */