mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +02:00
* stacks.c (read_frame): Bugfix: Removed lingering `else'
statement. (read_frames): Use SCM_MACROEXPP.
This commit is contained in:
parent
e40a5fc8ce
commit
7a13c3ae7b
2 changed files with 37 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
||||||
1998-11-10 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
|
1998-11-10 Mikael Djurfeldt <mdj@mdj.nada.kth.se>
|
||||||
|
|
||||||
* backtrace.c (get_applybody): Help function which lookups the
|
* stack.c (get_applybody): Help function which lookups the first
|
||||||
first body form of the apply closure.
|
body form of the apply closure.
|
||||||
(display_error_body): Prevent the source of the first form of the
|
(read_frames): Prevent the source of the first form of the apply
|
||||||
apply closure from being printed in error messages.
|
closure from being recorded. This would only be confusing.
|
||||||
|
|
||||||
* debug.h (SCM_SET_MACROEXP, SCM_CLEAR_MACROEXP, SCM_MACROEXPP):
|
* debug.h (SCM_SET_MACROEXP, SCM_CLEAR_MACROEXP, SCM_MACROEXPP):
|
||||||
Replaces SCM_MACROFRAME, SCM_MACROFRAMEP.
|
Replaces SCM_MACROFRAME, SCM_MACROFRAMEP.
|
||||||
|
|
|
@ -220,19 +220,44 @@ read_frame (dframe, offset, iframe)
|
||||||
iframe->flags = flags;
|
iframe->flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill the scm_info_frame vector IFRAME with data from N stack frames
|
SCM_SYMBOL (scm_sym_apply, "apply");
|
||||||
* starting with the first stack frame represented by debug frame
|
|
||||||
* DFRAME.
|
/* 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) \
|
#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; \
|
++iframe; \
|
||||||
if (--n == 0) \
|
if (--n == 0) \
|
||||||
goto quit; \
|
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 SCM_P ((scm_debug_frame *dframe, long offset, int nframes, scm_info_frame *iframes));
|
||||||
static int
|
static int
|
||||||
read_frames (dframe, offset, n, iframes)
|
read_frames (dframe, offset, n, iframes)
|
||||||
|
@ -244,7 +269,11 @@ read_frames (dframe, offset, n, iframes)
|
||||||
int size;
|
int size;
|
||||||
scm_info_frame *iframe = iframes;
|
scm_info_frame *iframe = iframes;
|
||||||
scm_debug_info *info;
|
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 (;
|
for (;
|
||||||
dframe && !SCM_VOIDFRAMEP (*dframe) && n > 0;
|
dframe && !SCM_VOIDFRAMEP (*dframe) && n > 0;
|
||||||
dframe = RELOC_FRAME (dframe->prev, offset))
|
dframe = RELOC_FRAME (dframe->prev, offset))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue