diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2013-04-30 11:57:32 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2013-04-30 11:57:32 +0000 |
commit | 924047f32220f8da9c308acddbc0a41b952e7a0d (patch) | |
tree | 66c8a755b2bebe33056a4527aeaa81a9229bec7e | |
parent | 8ecd0e5d9f389d18653892851c6ffb2f235de4b7 (diff) | |
download | compiler-rt-924047f32220f8da9c308acddbc0a41b952e7a0d.tar.gz |
tsan: reverse stack trace for failed CHECK's, this is how we print traces in other places
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180781 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/tsan/rtl/tsan_rtl_report.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_rtl_report.cc b/lib/tsan/rtl/tsan_rtl_report.cc index 8e85a09fe..d3d928475 100644 --- a/lib/tsan/rtl/tsan_rtl_report.cc +++ b/lib/tsan/rtl/tsan_rtl_report.cc @@ -695,6 +695,11 @@ void PrintCurrentStackSlow() { sizeof(__sanitizer::StackTrace))) __sanitizer::StackTrace; ptrace->SlowUnwindStack(__sanitizer::StackTrace::GetCurrentPc(), kStackTraceMax); + for (uptr i = 0; i < ptrace->size / 2; i++) { + uptr tmp = ptrace->trace[i]; + ptrace->trace[i] = ptrace->trace[ptrace->size - i - 1]; + ptrace->trace[ptrace->size - i - 1] = tmp; + } StackTrace trace; trace.Init(ptrace->trace, ptrace->size); PrintStack(SymbolizeStack(trace)); |