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

v panic debug information

This commit is contained in:
joe-conigliaro
2019-07-30 23:08:14 +10:00
committed by Alexander Medvednikov
parent 07ed320110
commit 5e57d099d7
2 changed files with 23 additions and 0 deletions

View File

@@ -26,6 +26,19 @@ pub fn print_backtrace() {
}
}
// replaces panic when -debug arg is passed
fn _panic_debug(line_no int, file, mod, fn_name, s string) {
println('================ V panic ================')
println(' module: $mod')
println(' function: ${fn_name}()')
println(' file: $file')
println(' line: ' + line_no.str())
println(' message: $s')
println('=========================================')
print_backtrace()
C.exit(1)
}
pub fn panic(s string) {
println('V panic: $s')
print_backtrace()