[Sanitizer] Introduce generic stack frame rendering machinery
authorAlexey Samsonov <vonosmas@gmail.com>
Wed, 5 Nov 2014 22:44:36 +0000 (22:44 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Wed, 5 Nov 2014 22:44:36 +0000 (22:44 +0000)
commit70f3897b0ab525b603cd702533f64a32bde1911f
treee5df44790a0917f865172131b7e448ba7614753a
parent35f05747f3c240d2e0a5bcb6485b5021bbe6492b
[Sanitizer] Introduce generic stack frame rendering machinery

Summary:
This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.

Test Plan: compiler-rt test suite

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6140

llvm-svn: 221409
compiler-rt/lib/sanitizer_common/CMakeLists.txt
compiler-rt/lib/sanitizer_common/sanitizer_common.cc
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cc [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc [new file with mode: 0644]
compiler-rt/lib/tsan/rtl/tsan_report.cc
compiler-rt/lib/ubsan/ubsan_diag.cc