diff --git a/core/debug/trace/allocator.odin b/core/debug/trace/allocator.odin index d6436d684..7ea191fa8 100644 --- a/core/debug/trace/allocator.odin +++ b/core/debug/trace/allocator.odin @@ -214,15 +214,14 @@ tracking_allocator_print_results :: proc(t: ^Tracking_Allocator, temp_allocator continue } - trace, err := resolve(leak.backtrace, temp_allocator, temp_allocator) - defer locations_destroy(trace, temp_allocator) - fmt.eprintln("[back trace]") + trace, err := resolve(leak.backtrace, temp_allocator, temp_allocator) if err != nil { - fmt.eprintfln("backtrace error: %v", err) + fmt.eprintfln("\tbacktrace error: %v", err) continue } + defer locations_destroy(trace, temp_allocator) print(trace) fmt.eprintln() @@ -240,15 +239,14 @@ tracking_allocator_print_results :: proc(t: ^Tracking_Allocator, temp_allocator continue } - trace, err := resolve(bad_free.backtrace, temp_allocator, temp_allocator) - defer locations_destroy(trace, temp_allocator) - fmt.eprintln("[back trace]") + trace, err := resolve(bad_free.backtrace, temp_allocator, temp_allocator) if err != nil { - fmt.eprintf("backtrace error: %v\n", err) + fmt.eprintfln("\tbacktrace error: %v", err) continue } + defer locations_destroy(trace, temp_allocator) print(trace) } diff --git a/core/debug/trace/trace_linux.odin b/core/debug/trace/trace_linux.odin index 8ad56f31f..4e818f2ac 100644 --- a/core/debug/trace/trace_linux.odin +++ b/core/debug/trace/trace_linux.odin @@ -157,18 +157,18 @@ _resolve :: proc(bt: Capture, allocator, temp_allocator: runtime.Allocator) -> ( defer delete(stdout, temp_allocator) defer delete(stderr, temp_allocator) + count := len(command)-COMMAND_START_LEN + // `SYMBOLIZER_PROGRAM` does not exist, lets fall back to unresolved info. if perr == .Not_Exist { fill_unresolved(locations, msgs, allocator) - return + return count, nil } if perr != nil || !state.success { return 0, .Resolve_Aborted } - count := len(command)-COMMAND_START_LEN - sstdout := string(stdout) for i in 0..