96 VG_USERREQ__MAKE_MEM_NOACCESS = VG_USERREQ_TOOL_BASE(
'M',
'C'),
97 VG_USERREQ__MAKE_MEM_UNDEFINED,
98 VG_USERREQ__MAKE_MEM_DEFINED,
100 VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,
101 VG_USERREQ__CHECK_MEM_IS_DEFINED,
102 VG_USERREQ__DO_LEAK_CHECK,
103 VG_USERREQ__COUNT_LEAKS,
105 VG_USERREQ__GET_VBITS,
106 VG_USERREQ__SET_VBITS,
108 VG_USERREQ__CREATE_BLOCK,
110 VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE,
113 _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR
114 = VG_USERREQ_TOOL_BASE(
'M',
'C') + 256
115 } Vg_MemCheckClientRequest;
122 #define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len) \
123 (__extension__({unsigned int _qzz_res; \
124 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \
125 VG_USERREQ__MAKE_MEM_NOACCESS, \
126 _qzz_addr, _qzz_len, 0, 0, 0); \
132 #define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) \
133 (__extension__({unsigned int _qzz_res; \
134 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \
135 VG_USERREQ__MAKE_MEM_UNDEFINED, \
136 _qzz_addr, _qzz_len, 0, 0, 0); \
142 #define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len) \
143 (__extension__({unsigned int _qzz_res; \
144 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \
145 VG_USERREQ__MAKE_MEM_DEFINED, \
146 _qzz_addr, _qzz_len, 0, 0, 0); \
151 #define VALGRIND_MAKE_NOACCESS(_qzz_addr,_qzz_len) \
152 VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len)
155 #define VALGRIND_MAKE_WRITABLE(_qzz_addr,_qzz_len) \
156 VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len)
159 #define VALGRIND_MAKE_READABLE(_qzz_addr,_qzz_len) \
160 VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len)
165 #define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len) \
166 (__extension__({unsigned int _qzz_res; \
167 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \
168 VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE, \
169 _qzz_addr, _qzz_len, 0, 0, 0); \
177 #define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc) \
178 (__extension__({unsigned int _qzz_res; \
179 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \
180 VG_USERREQ__CREATE_BLOCK, \
181 _qzz_addr, _qzz_len, _qzz_desc, \
188 #define VALGRIND_DISCARD(_qzz_blkindex) \
189 (__extension__ ({unsigned int _qzz_res; \
190 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 , \
191 VG_USERREQ__DISCARD, \
192 0, _qzz_blkindex, 0, 0, 0); \
203 #define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) \
204 (__extension__({unsigned int _qzz_res; \
205 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
206 VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,\
207 _qzz_addr, _qzz_len, 0, 0, 0); \
215 #define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) \
216 (__extension__({unsigned int _qzz_res; \
217 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
218 VG_USERREQ__CHECK_MEM_IS_DEFINED, \
219 _qzz_addr, _qzz_len, 0, 0, 0); \
228 #define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue) \
229 VALGRIND_CHECK_MEM_IS_DEFINED( \
230 (volatile unsigned char *)&(__lvalue), \
231 (unsigned int)(sizeof (__lvalue)))
234 #define VALGRIND_CHECK_WRITABLE(_qzz_addr,_qzz_len) \
235 VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len)
238 #define VALGRIND_CHECK_READABLE(_qzz_addr,_qzz_len) \
239 VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len)
242 #define VALGRIND_CHECK_DEFINED(__lvalue) \
243 VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue)
247 #define VALGRIND_DO_LEAK_CHECK \
248 {unsigned int _qzz_res; \
249 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
250 VG_USERREQ__DO_LEAK_CHECK, \
256 #define VALGRIND_DO_QUICK_LEAK_CHECK \
257 {unsigned int _qzz_res; \
258 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
259 VG_USERREQ__DO_LEAK_CHECK, \
265 #define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed) \
272 {unsigned int _qzz_res; \
273 unsigned long _qzz_leaked = 0, _qzz_dubious = 0; \
274 unsigned long _qzz_reachable = 0, _qzz_suppressed = 0; \
275 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
276 VG_USERREQ__COUNT_LEAKS, \
277 &_qzz_leaked, &_qzz_dubious, \
278 &_qzz_reachable, &_qzz_suppressed, 0); \
279 leaked = _qzz_leaked; \
280 dubious = _qzz_dubious; \
281 reachable = _qzz_reachable; \
282 suppressed = _qzz_suppressed; \
295 #define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \
296 (__extension__({unsigned int _qzz_res; \
297 char* czza = (char*)zza; \
298 char* czzvbits = (char*)zzvbits; \
299 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
300 VG_USERREQ__GET_VBITS, \
301 czza, czzvbits, zznbytes, 0, 0 ); \
314 #define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \
315 (__extension__({unsigned int _qzz_res; \
316 char* czza = (char*)zza; \
317 char* czzvbits = (char*)zzvbits; \
318 VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
319 VG_USERREQ__SET_VBITS, \
320 czza, czzvbits, zznbytes, 0, 0 ); \