backtraces: cleaner looking backtrace output on linux
parent
9c1107f723
commit
9b4bc0189b
|
@ -50,6 +50,7 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
|
|||
for sframe in sframes {
|
||||
executable := sframe.all_before('(')
|
||||
addr := sframe.all_after('[').all_before(']')
|
||||
beforeaddr := sframe.all_before('[')
|
||||
cmd := 'addr2line -e $executable $addr'
|
||||
|
||||
// taken from os, to avoid depending on the os module inside builtin.v
|
||||
|
@ -66,7 +67,8 @@ fn print_backtrace_skipping_top_frames_linux(skipframes int) bool {
|
|||
if 0 != int(C.pclose(f)) {
|
||||
println(sframe) continue
|
||||
}
|
||||
println( '${output:-45s} | $sframe')
|
||||
if output in ['??:0:','??:?:'] { output = '' }
|
||||
println( '${output:-46s} | ${addr:14s} | $beforeaddr')
|
||||
}
|
||||
//C.backtrace_symbols_fd(*voidptr(&buffer[skipframes]), nr_actual_frames, 1)
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue