summaryrefslogtreecommitdiff
path: root/libguile
diff options
context:
space:
mode:
Diffstat (limited to 'libguile')
-rw-r--r--libguile/frames.c11
-rw-r--r--libguile/frames.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/libguile/frames.c b/libguile/frames.c
index 2064ef3c1..67ddd1a17 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -213,6 +213,17 @@ SCM_DEFINE (scm_frame_address, "frame-address", 1, 0, 0,
}
#undef FUNC_NAME
+SCM_DEFINE (scm_frame_stack_pointer, "frame-stack-pointer", 1, 0, 0,
+ (SCM frame),
+ "")
+#define FUNC_NAME s_scm_frame_stack_pointer
+{
+ SCM_VALIDATE_VM_FRAME (1, frame);
+
+ return scm_from_ulong ((unsigned long) SCM_VM_FRAME_SP (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 89d0f33bf..3d8a4b27a 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -115,6 +115,7 @@ 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_stack_pointer (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);