1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-25 01:37:19 +00:00

Remove annoying (fiber) text from stacktrace.

This commit is contained in:
Calvin Rose 2019-01-14 12:08:13 -05:00
parent 192705113e
commit e53778d5d8
2 changed files with 2 additions and 4 deletions

View File

@ -1475,7 +1475,6 @@ value, one key will be ignored."
(when f (when f
(loop (loop
[nf :in (reverse (debug/lineage f)) [nf :in (reverse (debug/lineage f))
:before (file/write stderr " (fiber)\n")
{:function func {:function func
:tail tail :tail tail
:pc pc :pc pc
@ -1484,7 +1483,7 @@ value, one key will be ignored."
:source source :source source
:source-start start :source-start start
:source-end end} :in (debug/stack nf)] :source-end end} :in (debug/stack nf)]
(file/write stderr " in") (file/write stderr " in")
(when c (file/write stderr " cfunction")) (when c (file/write stderr " cfunction"))
(if name (if name
(file/write stderr " " name) (file/write stderr " " name)

View File

@ -39,12 +39,11 @@ void janet_stacktrace(JanetFiber *fiber, const char *errtype, Janet err) {
for (fi = janet_v_count(fibers) - 1; fi >= 0; fi--) { for (fi = janet_v_count(fibers) - 1; fi >= 0; fi--) {
fiber = fibers[fi]; fiber = fibers[fi];
int32_t i = fiber->frame; int32_t i = fiber->frame;
if (i > 0) fprintf(stderr, " (fiber)\n");
while (i > 0) { while (i > 0) {
JanetStackFrame *frame = (JanetStackFrame *)(fiber->data + i - JANET_FRAME_SIZE); JanetStackFrame *frame = (JanetStackFrame *)(fiber->data + i - JANET_FRAME_SIZE);
JanetFuncDef *def = NULL; JanetFuncDef *def = NULL;
i = frame->prevframe; i = frame->prevframe;
fprintf(stderr, " in"); fprintf(stderr, " in");
if (frame->func) { if (frame->func) {
def = frame->func->def; def = frame->func->def;
fprintf(stderr, " %s", def->name ? (const char *)def->name : "<anonymous>"); fprintf(stderr, " %s", def->name ? (const char *)def->name : "<anonymous>");