1 /* -*- mode: C; c-basic-offset: 3; indent-tabs-mode: nil; -*- */
3 This file is part of drd, a thread error detector.
5 Copyright (C) 2006-2011 Bart Van Assche <bvanassche@acm.org>.
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 The GNU General Public License is contained in the file COPYING.
30 #include "pub_drd_bitmap.h" // BmAccessTypeT
31 #include "drd_thread.h" // DrdThreadId
32 #include "pub_tool_basics.h" // SizeT
33 #include "pub_tool_debuginfo.h" // SegInfo
34 #include "pub_tool_errormgr.h" // ExeContext
37 /* DRD error types. */
40 #define STR_DataRaceErr "ConflictingAccess"
42 #define STR_MutexErr "MutexErr"
44 #define STR_CondErr "CondErr"
46 #define STR_CondDestrErr "CondDestrErr"
48 #define STR_CondRaceErr "CondRaceErr"
50 #define STR_CondWaitErr "CondWaitErr"
52 #define STR_SemaphoreErr "SemaphoreErr"
54 #define STR_BarrierErr "BarrierErr"
56 #define STR_RwlockErr "RwlockErr"
58 #define STR_HoldtimeErr "HoldtimeErr"
60 #define STR_GenericErr "GenericErr"
62 #define STR_InvalidThreadId "InvalidThreadId"
64 #define STR_UnimpHgClReq "UnimpHgClReq"
66 #define STR_UnimpDrdClReq "UnimpDrdClReq"
70 /* The classification of a faulting address. */
73 //Undescribed, // as-yet unclassified
75 eUnknown, // classification yielded nothing useful
78 eSegment, // in a segment (as defined in pub_tool_debuginfo.h)
79 //UserG, // in a user-defined block
80 //Mempool, // in a mempool
81 //Register, // in a register; for Param errors only
85 /* Records info about a faulting address. */
88 AddrKind akind; // ALL
90 PtrdiffT rwoffset; // ALL
91 ExeContext* lastchange; // Mallocd
92 DrdThreadId stack_tid; // Stack
93 DebugInfo* debuginfo; // Segment
94 Char name[256]; // Segment
95 Char descr[256]; // Segment
99 * NOTE: the first member of each error info structure MUST be the thread ID
100 * in which the error has been observed.
103 DrdThreadId tid; // Thread ID of the running thread.
104 Addr addr; // Conflicting address in current thread.
105 SizeT size; // Size in bytes of conflicting operation.
106 BmAccessTypeT access_type; // Access type: load or store.
149 DrdThreadId other_tid;
150 ExeContext* other_context;
160 Addr synchronization_object;
161 ExeContext* acquired_at;
174 } InvalidThreadIdInfo;
181 void DRD_(set_show_conflicting_segments)(const Bool scs);
182 void DRD_(register_error_handlers)(void);
185 #endif /* __DRD_ERROR_H */