|
From: <sv...@va...> - 2005-08-06 11:00:10
|
Author: tom
Date: 2005-08-06 12:00:04 +0100 (Sat, 06 Aug 2005)
New Revision: 4332
Log:
Merge fixes for bugs 110202, 110203 and 110208 to stable.
Modified:
branches/VALGRIND_3_0_BRANCH/coregrind/m_debuginfo/symtab.c
branches/VALGRIND_3_0_BRANCH/coregrind/m_libcfile.c
branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/priv_syswrap-generic.=
h
branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-amd64-linux.c
branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-generic.c
branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-x86-linux.c
branches/VALGRIND_3_0_BRANCH/include/pub_tool_libcfile.h
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_debuginfo/symtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_debuginfo/symtab.c 2005-08-0=
6 10:37:37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_debuginfo/symtab.c 2005-08-0=
6 11:00:04 UTC (rev 4332)
@@ -1278,8 +1278,8 @@
line number info out of it. It will be munmapped immediately
thereafter; it is only aboard transiently. */
=20
- i =3D VG_(stat)(si->filename, &stat_buf);
- if (i !=3D 0) {
+ fd =3D VG_(stat)(si->filename, &stat_buf);
+ if (fd.isError) {
ML_(symerr)("Can't stat .so/.exe (to determine its size)?!");
return False;
}
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_libcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_libcfile.c 2005-08-06 10:37:=
37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_libcfile.c 2005-08-06 11:00:=
04 UTC (rev 4332)
@@ -119,10 +119,10 @@
return res.isError ? (-1) : 0;
}
=20
-Int VG_(stat) ( Char* file_name, struct vki_stat* buf )
+SysRes VG_(stat) ( Char* file_name, struct vki_stat* buf )
{
SysRes res =3D VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)b=
uf);
- return res.isError ? (-1) : 0;
+ return res;
}
=20
Int VG_(fstat) ( Int fd, struct vki_stat* buf )
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/priv_syswrap-g=
eneric.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/priv_syswrap-generic=
.h 2005-08-06 10:37:37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/priv_syswrap-generic=
.h 2005-08-06 11:00:04 UTC (rev 4332)
@@ -146,6 +146,7 @@
DECL_TEMPLATE(generic, sys_gettimeofday);
DECL_TEMPLATE(generic, sys_madvise);
DECL_TEMPLATE(generic, sys_sigpending);
+DECL_TEMPLATE(generic, sys_waitid);
=20
// These ones aren't POSIX, but are in some standard and look reasonably
// generic, and are the same for all architectures under Linux.
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-amd64-=
linux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-amd64-linux.=
c 2005-08-06 10:37:37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-amd64-linux.=
c 2005-08-06 11:00:04 UTC (rev 4332)
@@ -1473,7 +1473,7 @@
GENX_(__NR_mq_notify, sys_mq_notify), // 244=20
GENXY(__NR_mq_getsetattr, sys_mq_getsetattr), // 245=20
// (__NR_kexec_load, sys_ni_syscall), // 246=20
- // (__NR_waitid, sys_waitid), // 247=20
+ GENXY(__NR_waitid, sys_waitid), // 247=20
};
=20
const UInt ML_(syscall_table_size) =3D=20
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-generi=
c.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-generic.c 20=
05-08-06 10:37:37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-generic.c 20=
05-08-06 11:00:04 UTC (rev 4332)
@@ -2306,11 +2306,11 @@
exec. */
{
struct vki_stat st;
- Int i =3D VG_(stat)((Char *)ARG1, &st);
+ SysRes r =3D VG_(stat)((Char *)ARG1, &st);
=20
- if (i =3D=3D -1) {
+ if (r.isError) {
/* stat failed */
- SET_STATUS_Failure( VKI_EACCES/*really, we should copy stat's r=
esult*/ );
+ SET_STATUS_from_SysRes( r );
return;
}
/* just look for regular file with any X bit set
@@ -5709,11 +5709,13 @@
// defined above!
PRE_REG_READ2(long, "clock_getres",=20
vki_clockid_t, clk_id, struct timespec *, res);
- PRE_MEM_WRITE( "clock_getres(res)", ARG2, sizeof(struct vki_timespec)=
);
+ if (ARG2 !=3D 0)
+ PRE_MEM_WRITE( "clock_getres(res)", ARG2, sizeof(struct vki_timesp=
ec) );
}
POST(sys_clock_getres)
{
- POST_MEM_WRITE( ARG2, sizeof(struct vki_timespec) );
+ if (ARG2 !=3D 0)
+ POST_MEM_WRITE( ARG2, sizeof(struct vki_timespec) );
}
=20
PRE(sys_clock_nanosleep)
@@ -5733,6 +5735,24 @@
POST_MEM_WRITE( ARG4, sizeof(struct vki_timespec) );
}
=20
+PRE(sys_waitid)
+{
+ *flags |=3D SfMayBlock;
+ PRINT("sys_waitid( %d, %d, %p, %d, %p )", ARG1,ARG2,ARG3,ARG4,ARG5);
+ PRE_REG_READ5(int32_t, "sys_waitid",
+ int, which, vki_pid_t, pid, struct vki_siginfo *, infop=
,
+ int, options, struct vki_rusage *, ru);
+ PRE_MEM_WRITE( "waitid(infop)", ARG3, sizeof(struct vki_siginfo) );
+ if (ARG5 !=3D 0)
+ PRE_MEM_WRITE( "waitid(ru)", ARG5, sizeof(struct vki_rusage) );
+}
+POST(sys_waitid)
+{
+ POST_MEM_WRITE( ARG3, sizeof(struct vki_siginfo) );
+ if (ARG5 !=3D 0)
+ POST_MEM_WRITE( ARG5, sizeof(struct vki_rusage) );
+}
+
#undef PRE
#undef POST
=20
Modified: branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-x86-li=
nux.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-x86-linux.c =
2005-08-06 10:37:37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/coregrind/m_syswrap/syswrap-x86-linux.c =
2005-08-06 11:00:04 UTC (rev 4332)
@@ -2277,7 +2277,7 @@
GENX_(__NR_mq_notify, sys_mq_notify), // (mq_open+4)
GENXY(__NR_mq_getsetattr, sys_mq_getsetattr), // (mq_open+5)
GENX_(__NR_sys_kexec_load, sys_ni_syscall), // 283
-// GENXY(__NR_waitid, sys_waitid), // 284
+ GENXY(__NR_waitid, sys_waitid), // 284
=20
GENX_(285, sys_ni_syscall), // 285
// LINX_(__NR_add_key, sys_add_key), // 286
Modified: branches/VALGRIND_3_0_BRANCH/include/pub_tool_libcfile.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/VALGRIND_3_0_BRANCH/include/pub_tool_libcfile.h 2005-08-06 1=
0:37:37 UTC (rev 4331)
+++ branches/VALGRIND_3_0_BRANCH/include/pub_tool_libcfile.h 2005-08-06 1=
1:00:04 UTC (rev 4332)
@@ -42,7 +42,7 @@
extern Int VG_(pipe) ( Int fd[2] );
extern OffT VG_(lseek) ( Int fd, OffT offset, Int whence);
=20
-extern Int VG_(stat) ( Char* file_name, struct vki_stat* buf );
+extern SysRes VG_(stat) ( Char* file_name, struct vki_stat* buf );
extern Int VG_(fstat) ( Int fd, struct vki_stat* buf );
extern Int VG_(dup2) ( Int oldfd, Int newfd );
extern Int VG_(rename) ( Char* old_name, Char* new_name );
|