[compiler-rt] r343600 - Revert "[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output"
Jessica Paquette via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 2 09:28:52 PDT 2018
Author: paquette
Date: Tue Oct 2 09:28:52 2018
New Revision: 343600
URL: http://llvm.org/viewvc/llvm-project?rev=343600&view=rev
Log:
Revert "[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output"
This reverts r343554.
It was breaking some bots:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/49997/
Removed:
compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_pc_inline.cc
Modified:
compiler-rt/trunk/include/sanitizer/common_interface_defs.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
Modified: compiler-rt/trunk/include/sanitizer/common_interface_defs.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/common_interface_defs.h?rev=343600&r1=343599&r2=343600&view=diff
==============================================================================
--- compiler-rt/trunk/include/sanitizer/common_interface_defs.h (original)
+++ compiler-rt/trunk/include/sanitizer/common_interface_defs.h Tue Oct 2 09:28:52 2018
@@ -124,12 +124,6 @@ extern "C" {
// Symbolizes the supplied 'pc' using the format string 'fmt'.
// Outputs at most 'out_buf_size' bytes into 'out_buf'.
- // If 'out_buf' is not empty then output is zero or more non empty C strings
- // followed by single empty C string. Multiple strings can be returned if PC
- // corresponds to inlined function. Inlined frames are printed in the order
- // from "most-inlined" to the "least-inlined", so the last frame should be the
- // not inlined function.
- // Inlined frames can be removed with 'symbolize_inline_frames=0'.
// The format syntax is described in
// lib/sanitizer_common/sanitizer_stacktrace_printer.h.
void __sanitizer_symbolize_pc(void *pc, const char *fmt, char *out_buf,
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc?rev=343600&r1=343599&r2=343600&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc Tue Oct 2 09:28:52 2018
@@ -114,25 +114,11 @@ void __sanitizer_symbolize_pc(uptr pc, c
return;
}
InternalScopedString frame_desc(GetPageSizeCached());
- uptr frame_num = 0;
- // Reserve one byte for the final 0.
- char *out_end = out_buf + out_buf_size - 1;
- for (SymbolizedStack *cur = frame; cur && out_buf < out_end;
- cur = cur->next) {
- frame_desc.clear();
- RenderFrame(&frame_desc, fmt, frame_num++, cur->info,
- common_flags()->symbolize_vs_style,
- common_flags()->strip_path_prefix);
- if (!frame_desc.length())
- continue;
- // Reserve one byte for the terminating 0.
- uptr n = out_end - out_buf - 1;
- internal_strncpy(out_buf, frame_desc.data(), n);
- out_buf += __sanitizer::Min<uptr>(n, frame_desc.length());
- *out_buf++ = 0;
- }
- CHECK(out_buf <= out_end);
- *out_buf = 0;
+ RenderFrame(&frame_desc, fmt, 0, frame->info,
+ common_flags()->symbolize_vs_style,
+ common_flags()->strip_path_prefix);
+ internal_strncpy(out_buf, frame_desc.data(), out_buf_size);
+ out_buf[out_buf_size - 1] = 0;
}
SANITIZER_INTERFACE_ATTRIBUTE
Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_pc_inline.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_pc_inline.cc?rev=343599&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_pc_inline.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/symbolize_pc_inline.cc (removed)
@@ -1,30 +0,0 @@
-// RUN: %clangxx -O3 %s -o %t
-// RUN: %env_tool_opts=strip_path_prefix=/TestCases/ %run %t 2>&1 | FileCheck %s
-// RUN: %env_tool_opts=strip_path_prefix=/TestCases/:symbolize_inline_frames=0 \
-// RUN: %run %t 2>&1 | FileCheck %s --check-prefixes=CHECK-NOINLINE
-
-#include <sanitizer/common_interface_defs.h>
-#include <stdio.h>
-#include <string.h>
-
-char buffer[10000];
-
-__attribute__((noinline)) static void Symbolize() {
- __sanitizer_symbolize_pc(__builtin_return_address(0), "%p %F %L", buffer,
- sizeof(buffer));
- for (char *p = buffer; strlen(p); p += strlen(p) + 1)
- printf("%s\n", p);
-}
-
-// CHECK-NOINLINE: {{0x[0-9a-f]+}} in main symbolize_pc_inline.cc:[[@LINE+2]]
-// CHECK: [[ADDR:0x[0-9a-f]+]] in C2 symbolize_pc_inline.cc:[[@LINE+1]]
-static inline void C2() { Symbolize(); }
-
-// CHECK: [[ADDR]] in C3 symbolize_pc_inline.cc:[[@LINE+1]]
-static inline void C3() { C2(); }
-
-// CHECK: [[ADDR]] in C4 symbolize_pc_inline.cc:[[@LINE+1]]
-static inline void C4() { C3(); }
-
-// CHECK: [[ADDR]] in main symbolize_pc_inline.cc:[[@LINE+1]]
-int main() { C4(); }
More information about the llvm-commits
mailing list