diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-11-14 09:41:24 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-11-14 09:41:24 +0000 |
commit | bb4697fe8cbe79c517e6f85713f2de6bd804209d (patch) | |
tree | 3c447f42c7fa7d2c7d42275f5279f51834216812 /lib/sanitizer_common/sanitizer_printf.cc | |
parent | 694d85636b148dfcac37e5c23639baa8fe9abce9 (diff) |
[Sanitizer] Print symbolized stack frame using a single Printf() call.
This reduces the number of "write" syscalls performed to print a single
stack frame description, and makes sanitizer output less intermixed with
program output. Also, add a number of unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_printf.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_printf.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_printf.cc b/lib/sanitizer_common/sanitizer_printf.cc index 4f3968ad2..bbdb24b68 100644 --- a/lib/sanitizer_common/sanitizer_printf.cc +++ b/lib/sanitizer_common/sanitizer_printf.cc @@ -294,4 +294,13 @@ int internal_snprintf(char *buffer, uptr length, const char *format, ...) { return needed_length; } +void InternalScopedString::append(const char *format, ...) { + CHECK_LT(length_, size()); + va_list args; + va_start(args, format); + VSNPrintf(data() + length_, size() - length_, format, args); + va_end(args); + length_ += internal_strlen(data() + length_); +} + } // namespace __sanitizer |