mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Update valgrind.h and memcheck.h to 3.6.0
This commit is contained in:
parent
dbe5dc9768
commit
b5a6082d41
@ -13,7 +13,7 @@
|
||||
This file is part of MemCheck, a heavyweight Valgrind tool for
|
||||
detecting memory errors.
|
||||
|
||||
Copyright (C) 2000-2009 Julian Seward. All rights reserved.
|
||||
Copyright (C) 2000-2010 Julian Seward. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@ -107,66 +107,48 @@ typedef
|
||||
|
||||
/* Mark memory at _qzz_addr as unaddressable for _qzz_len bytes. */
|
||||
#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__MAKE_MEM_NOACCESS, \
|
||||
_qzz_addr, _qzz_len, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
(_qzz_addr), (_qzz_len), 0, 0, 0)
|
||||
|
||||
/* Similarly, mark memory at _qzz_addr as addressable but undefined
|
||||
for _qzz_len bytes. */
|
||||
#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__MAKE_MEM_UNDEFINED, \
|
||||
_qzz_addr, _qzz_len, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
(_qzz_addr), (_qzz_len), 0, 0, 0)
|
||||
|
||||
/* Similarly, mark memory at _qzz_addr as addressable and defined
|
||||
for _qzz_len bytes. */
|
||||
#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__MAKE_MEM_DEFINED, \
|
||||
_qzz_addr, _qzz_len, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
(_qzz_addr), (_qzz_len), 0, 0, 0)
|
||||
|
||||
/* Similar to VALGRIND_MAKE_MEM_DEFINED except that addressability is
|
||||
not altered: bytes which are addressable are marked as defined,
|
||||
but those which are not addressable are left unchanged. */
|
||||
#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
|
||||
#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__MAKE_MEM_DEFINED_IF_ADDRESSABLE, \
|
||||
_qzz_addr, _qzz_len, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
(_qzz_addr), (_qzz_len), 0, 0, 0)
|
||||
|
||||
/* Create a block-description handle. The description is an ascii
|
||||
string which is included in any messages pertaining to addresses
|
||||
within the specified memory range. Has no other effect on the
|
||||
properties of the memory range. */
|
||||
#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
|
||||
VG_USERREQ__CREATE_BLOCK, \
|
||||
_qzz_addr, _qzz_len, _qzz_desc, \
|
||||
0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__CREATE_BLOCK, \
|
||||
(_qzz_addr), (_qzz_len), (_qzz_desc), \
|
||||
0, 0)
|
||||
|
||||
/* Discard a block-description-handle. Returns 1 for an
|
||||
invalid handle, 0 for a valid handle. */
|
||||
#define VALGRIND_DISCARD(_qzz_blkindex) \
|
||||
(__extension__ ({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \
|
||||
VG_USERREQ__DISCARD, \
|
||||
0, _qzz_blkindex, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
0, (_qzz_blkindex), 0, 0, 0)
|
||||
|
||||
|
||||
/* Client-code macros to check the state of memory. */
|
||||
@ -175,25 +157,19 @@ typedef
|
||||
If suitable addressibility is not established, Valgrind prints an
|
||||
error message and returns the address of the first offending byte.
|
||||
Otherwise it returns zero. */
|
||||
#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
|
||||
VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE,\
|
||||
_qzz_addr, _qzz_len, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
|
||||
VG_USERREQ__CHECK_MEM_IS_ADDRESSABLE, \
|
||||
(_qzz_addr), (_qzz_len), 0, 0, 0)
|
||||
|
||||
/* Check that memory at _qzz_addr is addressable and defined for
|
||||
_qzz_len bytes. If suitable addressibility and definedness are not
|
||||
established, Valgrind prints an error message and returns the
|
||||
address of the first offending byte. Otherwise it returns zero. */
|
||||
#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
|
||||
VG_USERREQ__CHECK_MEM_IS_DEFINED, \
|
||||
_qzz_addr, _qzz_len, 0, 0, 0); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
(_qzz_addr), (_qzz_len), 0, 0, 0);
|
||||
|
||||
/* Use this macro to force the definedness and addressibility of an
|
||||
lvalue to be checked. If suitable addressibility and definedness
|
||||
@ -276,15 +252,11 @@ typedef
|
||||
The metadata is not copied in cases 0, 2 or 3 so it should be
|
||||
impossible to segfault your system by using this call.
|
||||
*/
|
||||
#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \
|
||||
(__extension__({unsigned long _qzz_res; \
|
||||
char* czza = (char*)zza; \
|
||||
char* czzvbits = (char*)zzvbits; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
|
||||
VG_USERREQ__GET_VBITS, \
|
||||
czza, czzvbits, zznbytes, 0, 0 ); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
|
||||
VG_USERREQ__GET_VBITS, \
|
||||
(char*)(zza), (char*)(zzvbits), \
|
||||
(zznbytes), 0, 0)
|
||||
|
||||
/* Set the validity data for addresses [zza..zza+zznbytes-1], copying it
|
||||
from the provided zzvbits array. Return values:
|
||||
@ -295,15 +267,11 @@ typedef
|
||||
The metadata is not copied in cases 0, 2 or 3 so it should be
|
||||
impossible to segfault your system by using this call.
|
||||
*/
|
||||
#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \
|
||||
(__extension__({unsigned int _qzz_res; \
|
||||
char* czza = (char*)zza; \
|
||||
char* czzvbits = (char*)zzvbits; \
|
||||
VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, \
|
||||
VG_USERREQ__SET_VBITS, \
|
||||
czza, czzvbits, zznbytes, 0, 0 ); \
|
||||
_qzz_res; \
|
||||
}))
|
||||
#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes) \
|
||||
VALGRIND_DO_CLIENT_REQUEST_EXPR(0, \
|
||||
VG_USERREQ__SET_VBITS, \
|
||||
(char*)(zza), (char*)(zzvbits), \
|
||||
(zznbytes), 0, 0 )
|
||||
|
||||
#endif
|
||||
|
||||
|
1094
src/rt/valgrind.h
1094
src/rt/valgrind.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user