|
From: <sv...@va...> - 2009-05-22 08:07:25
|
Author: njn
Date: 2009-05-22 09:07:13 +0100 (Fri, 22 May 2009)
New Revision: 10105
Log:
- Don't check first arg of [sg]ettimeofday if NULL
- Make the timeval check messages make more sense
Modified:
branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
branches/DARWIN/memcheck/tests/x86-linux/scalar.c
branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-05-22 07:59:26 UTC (rev 10104)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-05-22 08:07:13 UTC (rev 10105)
@@ -2219,8 +2219,8 @@
PRINT("sys_getitimer ( %ld, %#lx )", ARG1, ARG2);
PRE_REG_READ2(long, "getitimer", int, which, struct itimerval *, value);
- PRE_timeval_WRITE( "getitimer(value.it_interval)", &(value->it_interval));
- PRE_timeval_WRITE( "getitimer(value.it_value)", &(value->it_value));
+ PRE_timeval_WRITE( "getitimer(&value->it_interval)", &(value->it_interval));
+ PRE_timeval_WRITE( "getitimer(&value->it_value)", &(value->it_value));
}
POST(sys_getitimer)
@@ -2240,16 +2240,16 @@
struct itimerval *, value, struct itimerval *, ovalue);
if (ARG2 != (Addr)NULL) {
struct vki_itimerval *value = (struct vki_itimerval*)ARG2;
- PRE_timeval_READ( "setitimer(value->it_interval)",
+ PRE_timeval_READ( "setitimer(&value->it_interval)",
&(value->it_interval));
- PRE_timeval_READ( "setitimer(value->it_value)",
+ PRE_timeval_READ( "setitimer(&value->it_value)",
&(value->it_value));
}
if (ARG3 != (Addr)NULL) {
struct vki_itimerval *ovalue = (struct vki_itimerval*)ARG3;
- PRE_timeval_WRITE( "setitimer(ovalue->it_interval)",
+ PRE_timeval_WRITE( "setitimer(&ovalue->it_interval)",
&(ovalue->it_interval));
- PRE_timeval_WRITE( "setitimer(ovalue->it_value)",
+ PRE_timeval_WRITE( "setitimer(&ovalue->it_value)",
&(ovalue->it_value));
}
}
@@ -3172,12 +3172,9 @@
PRINT("sys_gettimeofday ( %#lx, %#lx )", ARG1,ARG2);
PRE_REG_READ2(long, "gettimeofday",
struct timeval *, tv, struct timezone *, tz);
-#if defined(VGO_darwin)
- // GrP fixme linux too?
// GrP fixme does darwin write to *tz anymore?
if (ARG1 != 0)
-#endif
- PRE_timeval_WRITE( "gettimeofday(tv)", ARG1 );
+ PRE_timeval_WRITE( "gettimeofday(tv)", ARG1 );
if (ARG2 != 0)
PRE_MEM_WRITE( "gettimeofday(tz)", ARG2, sizeof(struct vki_timezone) );
}
@@ -3186,11 +3183,8 @@
{
vg_assert(SUCCESS);
if (RES == 0) {
-#if defined(VGO_darwin)
- // GrP fixme linux too?
if (ARG1 != 0)
-#endif
- POST_timeval_WRITE( ARG1 );
+ POST_timeval_WRITE( ARG1 );
if (ARG2 != 0)
POST_MEM_WRITE( ARG2, sizeof(struct vki_timezone) );
}
@@ -3201,7 +3195,8 @@
PRINT("sys_settimeofday ( %#lx, %#lx )", ARG1,ARG2);
PRE_REG_READ2(long, "settimeofday",
struct timeval *, tv, struct timezone *, tz);
- PRE_timeval_READ( "settimeofday(tv)", ARG1 );
+ if (ARG1 != 0)
+ PRE_timeval_READ( "settimeofday(tv)", ARG1 );
if (ARG2 != 0) {
PRE_MEM_READ( "settimeofday(tz)", ARG2, sizeof(struct vki_timezone) );
/* maybe should warn if tz->tz_dsttime is non-zero? */
Modified: branches/DARWIN/memcheck/tests/x86-linux/scalar.c
===================================================================
--- branches/DARWIN/memcheck/tests/x86-linux/scalar.c 2009-05-22 07:59:26 UTC (rev 10104)
+++ branches/DARWIN/memcheck/tests/x86-linux/scalar.c 2009-05-22 08:07:13 UTC (rev 10105)
@@ -371,11 +371,11 @@
// __NR_gettimeofday 78
GO(__NR_gettimeofday, "2s 2m");
- SY(__NR_gettimeofday, x0, x0+1); FAIL;
+ SY(__NR_gettimeofday, x0+1, x0+1); FAIL;
// __NR_settimeofday 79
GO(__NR_settimeofday, "2s 2m");
- SY(__NR_settimeofday, x0, x0+1); FAIL;
+ SY(__NR_settimeofday, x0+1, x0+1); FAIL;
// __NR_getgroups 80
GO(__NR_getgroups, "2s 1m");
Modified: branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp 2009-05-22 07:59:26 UTC (rev 10104)
+++ branches/DARWIN/memcheck/tests/x86-linux/scalar.stderr.exp 2009-05-22 08:07:13 UTC (rev 10105)
@@ -978,19 +978,19 @@
Syscall param setitimer(ovalue) contains uninitialised byte(s)
...
-Syscall param setitimer(value->it_interval) points to unaddressable byte(s)
+Syscall param setitimer(&value->it_interval) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-Syscall param setitimer(value->it_value) points to unaddressable byte(s)
+Syscall param setitimer(&value->it_value) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-Syscall param setitimer(ovalue->it_interval) points to unaddressable byte(s)
+Syscall param setitimer(&ovalue->it_interval) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-Syscall param setitimer(ovalue->it_value) points to unaddressable byte(s)
+Syscall param setitimer(&ovalue->it_value) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
@@ -1003,11 +1003,11 @@
Syscall param getitimer(value) contains uninitialised byte(s)
...
-Syscall param getitimer(value.it_interval) points to unaddressable byte(s)
+Syscall param getitimer(&value->it_interval) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-Syscall param getitimer(value.it_value) points to unaddressable byte(s)
+Syscall param getitimer(&value->it_value) points to unaddressable byte(s)
...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
|