|
From: Yakir B. S. <Yak...@mo...> - 2014-12-24 15:09:02
|
Hi,
I moving my code from 32bit to 64bit and the pointers changed from 4
bytes to 8 bytes.
I try to you valgrind function VALGRIND_DO_CLIENT_REQUEST .
my code send to this function void*.
It failed on cast from 8 bytes of pointer to unsigned int (4 bytes).
my code :
void markAsUnaccessible(void* address, size_t size)
{
VALGRIND3_DISCARD(VALGRIND3_MAKE_NOACCESS(address,size));
}
#define VALGRIND3_DISCARD(_qzz_blkindex) \
(__extension__ ({unsigned int _qzz_res; \
VALGRIND3_DO_CLIENT_REQUEST(_qzz_res, 0 /* default return */, \
VG3_USERREQ__DISCARD, \
0, _qzz_blkindex, 0, 0, 0); \
_qzz_res; \
}))
#define VALGRIND3_DO_CLIENT_REQUEST( \
_zzq_rlval, _zzq_default, _zzq_request, \
_zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
{ volatile unsigned int _zzq_args[6]; \
volatile unsigned int _zzq_result; \
_zzq_args[0] = (unsigned int)(_zzq_request); \
_zzq_args[1] = (unsigned int)(_zzq_arg1); \
_zzq_args[2] = (unsigned int)(_zzq_arg2); \
_zzq_args[3] = (unsigned int)(_zzq_arg3); \
_zzq_args[4] = (unsigned int)(_zzq_arg4); \
_zzq_args[5] = (unsigned int)(_zzq_arg5); \
__asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \
/* %EDX = client_request ( %EAX ) */ \
"xchgl %%ebx,%%ebx" \
: "=d" (_zzq_result) \
: "a" (&_zzq_args[0]), "0" (_zzq_default) \
: "cc", "memory" \
); \
_zzq_rlval = _zzq_result; \
}
can you help?
I try find solution over the internet and i see that many users have -
VALGRIND_DO_CLIENT_REQUEST
as this code :
#define VALGRIND_DO_CLIENT_REQUEST( \
_zzq_rlval, _zzq_default, _zzq_request, \
_zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \
- { volatile unsigned long long int _zzq_args[6]; \
- volatile unsigned long long int _zzq_result; \
- _zzq_args[0] = (unsigned long long int)(_zzq_request); \
- _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \
- _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \
- _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \
- _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \
- _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \
+ { volatile uint64_t _zzq_args[6]; \
+ volatile uint64_t _zzq_result; \
+ _zzq_args[0] = (uint64_t)(_zzq_request); \
+ _zzq_args[1] = (uint64_t)(_zzq_arg1); \
+ _zzq_args[2] = (uint64_t)(_zzq_arg2); \
+ _zzq_args[3] = (uint64_t)(_zzq_arg3); \
+ _zzq_args[4] = (uint64_t)(_zzq_arg4); \
+ _zzq_args[5] = (uint64_t)(_zzq_arg5); \
but this only handle 64bit, i need solulition that work both ways when i
compile to 32bit/64bit executable
thanks,
yakir
This mail was sent via Mail-SeCure system.
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************
|