builtin: do not use backtrace with musl
parent
c7e6d379da
commit
be0830b24f
|
@ -39,8 +39,9 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
|
|||
}
|
||||
$if linux {
|
||||
$if !android {
|
||||
$if glibc {
|
||||
// backtrace is not available on Android.
|
||||
if C.backtrace_symbols_fd != 0 {
|
||||
//if C.backtrace_symbols_fd != 0 {
|
||||
buffer := [100]byteptr
|
||||
nr_ptrs := C.backtrace(*voidptr(buffer), 100)
|
||||
nr_actual_frames := nr_ptrs-skipframes
|
||||
|
@ -70,7 +71,7 @@ pub fn print_backtrace_skipping_top_frames(skipframes int) {
|
|||
}
|
||||
//C.backtrace_symbols_fd(*voidptr(&buffer[skipframes]), nr_actual_frames, 1)
|
||||
return
|
||||
}else{
|
||||
}$else{
|
||||
C.printf('backtrace_symbols_fd is missing, so printing backtraces is not available.\n')
|
||||
C.printf('Some libc implementations like musl simply do not provide it.\n')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue