Currently, TSan only reports everything in a formatted textual form. The idea behind this patch is to provide a consistent API that can be used to query information contained in a TSan-produced report. User can use these APIs either in a debugger (via a script or directly), or they can use it directly from the process (e.g. in the __tsan_on_report callback). ASan already has a similar API, see http://reviews.llvm.org/D4466.
Some details about the patch:
- The API is in C (and not C++), because we want it simple and stable.
- The callback __tsan_on_report is called just after the report is printed to the console.
- Added a test case which uses the callback __tsan_on_report to query and verify various data from the report.