mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: support '-d no_backtrace' directly in panic(), to ease creating .so files with tcc
This commit is contained in:
parent
bfa8e4bf86
commit
0da1d757cb
@ -54,7 +54,10 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
|
|||||||
eprintln('=========================================')
|
eprintln('=========================================')
|
||||||
$if exit_after_panic_message ? {
|
$if exit_after_panic_message ? {
|
||||||
C.exit(1)
|
C.exit(1)
|
||||||
}
|
} $else {
|
||||||
|
$if no_backtrace ? {
|
||||||
|
C.exit(1)
|
||||||
|
} $else {
|
||||||
$if tinyc {
|
$if tinyc {
|
||||||
$if panics_break_into_debugger ? {
|
$if panics_break_into_debugger ? {
|
||||||
break_if_debugger_attached()
|
break_if_debugger_attached()
|
||||||
@ -68,6 +71,8 @@ fn panic_debug(line_no int, file string, mod string, fn_name string, s string) {
|
|||||||
break_if_debugger_attached()
|
break_if_debugger_attached()
|
||||||
}
|
}
|
||||||
C.exit(1)
|
C.exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// panic prints a nice error message, then exits the process with exit code of 1.
|
// panic prints a nice error message, then exits the process with exit code of 1.
|
||||||
@ -76,7 +81,10 @@ pub fn panic(s string) {
|
|||||||
eprintln('V panic: $s')
|
eprintln('V panic: $s')
|
||||||
$if exit_after_panic_message ? {
|
$if exit_after_panic_message ? {
|
||||||
C.exit(1)
|
C.exit(1)
|
||||||
}
|
} $else {
|
||||||
|
$if no_backtrace ? {
|
||||||
|
C.exit(1)
|
||||||
|
} $else {
|
||||||
$if tinyc {
|
$if tinyc {
|
||||||
$if panics_break_into_debugger ? {
|
$if panics_break_into_debugger ? {
|
||||||
break_if_debugger_attached()
|
break_if_debugger_attached()
|
||||||
@ -90,6 +98,8 @@ pub fn panic(s string) {
|
|||||||
break_if_debugger_attached()
|
break_if_debugger_attached()
|
||||||
}
|
}
|
||||||
C.exit(1)
|
C.exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eprintln prints a message with a line end, to stderr. Both stderr and stdout are flushed.
|
// eprintln prints a message with a line end, to stderr. Both stderr and stdout are flushed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user