summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/InstrumentationRuntime
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2016-05-24 20:35:28 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2016-05-24 20:35:28 +0000
commit579cadecf715b8a63a698e755c56a071e2b1358c (patch)
tree5ebb66ddb22d7f12726fb7bec2eacdd8d42df31d /lldb/source/Plugins/InstrumentationRuntime
parent2b4742f53e38169573a6060767741342f279d130 (diff)
Reword the "Happened at" TSan-reported thread to contain a thread id.
Diffstat (limited to 'lldb/source/Plugins/InstrumentationRuntime')
-rw-r--r--lldb/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp7
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]);