Skip to content

Commit 6580b3f

Browse files
committed
[TySan] Added a 'print_stacktrace' flag for more detailed errors
1 parent 266bb49 commit 6580b3f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler-rt/lib/tysan/tysan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ static void reportError(void *Addr, int Size, tysan_type_descriptor *TD,
198198

199199
if (pc) {
200200

201-
bool request_fast = StackTrace::WillUseFastUnwind(true);
201+
bool request_fast =
202+
StackTrace::WillUseFastUnwind(true) && !flags().print_stacktrace;
202203
BufferedStackTrace ST;
203204
ST.Unwind(kStackTraceMax, pc, bp, 0, 0, 0, request_fast);
204205
ST.Print();

compiler-rt/lib/tysan/tysan_flags.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515

1616
// TYSAN_FLAG(Type, Name, DefaultValue, Description)
1717
// See COMMON_FLAG in sanitizer_flags.inc for more details.
18+
19+
TYSAN_FLAG(bool, print_stacktrace, false,
20+
"Include full stacktrace into an error report")

0 commit comments

Comments
 (0)