Author: kuba.brecka
Date: Tue May 24 15:35:28 2016
New Revision: 270608
URL: http://llvm.org/viewvc/llvm-project?rev=270608&view=rev
Log:
Reword the "Happened at" TSan-reported thread to contain a thread id.
Modified:
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
Modified:
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
URL:
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp?rev=270608&r1=270607&r2=270608&view=diff
==============================================================================
---
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
(original)
+++
lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
Tue May 24 15:35:28 2016
@@ -386,9 +386,11 @@ ThreadSanitizerRuntime::RetrieveReportDa
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, Str
}
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]);
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits