mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 05:06:37 +02:00
adding stack traces for scripts
This commit is contained in:
parent
34710bf44d
commit
3bfc6a2d8e
2 changed files with 2 additions and 1 deletions
2
eval.c
2
eval.c
|
@ -33,7 +33,7 @@ void sexp_stack_trace (sexp ctx, sexp out) {
|
|||
sexp_write(ctx, sexp_bytecode_name(bc), out);
|
||||
else
|
||||
sexp_printf(ctx, out, "anon: %p", bc);
|
||||
if ((ls=sexp_bytecode_source(bc))) {
|
||||
if ((ls=sexp_bytecode_source(bc)) && sexp_pairp(ls)) {
|
||||
if (sexp_fixnump(sexp_cdr(ls)) && (sexp_cdr(ls) >= SEXP_ZERO)) {
|
||||
sexp_write_string(ctx, " on line ", out);
|
||||
sexp_write(ctx, sexp_cdr(ls), out);
|
||||
|
|
1
main.c
1
main.c
|
@ -74,6 +74,7 @@ static sexp check_exception (sexp ctx, sexp res) {
|
|||
if (! sexp_oportp(err))
|
||||
err = sexp_make_output_port(ctx, stderr, SEXP_FALSE);
|
||||
sexp_print_exception(ctx, res, err);
|
||||
sexp_stack_trace(ctx, err);
|
||||
exit_failure();
|
||||
}
|
||||
return res;
|
||||
|
|
Loading…
Add table
Reference in a new issue