1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 22:10:21 +02:00

* stacks.c (read_frame): Bugfix: Removed lingering `else'

statement.
(read_frames): Use SCM_MACROEXPP.
This commit is contained in:
Mikael Djurfeldt 1998-11-10 07:57:51 +00:00
parent e40a5fc8ce
commit 7a13c3ae7b
2 changed files with 37 additions and 8 deletions

View file

@ -1,9 +1,9 @@
1998-11-10 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
* backtrace.c (get_applybody): Help function which lookups the
first body form of the apply closure.
(display_error_body): Prevent the source of the first form of the
apply closure from being printed in error messages.
* stack.c (get_applybody): Help function which lookups the first
body form of the apply closure.
(read_frames): Prevent the source of the first form of the apply
closure from being recorded. This would only be confusing.
* debug.h (SCM_SET_MACROEXP, SCM_CLEAR_MACROEXP, SCM_MACROEXPP):
Replaces SCM_MACROFRAME, SCM_MACROFRAMEP.

View file

@ -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))