summaryrefslogtreecommitdiff
path: root/lib/tsan
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-02-16 14:02:32 +0000
committerKuba Mracek <mracek@apple.com>2017-02-16 14:02:32 +0000
commit5ad57c8b9793029b2db1ccae431a22fe67b9225e (patch)
tree5ce4fad22b3c1d1debae23bc888a6332557f1984 /lib/tsan
parent154a35efc6950bceaacc30b86890a380f14dfcab (diff)
[tsan] Provide external tags (object types) via debugging API
In D28836, we added a way to tag heap objects and thus provide object types into report. This patch exposes this information into the debugging API. Differential Revision: https://reviews.llvm.org/D30023 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r--lib/tsan/rtl/tsan_debugging.cc10
-rw-r--r--lib/tsan/rtl/tsan_interface.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_debugging.cc b/lib/tsan/rtl/tsan_debugging.cc
index 360879481..06154bc13 100644
--- a/lib/tsan/rtl/tsan_debugging.cc
+++ b/lib/tsan/rtl/tsan_debugging.cc
@@ -128,6 +128,16 @@ int __tsan_get_report_loc(void *report, uptr idx, const char **type,
}
SANITIZER_INTERFACE_ATTRIBUTE
+int __tsan_get_report_loc_object_type(void *report, uptr idx,
+ const char **object_type) {
+ const ReportDesc *rep = (ReportDesc *)report;
+ CHECK_LT(idx, rep->locs.Size());
+ ReportLocation *loc = rep->locs[idx];
+ *object_type = GetObjectTypeFromTag(loc->external_tag);
+ return 1;
+}
+
+SANITIZER_INTERFACE_ATTRIBUTE
int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,
int *destroyed, void **trace, uptr trace_size) {
const ReportDesc *rep = (ReportDesc *)report;
diff --git a/lib/tsan/rtl/tsan_interface.h b/lib/tsan/rtl/tsan_interface.h
index e02888c63..496a8717f 100644
--- a/lib/tsan/rtl/tsan_interface.h
+++ b/lib/tsan/rtl/tsan_interface.h
@@ -132,6 +132,10 @@ int __tsan_get_report_loc(void *report, uptr idx, const char **type,
int *fd, int *suppressable, void **trace,
uptr trace_size);
+SANITIZER_INTERFACE_ATTRIBUTE
+int __tsan_get_report_loc_object_type(void *report, uptr idx,
+ const char **object_type);
+
// Returns information about mutexes included in the report.
SANITIZER_INTERFACE_ATTRIBUTE
int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,