summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-09-23 13:19:49 +0200
committerAndy Wingo <wingo@pobox.com>2010-09-23 13:19:49 +0200
commit2e30f3989caab60f11fd3b0e773c15499b231fd8 (patch)
treee28f91b10f9e04133b70e799d3bdff2aef00d595
parent1bc1800ffa194d9338295199e3a7ccd5e7b45d90 (diff)
downloadguile-2e30f3989caab60f11fd3b0e773c15499b231fd8.tar.gz
add scm_frame_address / frame-address
* libguile/frames.h: * libguile/frames.c (scm_frame_address): New accessor, returns a frame's fp.
-rw-r--r--libguile/frames.c10
-rw-r--r--libguile/frames.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index f8eed861a..2064ef3c1 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -203,6 +203,16 @@ SCM_DEFINE (scm_frame_local_set_x, "frame-local-set!", 3, 0, 0,
}
#undef FUNC_NAME
+SCM_DEFINE (scm_frame_address, "frame-address", 1, 0, 0,
+ (SCM frame),
+ "Return the frame pointer for @var{frame}.")
+#define FUNC_NAME s_scm_frame_address
+{
+ SCM_VALIDATE_VM_FRAME (1, frame);
+ return scm_from_ulong ((unsigned long) SCM_VM_FRAME_FP (frame));
+}
+#undef FUNC_NAME
+
SCM_DEFINE (scm_frame_instruction_pointer, "frame-instruction-pointer", 1, 0, 0,
(SCM frame),
"")
diff --git a/libguile/frames.h b/libguile/frames.h
index 33432eb48..89d0f33bf 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -114,6 +114,7 @@ SCM_API SCM scm_frame_source (SCM frame);
SCM_API SCM scm_frame_num_locals (SCM frame);
SCM_API SCM scm_frame_local_ref (SCM frame, SCM index);
SCM_API SCM scm_frame_local_set_x (SCM frame, SCM index, SCM val);
+SCM_API SCM scm_frame_address (SCM frame);
SCM_API SCM scm_frame_instruction_pointer (SCM frame);
SCM_API SCM scm_frame_return_address (SCM frame);
SCM_API SCM scm_frame_mv_return_address (SCM frame);