]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Converted lookup_dcookie.
authorNicholas Nethercote <n.nethercote@gmail.com>
Fri, 12 Nov 2004 13:29:24 +0000 (13:29 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Fri, 12 Nov 2004 13:29:24 +0000 (13:29 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2966

coregrind/vg_syscalls.c
include/x86-linux/vki_arch.h
memcheck/tests/scalar.c
memcheck/tests/scalar.stderr.exp
memcheck/tests/scalar.vgtest

index e5637e5908ea682d4a79330bb4959faa660cfd79..469164f00a4b3d8a032019017e37c5cf487ada1a 100644 (file)
@@ -1375,13 +1375,17 @@ PRE(quotactl)
    PRE_MEM_RASCIIZ( "quotactl(special)", arg2 );
 }
 
-PRE(lookup_dcookie)
+// XXX: this is only suitable for 32-bit platforms
+PREx(sys_lookup_dcookie, 0)
 {
-   PRINT("lookup_dcookie (0x%llx, %p, %d)", LOHI64(arg1,arg2), arg3, arg4);
+   PRINT("sys_lookup_dcookie (0x%llx, %p, %d)", LOHI64(arg1,arg2), arg3, arg4);
+   PRE_REG_READ4(long, "lookup_dcookie",
+                 vki_u32, cookie_low32, vki_u32, cookie_high32,
+                 char *, buf, vki_size_t, len);
    PRE_MEM_WRITE( "lookup_dcookie(buf)", arg3, arg4);
 }
 
-POST(lookup_dcookie)
+POST(sys_lookup_dcookie)
 {
    if (arg3 != (Addr)NULL)
       POST_MEM_WRITE( arg3, res);
@@ -6125,9 +6129,9 @@ static const struct sys_info sys_info[] = {
 
    // fadvise64                               250 sys_fadvise64 *
    // Nb: 251 is unused
-   SYSX_(251,                   sys_ni_syscall), // 251 * P
-   SYSX_(__NR_exit_group,       sys_exit_group), // 252 *
-   SYSBA(lookup_dcookie,       0), // 253 sys_lookup_dcookie *
+   SYSX_(251,                   sys_ni_syscall),      // 251 * P
+   SYSX_(__NR_exit_group,       sys_exit_group),      // 252 *
+   SYSXY(__NR_lookup_dcookie,   sys_lookup_dcookie),  // 253 (*/32/64) L
    SYSBA(epoll_create,          0), // 254 sys_epoll_create *
 
    SYSB_(epoll_ctl,             0), // 255 sys_epoll_ctl *
index 8a097e93b2d963b20b058e91a23cafd356b66596..e27542fd63122e92189489593066a830cd6f24a0 100644 (file)
@@ -50,6 +50,8 @@ typedef unsigned long long __vki_u64;
 
 typedef unsigned short vki_u16;
 
+typedef unsigned int vki_u32;
+
 //----------------------------------------------------------------------
 // From linux-2.6.8.1/include/asm-i386/page.h
 //----------------------------------------------------------------------
index e6ca9c26ffae955054def5d6377a4e7f08ddd19d..afc27dc384c839c58d95f349d3633f5a889837bd 100644 (file)
@@ -19,8 +19,8 @@ int main(void)
 
    // __NR_read 3 --> sys_read()
    // Nb: here we are also getting an error from the syscall arg itself.
-   GO(__NR_read, "1+3s 0m");
-   SY(__NR_read+i0, i0, s0, i0);
+   GO(__NR_read, "1+3s 1m");
+   SY(__NR_read+i0, i0, s0, i0+1);
 
    // __NR_write 4 --> sys_write()
    GO(__NR_write, "3s 1m");
@@ -407,6 +407,8 @@ int main(void)
    // __NR_getdents64 220
    // __NR_fcntl64 221
 
+   // XXX: from here on in, not present in early 2.4 kernels
+
    // 222 --> sys_ni_syscall()
    GO(222, "0e");
    SY(222);
@@ -448,7 +450,11 @@ int main(void)
    SY(251);
 
    // __NR_exit_group 252
-   // __NR_lookup_dcookie 253
+
+   // __NR_lookup_dcookie 253 --> sys_lookup_dcookie()
+   GO(__NR_lookup_dcookie, "4s 1m");
+   SY(__NR_lookup_dcookie, i0, i0, s0, i0+1);
+
    // __NR_epoll_create 254
    // __NR_epoll_ctl 255
    // __NR_epoll_wait 256
index d0546bccd02724baac71fcee88444b6bc8c52041..4ed7ef2ab3aa35e2f35620700e5f3c855c49cd41 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------
-  3:           __NR_read 1+3s 0m
+  3:           __NR_read 1+3s 1m
 -----------------------------------------------------
 Syscall param (syscallno) contains uninitialised byte(s)
    at 0x........: syscall (in /...libc...)
@@ -20,6 +20,12 @@ Syscall param read(count) contains uninitialised byte(s)
    at 0x........: syscall (in /...libc...)
    by 0x........: __libc_start_main (...libc...)
    by 0x........: ...
+
+Syscall param read(buf) points to unaddressable byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
 -----------------------------------------------------
   4:          __NR_write 3s 1m
 -----------------------------------------------------
@@ -312,6 +318,9 @@ Syscall param umount(path) contains uninitialised byte(s)
    by 0x........: __libc_start_main (...libc...)
    by 0x........: ...
 
+More than 50 errors detected.  Subsequent errors
+will still be recorded, but in less detail than before.
+
 Syscall param umount(path) points to unaddressable byte(s)
    at 0x........: syscall (in /...libc...)
    by 0x........: __libc_start_main (...libc...)
@@ -321,9 +330,6 @@ Syscall param umount(path) points to unaddressable byte(s)
  23:         __NR_setuid 1s 0m
 -----------------------------------------------------
 
-More than 50 errors detected.  Subsequent errors
-will still be recorded, but in less detail than before.
-
 Syscall param setuid16(uid) contains uninitialised byte(s)
    at 0x........: syscall (in /...libc...)
    by 0x........: __libc_start_main (...libc...)
@@ -457,6 +463,35 @@ Syscall param setuid(uid) contains uninitialised byte(s)
 251:                 251 0e
 -----------------------------------------------------
 -----------------------------------------------------
+253: __NR_lookup_dcookie 4s 1m
+-----------------------------------------------------
+
+Syscall param lookup_dcookie(cookie_low32) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param lookup_dcookie(cookie_high32) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param lookup_dcookie(buf) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param lookup_dcookie(len) contains uninitialised byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+
+Syscall param lookup_dcookie(buf) points to unaddressable byte(s)
+   at 0x........: syscall (in /...libc...)
+   by 0x........: __libc_start_main (...libc...)
+   by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
 9999:                9999 1e
 -----------------------------------------------------
 WARNING: unhandled syscall: 9999
index 964ef598ee452fbcf21b8fb40e4d063d30d8b0ed..12c99d9d172fd2bcbcf90af56d72773670e89c29 100644 (file)
@@ -1,3 +1,4 @@
 prog: scalar
 vgopts: -q
+args: < scalar.c
 delete: tmp_write_file_foo