forked from M-Labs/artiq
1
0
Fork 0
This commit is contained in:
whitequark 2017-02-02 01:08:20 +00:00
parent c2cf60e7f6
commit 0df8a24135
1 changed files with 3 additions and 4 deletions

View File

@ -8,16 +8,15 @@
#include <dlfcn.h> #include <dlfcn.h>
void __artiq_terminate(struct artiq_exception *exn, void __artiq_terminate(struct artiq_exception *exn,
uintptr_t *backtrace, struct slice backtrace) {
size_t backtrace_size) {
printf("Uncaught %s: %s (%"PRIi64", %"PRIi64", %"PRIi64")\n" printf("Uncaught %s: %s (%"PRIi64", %"PRIi64", %"PRIi64")\n"
"at %s:%"PRIi32":%"PRIi32"\n", "at %s:%"PRIi32":%"PRIi32"\n",
exn->name, exn->message, exn->name, exn->message,
exn->param[0], exn->param[1], exn->param[1], exn->param[0], exn->param[1], exn->param[1],
exn->file, exn->line, exn->column + 1); exn->file, exn->line, exn->column + 1);
for(size_t i = 0; i < backtrace_size; i++) { for(size_t i = 0; i < backtrace.len; i++) {
printf("at %"PRIxPTR"\n", backtrace[i]); printf("at %"PRIxPTR"\n", ((uintptr_t*)backtrace.ptr)[i]);
} }
exit(1); exit(1);