mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +02:00
scm_debug_opts to debug.c, backtrace on by default, scm_*_opts internal linkage
* libguile/eval.c: * libguile/debug.c (scm_debug_opts): Move here, from eval.c. Change SCM_BACKTRACE_P to 1, initially. * libguile/private-options.h: Make all options vars private.
This commit is contained in:
parent
1f603ae283
commit
ab9c9100d2
3 changed files with 36 additions and 32 deletions
|
@ -59,6 +59,39 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Debugging options.
|
||||||
|
*/
|
||||||
|
|
||||||
|
scm_t_option scm_debug_opts[] = {
|
||||||
|
{ SCM_OPTION_BOOLEAN, "backwards", 0,
|
||||||
|
"Display backtrace in anti-chronological order." },
|
||||||
|
{ SCM_OPTION_INTEGER, "width", 79, "Maximal width of backtrace." },
|
||||||
|
{ SCM_OPTION_INTEGER, "depth", 20, "Maximal length of printed backtrace." },
|
||||||
|
{ SCM_OPTION_BOOLEAN, "backtrace", 1, "Show backtrace on error." },
|
||||||
|
/* This default stack limit will be overridden by init_stack_limit(),
|
||||||
|
if we have getrlimit() and the stack limit is not INFINITY. But it is still
|
||||||
|
important, as some systems have both the soft and the hard limits set to
|
||||||
|
INFINITY; in that case we fall back to this value.
|
||||||
|
|
||||||
|
The situation is aggravated by certain compilers, which can consume
|
||||||
|
"beaucoup de stack", as they say in France.
|
||||||
|
|
||||||
|
See http://thread.gmane.org/gmane.lisp.guile.devel/8599/focus=8662 for
|
||||||
|
more discussion. This setting is 640 KB on 32-bit arches (should be enough
|
||||||
|
for anyone!) or a whoppin' 1280 KB on 64-bit arches.
|
||||||
|
*/
|
||||||
|
{ SCM_OPTION_INTEGER, "stack", 160000, "Stack size limit (measured in words; 0 = no check)." },
|
||||||
|
{ SCM_OPTION_SCM, "show-file-name", (unsigned long)SCM_BOOL_T,
|
||||||
|
"Show file names and line numbers "
|
||||||
|
"in backtraces when not `#f'. A value of `base' "
|
||||||
|
"displays only base names, while `#t' displays full names."},
|
||||||
|
{ SCM_OPTION_BOOLEAN, "warn-deprecated", 0,
|
||||||
|
"Warn when deprecated features are used." },
|
||||||
|
{ 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* {Run time control of the debugging evaluator}
|
/* {Run time control of the debugging evaluator}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -435,35 +435,6 @@ eval (SCM x, SCM env)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_t_option scm_debug_opts[] = {
|
|
||||||
{ SCM_OPTION_BOOLEAN, "backwards", 0,
|
|
||||||
"Display backtrace in anti-chronological order." },
|
|
||||||
{ SCM_OPTION_INTEGER, "width", 79, "Maximal width of backtrace." },
|
|
||||||
{ SCM_OPTION_INTEGER, "depth", 20, "Maximal length of printed backtrace." },
|
|
||||||
{ SCM_OPTION_BOOLEAN, "backtrace", 0, "Show backtrace on error." },
|
|
||||||
/* This default stack limit will be overridden by debug.c:init_stack_limit(),
|
|
||||||
if we have getrlimit() and the stack limit is not INFINITY. But it is still
|
|
||||||
important, as some systems have both the soft and the hard limits set to
|
|
||||||
INFINITY; in that case we fall back to this value.
|
|
||||||
|
|
||||||
The situation is aggravated by certain compilers, which can consume
|
|
||||||
"beaucoup de stack", as they say in France.
|
|
||||||
|
|
||||||
See http://thread.gmane.org/gmane.lisp.guile.devel/8599/focus=8662 for
|
|
||||||
more discussion. This setting is 640 KB on 32-bit arches (should be enough
|
|
||||||
for anyone!) or a whoppin' 1280 KB on 64-bit arches.
|
|
||||||
*/
|
|
||||||
{ SCM_OPTION_INTEGER, "stack", 160000, "Stack size limit (measured in words; 0 = no check)." },
|
|
||||||
{ SCM_OPTION_SCM, "show-file-name", (unsigned long)SCM_BOOL_T,
|
|
||||||
"Show file names and line numbers "
|
|
||||||
"in backtraces when not `#f'. A value of `base' "
|
|
||||||
"displays only base names, while `#t' displays full names."},
|
|
||||||
{ SCM_OPTION_BOOLEAN, "warn-deprecated", 0,
|
|
||||||
"Warn when deprecated features are used." },
|
|
||||||
{ 0 },
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Simple procedure calls
|
/* Simple procedure calls
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
/*
|
/*
|
||||||
debugging.
|
debugging.
|
||||||
*/
|
*/
|
||||||
SCM_API scm_t_option scm_debug_opts[];
|
SCM_INTERNAL scm_t_option scm_debug_opts[];
|
||||||
|
|
||||||
#define SCM_BACKWARDS_P scm_debug_opts[0].val
|
#define SCM_BACKWARDS_P scm_debug_opts[0].val
|
||||||
#define SCM_BACKTRACE_WIDTH scm_debug_opts[1].val
|
#define SCM_BACKTRACE_WIDTH scm_debug_opts[1].val
|
||||||
|
@ -43,7 +43,7 @@ SCM_API scm_t_option scm_debug_opts[];
|
||||||
/*
|
/*
|
||||||
printing
|
printing
|
||||||
*/
|
*/
|
||||||
SCM_API scm_t_option scm_print_opts[];
|
SCM_INTERNAL scm_t_option scm_print_opts[];
|
||||||
|
|
||||||
#define SCM_PRINT_HIGHLIGHT_PREFIX (SCM_PACK (scm_print_opts[0].val))
|
#define SCM_PRINT_HIGHLIGHT_PREFIX (SCM_PACK (scm_print_opts[0].val))
|
||||||
#define SCM_PRINT_HIGHLIGHT_SUFFIX (SCM_PACK (scm_print_opts[1].val))
|
#define SCM_PRINT_HIGHLIGHT_SUFFIX (SCM_PACK (scm_print_opts[1].val))
|
||||||
|
@ -55,7 +55,7 @@ SCM_API scm_t_option scm_print_opts[];
|
||||||
/*
|
/*
|
||||||
read
|
read
|
||||||
*/
|
*/
|
||||||
SCM_API scm_t_option scm_read_opts[];
|
SCM_INTERNAL scm_t_option scm_read_opts[];
|
||||||
|
|
||||||
#define SCM_COPY_SOURCE_P scm_read_opts[0].val
|
#define SCM_COPY_SOURCE_P scm_read_opts[0].val
|
||||||
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
|
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue