From 498c8cfc8e91d821e4a93e45023fe7bb521021c4 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 11 Jul 2020 17:51:02 +0300 Subject: [PATCH] builtin: skip print_backtraces on panics with tcc, it does it automatically --- vlib/builtin/builtin.v | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vlib/builtin/builtin.v b/vlib/builtin/builtin.v index 324dae4326..81d24ac612 100644 --- a/vlib/builtin/builtin.v +++ b/vlib/builtin/builtin.v @@ -43,14 +43,20 @@ fn panic_debug(line_no int, file, mod, fn_name, s string) { eprintln(' file: $file') eprintln(' line: ' + line_no.str()) eprintln('=========================================') - print_backtrace_skipping_top_frames(1) + // recent versions of tcc print better backtraces automatically + $if !tinyc { + print_backtrace_skipping_top_frames(1) + } break_if_debugger_attached() C.exit(1) } pub fn panic(s string) { eprintln('V panic: $s') - print_backtrace() + // recent versions of tcc print better backtraces automatically + $if !tinyc { + print_backtrace() + } break_if_debugger_attached() C.exit(1) }