implemented simple backtrace

This commit is contained in:
Yuichi Nishiwaki
2014-03-29 20:02:11 +09:00
parent 8b68e98709
commit 38c4e7e6de
4 changed files with 61 additions and 2 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
#include "picrin.h"
#include "picrin/pair.h"
#include "picrin/string.h"
#include "picrin/error.h"
#if PIC_ENABLE_READLINE
@@ -124,7 +125,7 @@ repl(pic_state *pic)
}
}
pic_catch {
printf("error: %s\n", pic_errmsg(pic));
printf("%s\n", pic_str_cstr(pic_get_backtrace(pic)));
pic->err = NULL;
code[0] = '\0';
}