1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: skip print_backtraces on panics with tcc, it does it automatically

This commit is contained in:
Delyan Angelov 2020-07-11 17:51:02 +03:00
parent 9b4c81e85f
commit 498c8cfc8e

View File

@ -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)
}