builtin: support -d no_backtrace, to ease compiling V code on older distros easier
parent
f807fd973e
commit
48b117618d
|
@ -87,6 +87,9 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
|
||||||
C.tcc_backtrace("Backtrace")
|
C.tcc_backtrace("Backtrace")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
$if no_backtrace ? {
|
||||||
|
return false
|
||||||
|
} $else {
|
||||||
buffer := [100]byteptr{}
|
buffer := [100]byteptr{}
|
||||||
nr_ptrs := C.backtrace(voidptr(buffer), 100)
|
nr_ptrs := C.backtrace(voidptr(buffer), 100)
|
||||||
if nr_ptrs < 2 {
|
if nr_ptrs < 2 {
|
||||||
|
@ -130,6 +133,7 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
|
||||||
output = output.replace(' (discriminator', ': (d.')
|
output = output.replace(' (discriminator', ': (d.')
|
||||||
eprintln('${output:-46s} | ${addr:14s} | $beforeaddr')
|
eprintln('${output:-46s} | ${addr:14s} | $beforeaddr')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue