summaryrefslogtreecommitdiff
path: root/libguile/stacks.c
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1998-11-10 07:57:51 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1998-11-10 07:57:51 +0000
commit7a13c3ae7b3115750d418dbf1c39187cc22151a2 (patch)
treeec2b6d1c489620e7070d3481528ed617a2fb74c3 /libguile/stacks.c
parente40a5fc8ce72fbbe4149860df7d2aca9c3a1dfa4 (diff)
downloadguile-7a13c3ae7b3115750d418dbf1c39187cc22151a2.tar.gz
* stacks.c (read_frame): Bugfix: Removed lingering `else'
statement. (read_frames): Use SCM_MACROEXPP.
Diffstat (limited to 'libguile/stacks.c')
-rw-r--r--libguile/stacks.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/libguile/stacks.c b/libguile/stacks.c
index 31d0da4bb..6deb9b7a7 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -220,19 +220,44 @@ read_frame (dframe, offset, iframe)
iframe->flags = flags;
}
-/* Fill the scm_info_frame vector IFRAME with data from N stack frames
- * starting with the first stack frame represented by debug frame
- * DFRAME.
- */
+SCM_SYMBOL (scm_sym_apply, "apply");
+
+/* Look up the first body form of the apply closure. We'll use this
+ below to prevent it from being displayed.
+*/
+static SCM
+get_applybody ()
+{
+ SCM proc = SCM_CDR (scm_sym2vcell (scm_sym_apply, SCM_BOOL_F, SCM_BOOL_F));
+ if (SCM_NIMP (proc) && SCM_CLOSUREP (proc))
+ return SCM_CADR (SCM_CODE (proc));
+ else
+ return SCM_UNDEFINED;
+}
#define NEXT_FRAME(iframe, n, quit) \
{ \
+ if (SCM_NIMP (iframe->source) \
+ && SCM_MEMOIZED_EXP (iframe->source) == applybody) \
+ { \
+ iframe->source = SCM_BOOL_F; \
+ if (SCM_FALSEP (iframe->proc)) \
+ { \
+ --iframe; \
+ ++n; \
+ } \
+ } \
++iframe; \
if (--n == 0) \
goto quit; \
} \
+/* Fill the scm_info_frame vector IFRAME with data from N stack frames
+ * starting with the first stack frame represented by debug frame
+ * DFRAME.
+ */
+
static int read_frames SCM_P ((scm_debug_frame *dframe, long offset, int nframes, scm_info_frame *iframes));
static int
read_frames (dframe, offset, n, iframes)
@@ -244,7 +269,11 @@ read_frames (dframe, offset, n, iframes)
int size;
scm_info_frame *iframe = iframes;
scm_debug_info *info;
+ static SCM applybody = SCM_UNDEFINED;
+ /* The value of applybody has to be setup after r4rs.scm has executed. */
+ if (SCM_UNBNDP (applybody))
+ applybody = get_applybody ();
for (;
dframe && !SCM_VOIDFRAMEP (*dframe) && n > 0;
dframe = RELOC_FRAME (dframe->prev, offset))