diff options
author | Kostya Serebryany <kcc@google.com> | 2018-09-13 19:14:22 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2018-09-13 19:14:22 +0000 |
commit | c173a703b546185ae55069b09c9281e8e3ecd074 (patch) | |
tree | f384c66b145eb10898b5aa37673d36425e7300a2 | |
parent | 8fc05ce34016bcdf2529ed6bcfcb05e450b4e034 (diff) | |
download | bcm5719-llvm-c173a703b546185ae55069b09c9281e8e3ecd074.tar.gz bcm5719-llvm-c173a703b546185ae55069b09c9281e8e3ecd074.zip |
[hwasan] use a single Printf per line when printing a report (more friendly to android logging)
llvm-svn: 342164
-rw-r--r-- | compiler-rt/lib/hwasan/hwasan_report.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler-rt/lib/hwasan/hwasan_report.cc b/compiler-rt/lib/hwasan/hwasan_report.cc index 4c6c8b931bf..57115765a7c 100644 --- a/compiler-rt/lib/hwasan/hwasan_report.cc +++ b/compiler-rt/lib/hwasan/hwasan_report.cc @@ -192,14 +192,17 @@ static void PrintTagsAroundAddr(tag_t *tag_ptr) { RoundDownTo(reinterpret_cast<uptr>(tag_ptr), row_len)); tag_t *beg_row = center_row_beg - row_len * (num_rows / 2); tag_t *end_row = center_row_beg + row_len * (num_rows / 2); + InternalScopedString s(GetPageSizeCached()); for (tag_t *row = beg_row; row < end_row; row += row_len) { - Printf("%s", row == center_row_beg ? "=>" : " "); + s.append("%s", row == center_row_beg ? "=>" : " "); for (uptr i = 0; i < row_len; i++) { - Printf("%s", row + i == tag_ptr ? "[" : " "); - Printf("%02x", row[i]); - Printf("%s", row + i == tag_ptr ? "]" : " "); + s.append("%s", row + i == tag_ptr ? "[" : " "); + s.append("%02x", row[i]); + s.append("%s", row + i == tag_ptr ? "]" : " "); } - Printf("%s\n", row == center_row_beg ? "<=" : " "); + s.append("%s\n", row == center_row_beg ? "<=" : " "); + Printf("%s", s.data()); + s.clear(); } } |