diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2016-05-24 20:35:28 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2016-05-24 20:35:28 +0000 |
commit | 042975183e8f6e970d12195588b27b67560a9712 (patch) | |
tree | 0cffafa6b9520a3ede5d7d0225255a630f49f121 | |
parent | 96e60f7573a55ccf70b29cbfd4dfab28024f0447 (diff) | |
download | bcm5719-llvm-042975183e8f6e970d12195588b27b67560a9712.tar.gz bcm5719-llvm-042975183e8f6e970d12195588b27b67560a9712.zip |
Reword the "Happened at" TSan-reported thread to contain a thread id.
llvm-svn: 270608
-rw-r--r-- | lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp index f666a0752b6..585a785ba76 100644 --- a/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp +++ b/lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp @@ -386,9 +386,11 @@ ThreadSanitizerRuntime::RetrieveReportData(ExecutionContextRef exe_ctx_ref) dict->AddIntegerItem("report_count", main_value->GetValueForExpressionPath(".report_count")->GetValueAsUnsigned(0)); dict->AddItem("sleep_trace", StructuredData::ObjectSP(CreateStackTrace(main_value, ".sleep_trace"))); - StructuredData::Array *stacks = ConvertToStructuredArray(main_value, ".stacks", ".stack_count", [] (ValueObjectSP o, StructuredData::Dictionary *dict) { + StructuredData::Array *stacks = ConvertToStructuredArray(main_value, ".stacks", ".stack_count", [thread_sp] (ValueObjectSP o, StructuredData::Dictionary *dict) { dict->AddIntegerItem("index", o->GetValueForExpressionPath(".idx")->GetValueAsUnsigned(0)); dict->AddItem("trace", StructuredData::ObjectSP(CreateStackTrace(o))); + // "stacks" happen on the current thread + dict->AddIntegerItem("thread_id", thread_sp->GetIndexID()); }); dict->AddItem("stacks", StructuredData::ObjectSP(stacks)); @@ -823,7 +825,8 @@ GenerateThreadName(std::string path, StructuredData::Object *o, StructuredData:: } if (path == "stacks") { - result = "happened at"; + int thread_id = o->GetObjectForDotSeparatedPath("thread_id")->GetIntegerValue(); + result = Sprintf("Thread %d", thread_id); } result[0] = toupper(result[0]); |