21
21
1. Redistributions of source code must retain the above copyright
22
22
notice, this list of conditions and the following disclaimer.
23
23
24
- 2. The origin of this software must not be misrepresented; you must
25
- not claim that you wrote the original software. If you use this
26
- software in a product, an acknowledgment in the product
24
+ 2. The origin of this software must not be misrepresented; you must
25
+ not claim that you wrote the original software. If you use this
26
+ software in a product, an acknowledgment in the product
27
27
documentation would be appreciated but is not required.
28
28
29
29
3. Altered source versions must be plainly marked as such, and must
30
30
not be misrepresented as being the original software.
31
31
32
- 4. The name of the author may not be used to endorse or promote
33
- products derived from this software without specific prior written
32
+ 4. The name of the author may not be used to endorse or promote
33
+ products derived from this software without specific prior written
34
34
permission.
35
35
36
36
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
52
52
the terms of the GNU General Public License, version 2. See the
53
53
COPYING file in the source distribution for details.
54
54
55
- ----------------------------------------------------------------
55
+ ----------------------------------------------------------------
56
56
*/
57
57
58
58
59
59
/* This file is for inclusion into client (your!) code.
60
60
61
- You can use these macros to manipulate and query Valgrind's
61
+ You can use these macros to manipulate and query Valgrind's
62
62
execution inside your own programs.
63
63
64
64
The resulting executables will still run without Valgrind, just a
126
126
# define PLAT_x86_darwin 1
127
127
#elif defined(__APPLE__ ) && defined(__x86_64__ )
128
128
# define PLAT_amd64_darwin 1
129
+ #elif defined(__MINGW64__ ) || (defined(_WIN64 ) && defined(_M_X64 ))
130
+ # define PLAT_amd64_win64 1
129
131
#elif defined(__MINGW32__ ) || defined(__CYGWIN32__ ) \
130
132
|| (defined(_WIN32 ) && defined(_M_IX86 ))
131
133
# define PLAT_x86_win32 1
132
- #elif defined(__MINGW64__ ) || (defined(_WIN64 ) && defined(_M_X64 ))
133
- # define PLAT_amd64_win64 1
134
134
#elif defined(__linux__ ) && defined(__i386__ )
135
135
# define PLAT_x86_linux 1
136
136
#elif defined(__linux__ ) && defined(__x86_64__ )
214
214
this is executed not under Valgrind. Args are passed in a memory
215
215
block, and so there's no intrinsic limit to the number that could
216
216
be passed, but it's currently five.
217
-
218
- The macro args are:
217
+
218
+ The macro args are:
219
219
_zzq_rlval result lvalue
220
220
_zzq_default default value (result returned when running on real CPU)
221
221
_zzq_request request code
242
242
|| (defined(PLAT_x86_win32 ) && defined(__GNUC__ ))
243
243
244
244
typedef
245
- struct {
245
+ struct {
246
246
unsigned int nraddr ; /* where's the code? */
247
247
}
248
248
OrigFn ;
@@ -306,7 +306,7 @@ typedef
306
306
#if defined(PLAT_x86_win32 ) && !defined(__GNUC__ )
307
307
308
308
typedef
309
- struct {
309
+ struct {
310
310
unsigned int nraddr ; /* where's the code? */
311
311
}
312
312
OrigFn ;
@@ -374,12 +374,13 @@ valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request,
374
374
375
375
#endif /* PLAT_x86_win32 */
376
376
377
- /* ------------------------ amd64-{linux,darwin} -- ------------- */
377
+ /* -------------------- amd64-{linux,darwin,win64} ------------- */
378
378
379
- #if defined(PLAT_amd64_linux ) || defined(PLAT_amd64_darwin )
379
+ #if defined(PLAT_amd64_linux ) || defined(PLAT_amd64_darwin ) \
380
+ || defined(PLAT_amd64_win64 )
380
381
381
382
typedef
382
- struct {
383
+ struct {
383
384
unsigned long long int nraddr ; /* where's the code? */
384
385
}
385
386
OrigFn ;
@@ -443,7 +444,7 @@ typedef
443
444
#if defined(PLAT_ppc32_linux )
444
445
445
446
typedef
446
- struct {
447
+ struct {
447
448
unsigned int nraddr ; /* where's the code? */
448
449
}
449
450
OrigFn ;
@@ -512,7 +513,7 @@ typedef
512
513
#if defined(PLAT_ppc64_linux )
513
514
514
515
typedef
515
- struct {
516
+ struct {
516
517
unsigned long long int nraddr ; /* where's the code? */
517
518
unsigned long long int r2 ; /* what tocptr do we need? */
518
519
}
@@ -591,7 +592,7 @@ typedef
591
592
#if defined(PLAT_arm_linux )
592
593
593
594
typedef
594
- struct {
595
+ struct {
595
596
unsigned int nraddr ; /* where's the code? */
596
597
}
597
598
OrigFn ;
@@ -736,7 +737,7 @@ typedef
736
737
#if defined(PLAT_mips32_linux )
737
738
738
739
typedef
739
- struct {
740
+ struct {
740
741
unsigned int nraddr ; /* where's the code? */
741
742
}
742
743
OrigFn ;
@@ -750,7 +751,7 @@ typedef
750
751
"srl $0, $0, 29\n\t" \
751
752
"srl $0, $0, 3\n\t" \
752
753
"srl $0, $0, 19\n\t"
753
-
754
+
754
755
#define VALGRIND_DO_CLIENT_REQUEST_EXPR ( \
755
756
_zzq_default , _zzq_request , \
756
757
_zzq_arg1 , _zzq_arg2 , _zzq_arg3 , _zzq_arg4 , _zzq_arg5 ) \
@@ -1999,7 +2000,7 @@ typedef
1999
2000
#define VALGRIND_RESTORE_STACK \
2000
2001
"mr 1,28\n\t"
2001
2002
2002
- /* These CALL_FN_ macros assume that on ppc32-linux,
2003
+ /* These CALL_FN_ macros assume that on ppc32-linux,
2003
2004
sizeof(unsigned long) == 4. */
2004
2005
2005
2006
#define CALL_FN_W_v (lval , orig ) \
@@ -3509,7 +3510,7 @@ typedef
3509
3510
#define __CALLER_SAVED_REGS "0","1","2","3","4","5","14", \
3510
3511
"f0","f1","f2","f3","f4","f5","f6","f7"
3511
3512
3512
- /* Nb: Although r11 is modified in the asm snippets below (inside
3513
+ /* Nb: Although r11 is modified in the asm snippets below (inside
3513
3514
VALGRIND_CFI_PROLOGUE) it is not listed in the clobber section, for
3514
3515
two reasons:
3515
3516
(1) r11 is restored in VALGRIND_CFI_EPILOGUE, so effectively it is not
@@ -3959,7 +3960,7 @@ typedef
3959
3960
#endif /* PLAT_s390x_linux */
3960
3961
3961
3962
/* ------------------------- mips32-linux ----------------------- */
3962
-
3963
+
3963
3964
#if defined(PLAT_mips32_linux )
3964
3965
3965
3966
/* These regs are trashed by the hidden call. */
@@ -4935,7 +4936,7 @@ typedef
4935
4936
#define VG_IS_TOOL_USERREQ (a , b , v ) \
4936
4937
(VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000))
4937
4938
4938
- /* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
4939
+ /* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
4939
4940
This enum comprises an ABI exported by Valgrind to programs
4940
4941
which use client requests. DO NOT CHANGE THE ORDER OF THESE
4941
4942
ENTRIES, NOR DELETE ANY -- add new ones at the end. */
@@ -5073,7 +5074,7 @@ VALGRIND_PRINTF(const char *format, ...)
5073
5074
_qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR (0 ,
5074
5075
VG_USERREQ__PRINTF_VALIST_BY_REF ,
5075
5076
(unsigned long )format ,
5076
- (unsigned long )& vargs ,
5077
+ (unsigned long )& vargs ,
5077
5078
0 , 0 , 0 );
5078
5079
#endif
5079
5080
va_end (vargs );
@@ -5111,7 +5112,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
5111
5112
_qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR (0 ,
5112
5113
VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF ,
5113
5114
(unsigned long )format ,
5114
- (unsigned long )& vargs ,
5115
+ (unsigned long )& vargs ,
5115
5116
0 , 0 , 0 );
5116
5117
#endif
5117
5118
va_end (vargs );
@@ -5122,7 +5123,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
5122
5123
5123
5124
/* These requests allow control to move from the simulated CPU to the
5124
5125
real CPU, calling an arbitary function.
5125
-
5126
+
5126
5127
Note that the current ThreadId is inserted as the first argument.
5127
5128
So this call:
5128
5129
@@ -5208,15 +5209,15 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...)
5208
5209
- It marks the block as being addressable and undefined (if 'is_zeroed' is
5209
5210
not set), or addressable and defined (if 'is_zeroed' is set). This
5210
5211
controls how accesses to the block by the program are handled.
5211
-
5212
+
5212
5213
'addr' is the start of the usable block (ie. after any
5213
5214
redzone), 'sizeB' is its size. 'rzB' is the redzone size if the allocator
5214
5215
can apply redzones -- these are blocks of padding at the start and end of
5215
5216
each block. Adding redzones is recommended as it makes it much more likely
5216
5217
Valgrind will spot block overruns. `is_zeroed' indicates if the memory is
5217
5218
zeroed (or filled with another predictable value), as is the case for
5218
5219
calloc().
5219
-
5220
+
5220
5221
VALGRIND_MALLOCLIKE_BLOCK should be put immediately after the point where a
5221
5222
heap block -- that will be used by the client program -- is allocated.
5222
5223
It's best to put it at the outermost level of the allocator if possible;
0 commit comments