return buf;
}
-#ifdef OLD_RACE_DETECTION_ALGORITHM
-void drd_report_data_race(const DataRaceInfo* const dri)
-{
- AddrInfo ai;
- Char descr[256];
-
- tl_assert(dri);
- tl_assert(dri->range_begin < dri->range_end);
- describe_addr_text(dri->range_begin, dri->range_end - dri->range_begin,
- &ai, descr, sizeof(descr));
- VG_(message)(Vg_UserMsg,
- "0x%08lx sz %ld %c %c (%s)",
- dri->range_begin,
- dri->range_end - dri->range_begin,
- dri->range_access & LHS_W ? 'W' : 'R',
- dri->range_access & RHS_W ? 'W' : 'R',
- descr);
- if (ai.akind == eMallocd && ai.lastchange)
- {
- VG_(message)(Vg_UserMsg, "Allocation context:");
- VG_(pp_ExeContext)(ai.lastchange);
- }
- // Note: for stack and heap variables suppression should be
- // stopped automatically as soon as the specified memory
- // range has been freed.
- tl_assert(dri->range_begin < dri->range_end);
- drd_start_suppression(dri->range_begin, dri->range_end, "detected race");
-}
-#endif
-
static
void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri)
{
}
AddrInfo;
-#ifdef OLD_RACE_DETECTION_ALGORITHM
-/* Records info about a data race. */
-typedef struct {
- ThreadId tid1; // Thread ID of first thread involved in the data race.
- ThreadId tid2; // Thread ID of second thread involved in the data race.
- Addr range_begin; // Start address of range involved.
- Addr range_end; // Last address (exclusive) of range involved.
- UInt range_access; // How the range was accessed (LHS_[RW] | RHS_[RW]).
-} DataRaceInfo;
-#endif
-
typedef struct {
ThreadId tid; // Thread ID of the running thread.
Addr addr; // Conflicting address in current thread.
void describe_addr(Addr const a, SizeT const len, AddrInfo* const ai);
Char* describe_addr_text(Addr const a, SizeT const len, AddrInfo* const ai,
Char* const buf, UInt const n_buf);
-#ifdef OLD_RACE_DETECTION_ALGORITHM
-void drd_report_data_race(const DataRaceInfo* const dri);
-#endif
-//void drd_report_data_race2(const DataRaceErrInfo* const dri);
void drd_register_error_handlers(void);