[fix](stacktrace) Temporary fix ARM and MacOS stacktrace #23650

This commit is contained in:
Xinyi Zou
2023-08-30 14:51:20 +08:00
committed by GitHub
parent aef162ad4c
commit 1ce783fb23
2 changed files with 4 additions and 1 deletions

View File

@ -299,7 +299,7 @@ StackTrace::StackTrace(const ucontext_t& signal_context) {
void StackTrace::tryCapture() {
// When unw_backtrace is not available, fall back on the standard
// `backtrace` function from execinfo.h.
#if USE_UNWIND
#if USE_UNWIND && defined(__x86_64__) // TODO
size = unw_backtrace(frame_pointers.data(), capacity);
#else
size = backtrace(frame_pointers.data(), capacity);

View File

@ -45,6 +45,9 @@ std::string get_stack_trace() {
} else if (tool == "glibc") {
return get_stack_trace_by_glibc();
} else if (tool == "libunwind") {
#if defined(__APPLE__) // TODO
return get_stack_trace_by_glog();
#endif
return get_stack_trace_by_libunwind();
} else {
return "no stack";