[opt](stacktrace) Optimize stacktrace output #22467

This commit is contained in:
Xinyi Zou
2023-08-06 15:53:53 +08:00
committed by GitHub
parent d628baba0a
commit c2c01825c1
5 changed files with 61 additions and 33 deletions

View File

@ -45,11 +45,7 @@ std::string get_stack_trace() {
} else if (tool == "glibc") {
return get_stack_trace_by_glibc();
} else if (tool == "libunwind") {
#if USE_UNWIND
return get_stack_trace_by_libunwind();
#else
return get_stack_trace_by_glog();
#endif
} else {
return "no stack";
}
@ -82,7 +78,7 @@ std::string get_stack_trace_by_glibc() {
}
std::string get_stack_trace_by_libunwind() {
return StackTrace().toString();
return "\n" + StackTrace().toString();
}
} // namespace doris