You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(32) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(44) |
2
(9) |
3
(30) |
4
(28) |
5
(42) |
6
(14) |
7
(10) |
|
8
(7) |
9
(8) |
10
(6) |
11
(15) |
12
(13) |
13
(14) |
14
(23) |
|
15
(17) |
16
(10) |
17
(82) |
18
(14) |
19
(21) |
20
(14) |
21
(21) |
|
22
(7) |
23
(13) |
24
(16) |
25
(11) |
26
(11) |
27
(6) |
28
(7) |
|
29
(8) |
30
(13) |
31
(8) |
|
|
|
|
|
From: <sv...@va...> - 2006-10-17 02:16:53
|
Author: sewardj
Date: 2006-10-17 03:16:44 +0100 (Tue, 17 Oct 2006)
New Revision: 6295
Log:
Merge from branches/AIX5:
- AIX5 support
- get rid of VG_(nanosleep)
- track SysRes changes
Modified:
trunk/coregrind/m_libcproc.c
trunk/coregrind/pub_core_libcproc.h
Modified: trunk/coregrind/m_libcproc.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
--- trunk/coregrind/m_libcproc.c 2006-10-17 02:15:17 UTC (rev 6294)
+++ trunk/coregrind/m_libcproc.c 2006-10-17 02:16:44 UTC (rev 6295)
@@ -30,14 +30,15 @@
=20
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_libcproc.h"
+#include "pub_core_libcsignal.h"
#include "pub_core_mallocfree.h"
#include "pub_core_syscall.h"
#include "pub_core_clientstate.h"
-#include "pub_core_vkiscnums.h"
=20
/* ---------------------------------------------------------------------
Command line and environment stuff
@@ -222,8 +223,20 @@
=20
Int VG_(waitpid)(Int pid, Int *status, Int options)
{
+# if defined(VGO_linux)
SysRes res =3D VG_(do_syscall4)(__NR_wait4, pid, (UWord)status, optio=
ns, 0);
- return res.isError ? -1 : res.val;
+ return res.isError ? -1 : res.res;
+# elif defined(VGO_aix5)
+ /* magic number 4 obtained by truss-ing a C program doing
+ 'waitpid'. Note status and pid args opposite way round from
+ POSIX. */
+ SysRes res =3D VG_(do_syscall5)(__NR_AIX5_kwaitpid,=20
+ (UWord)status, pid, 4 | options,0,0);
+ if (0) VG_(printf)("waitpid: got 0x%x 0x%x\n", res.res, res.err);
+ return res.isError ? -1 : res.res;
+# else
+# error Unknown OS
+# endif
}
=20
/* clone the environment */
@@ -263,7 +276,7 @@
res =3D VG_(do_syscall0)(__NR_fork);
if (res.isError)
return -1;
- pid =3D res.val;
+ pid =3D res.res;
if (pid =3D=3D 0) {
/* child */
static Char** envp =3D NULL;
@@ -287,7 +300,32 @@
VG_(exit)(1);
} else {
/* parent */
- Int zzz =3D VG_(waitpid)(pid, NULL, 0);
+ Int ir, zzz;
+ /* We have to set SIGCHLD to its default behaviour in order that
+ VG_(waitpid) works (at least on AIX). According to the Linux
+ man page for waitpid:
+
+ POSIX.1-2001 specifies that if the disposition of SIGCHLD is
+ set to SIG_IGN or the SA_NOCLDWAIT flag is set for SIGCHLD
+ (see sigaction(2)), then children that terminate do not
+ become zombies and a call to wait() or waitpid() will block
+ until all children have terminated, and then fail with errno
+ set to ECHILD. (The original POSIX standard left the
+ behaviour of setting SIGCHLD to SIG_IGN unspecified.)
+ */
+ struct vki_sigaction sa, saved_sa;
+ VG_(memset)( &sa, 0, sizeof(struct vki_sigaction) );
+ VG_(sigemptyset)(&sa.sa_mask);
+ sa.ksa_handler =3D VKI_SIG_DFL;
+ sa.sa_flags =3D 0;
+ ir =3D VG_(sigaction)(VKI_SIGCHLD, &sa, &saved_sa);
+ vg_assert(ir =3D=3D 0);
+
+ zzz =3D VG_(waitpid)(pid, NULL, 0);
+
+ ir =3D VG_(sigaction)(VKI_SIGCHLD, &saved_sa, NULL);
+ vg_assert(ir =3D=3D 0);
+
return zzz =3D=3D -1 ? -1 : 0;
}
}
@@ -304,9 +342,9 @@
# ifdef __NR_ugetrlimit
res =3D VG_(do_syscall2)(__NR_ugetrlimit, resource, (UWord)rlim);
# endif
- if (res.isError && res.val =3D=3D VKI_ENOSYS)
+ if (res.isError && res.err =3D=3D VKI_ENOSYS)
res =3D VG_(do_syscall2)(__NR_getrlimit, resource, (UWord)rlim);
- return res.isError ? -1 : res.val;
+ return res.isError ? -1 : res.res;
}
=20
=20
@@ -316,7 +354,7 @@
SysRes res;
/* res =3D setrlimit( resource, rlim ); */
res =3D VG_(do_syscall2)(__NR_setrlimit, resource, (UWord)rlim);
- return res.isError ? -1 : res.val;
+ return res.isError ? -1 : res.res;
}
=20
/* ---------------------------------------------------------------------
@@ -325,9 +363,18 @@
=20
Int VG_(gettid)(void)
{
+# if defined(VGO_aix5)
+ SysRes res;
+ Int r;
+ vg_assert(__NR_AIX5__thread_self !=3D __NR_AIX5_UNKNOWN);
+ res =3D VG_(do_syscall0)(__NR_AIX5__thread_self);
+ r =3D res.res;
+ return r;
+
+# else
SysRes res =3D VG_(do_syscall0)(__NR_gettid);
=20
- if (res.isError && res.val =3D=3D VKI_ENOSYS) {
+ if (res.isError && res.res =3D=3D VKI_ENOSYS) {
Char pid[16]; =20
/*
* The gettid system call does not exist. The obvious assumption
@@ -345,44 +392,53 @@
=20
res =3D VG_(do_syscall3)(__NR_readlink, (UWord)"/proc/self",
(UWord)pid, sizeof(pid));
- if (!res.isError && res.val > 0) {
- pid[res.val] =3D '\0';
- res.val =3D VG_(atoll)(pid);
+ if (!res.isError && res.res > 0) {
+ pid[res.res] =3D '\0';
+ res.res =3D VG_(atoll)(pid);
}
}
=20
- return res.val;
+ return res.res;
+# endif
}
=20
/* You'd be amazed how many places need to know the current pid. */
Int VG_(getpid) ( void )
{
/* ASSUMES SYSCALL ALWAYS SUCCEEDS */
- return VG_(do_syscall0)(__NR_getpid) . val;
+ return VG_(do_syscall0)(__NR_getpid) . res;
}
=20
Int VG_(getpgrp) ( void )
{
/* ASSUMES SYSCALL ALWAYS SUCCEEDS */
- return VG_(do_syscall0)(__NR_getpgrp) . val;
+ return VG_(do_syscall0)(__NR_getpgrp) . res;
}
=20
Int VG_(getppid) ( void )
{
/* ASSUMES SYSCALL ALWAYS SUCCEEDS */
- return VG_(do_syscall0)(__NR_getppid) . val;
+ return VG_(do_syscall0)(__NR_getppid) . res;
}
=20
Int VG_(geteuid) ( void )
{
/* ASSUMES SYSCALL ALWAYS SUCCEEDS */
- return VG_(do_syscall0)(__NR_geteuid) . val;
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ return VG_(do_syscall1)(__NR_AIX5_getuidx, 1) . res;
+# else
+ return VG_(do_syscall0)(__NR_geteuid) . res;
+# endif
}
=20
Int VG_(getegid) ( void )
{
/* ASSUMES SYSCALL ALWAYS SUCCEEDS */
- return VG_(do_syscall0)(__NR_getegid) . val;
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ return VG_(do_syscall1)(__NR_AIX5_getgidx, 1) . res;
+# else
+ return VG_(do_syscall0)(__NR_getegid) . res;
+# endif
}
=20
/* Get supplementary groups into list[0 .. size-1]. Returns the
@@ -400,18 +456,19 @@
sres =3D VG_(do_syscall2)(__NR_getgroups, size, (Addr)list16);
if (sres.isError)
return -1;
- if (sres.val > size)
+ if (sres.res > size)
return -1;
- for (i =3D 0; i < sres.val; i++)
+ for (i =3D 0; i < sres.res; i++)
list[i] =3D (UInt)list16[i];
- return sres.val;
+ return sres.res;
=20
-# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux)
+# elif defined(VGP_amd64_linux) || defined(VGP_ppc64_linux) \
+ || defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
SysRes sres;
sres =3D VG_(do_syscall2)(__NR_getgroups, size, (Addr)list);
if (sres.isError)
return -1;
- return sres.val;
+ return sres.res;
=20
# else
# error "VG_(getgroups): needs implementation on this platform"
@@ -428,7 +485,7 @@
res =3D VG_(do_syscall4)(__NR_ptrace, request, pid, (UWord)addr, (UWo=
rd)data);
if (res.isError)
return -1;
- return res.val;
+ return res.res;
}
=20
/* ---------------------------------------------------------------------
@@ -441,7 +498,7 @@
res =3D VG_(do_syscall0)(__NR_fork);
if (res.isError)
return -1;
- return res.val;
+ return res.res;
}
=20
/* ---------------------------------------------------------------------
@@ -450,14 +507,35 @@
=20
UInt VG_(read_millisecond_timer) ( void )
{
+ /* 'now' and 'base' are in microseconds */
static ULong base =3D 0;
+ ULong now;
+
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ /* AIX requires a totally different implementation since
+ sys_gettimeofday doesn't exist. We use the POWER real-time
+ register facility. This will SIGILL on PowerPC 970 on AIX,
+ since PowerPC doesn't support these instructions. */
+ UWord nsec, sec1, sec2;
+ while (1) {
+ __asm__ __volatile__ ("\n"
+ "\tmfspr %0,4\n" /* 4=3D=3DRTCU */
+ "\tmfspr %1,5\n" /* 5=3D=3DRTCL */
+ "\tmfspr %2,4\n" /* 4=3D=3DRTCU */
+ : "=3Db" (sec1), "=3Db" (nsec), "=3Db" (sec2)
+ );
+ if (sec1 =3D=3D sec2) break;
+ }
+ vg_assert(nsec < 1000*1000*1000);
+ now =3D ((ULong)sec1) * 1000000ULL;
+ now +=3D (ULong)(nsec / 1000);
+# else
+
struct vki_timeval tv_now;
- ULong now;
SysRes res;
-
res =3D VG_(do_syscall2)(__NR_gettimeofday, (UWord)&tv_now, (UWord)NU=
LL);
- =20
now =3D tv_now.tv_sec * 1000000ULL + tv_now.tv_usec;
+# endif
=20
if (base =3D=3D 0)
base =3D now;
@@ -465,12 +543,6 @@
return (now - base) / 1000;
}
=20
-
-void VG_(nanosleep)(struct vki_timespec *ts)
-{
- (void)VG_(do_syscall2)(__NR_nanosleep, (UWord)ts, (UWord)NULL);
-}
-
/* ---------------------------------------------------------------------
A trivial atfork() facility for Valgrind's internal use
------------------------------------------------------------------ */
Modified: trunk/coregrind/pub_core_libcproc.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
--- trunk/coregrind/pub_core_libcproc.h 2006-10-17 02:15:17 UTC (rev 6294=
)
+++ trunk/coregrind/pub_core_libcproc.h 2006-10-17 02:16:44 UTC (rev 6295=
)
@@ -76,7 +76,6 @@
extern Char **VG_(env_clone) ( Char **env_clone );
=20
// misc
-extern void VG_(nanosleep) ( struct vki_timespec * );
extern Int VG_(getgroups)( Int size, UInt* list );
extern Int VG_(ptrace)( Int request, Int pid, void *addr, void *data );
extern Int VG_(fork)( void );
|
|
From: <sv...@va...> - 2006-10-17 02:15:22
|
Author: sewardj
Date: 2006-10-17 03:15:17 +0100 (Tue, 17 Oct 2006)
New Revision: 6294
Log:
Track SysRes change.
Modified:
trunk/cachegrind/cg_main.c
trunk/callgrind/command.c
trunk/callgrind/dump.c
trunk/coregrind/m_commandline.c
trunk/coregrind/m_coredump/coredump-elf.c
trunk/coregrind/m_transtab.c
trunk/massif/ms_main.c
Modified: trunk/cachegrind/cg_main.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
--- trunk/cachegrind/cg_main.c 2006-10-17 02:11:55 UTC (rev 6293)
+++ trunk/cachegrind/cg_main.c 2006-10-17 02:15:17 UTC (rev 6294)
@@ -1002,7 +1002,7 @@
" ... so simulation results will be missing.");
return;
} else {
- fd =3D sres.val;
+ fd =3D sres.res;
}
=20
// "desc:" lines (giving I1/D1/L2 cache configuration). The spaces a=
fter
@@ -1347,7 +1347,7 @@
VG_(details_copyright_author)(
"Copyright (C) 2002-2006, and GNU GPL'd, by Nicholas Nethercote et=
al.");
VG_(details_bug_reports_to) (VG_BUGS_TO);
- VG_(details_avg_translation_sizeB) ( 245 );
+ VG_(details_avg_translation_sizeB) ( 500 );
=20
VG_(basic_tool_funcs) (cg_post_clo_init,
cg_instrument,
Modified: trunk/callgrind/command.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
--- trunk/callgrind/command.c 2006-10-17 02:11:55 UTC (rev 6293)
+++ trunk/callgrind/command.c 2006-10-17 02:15:17 UTC (rev 6294)
@@ -124,7 +124,7 @@
}
}
if (!res.isError)
- fd =3D (Int) res.val;
+ fd =3D (Int) res.res;
if (fd>=3D0) {
Char buf[512];
Int i;
@@ -196,7 +196,7 @@
* to not confuse it with our special value -2
*/
if (res.isError) fd =3D -1;
- else fd =3D (Int) res.val;
+ else fd =3D (Int) res.res;
=20
return fd;
}
@@ -403,7 +403,7 @@
=20
res =3D VG_(open)(current_command_file, VKI_O_RDONLY,0);
if (!res.isError) {
- fd =3D (Int) res.val;
+ fd =3D (Int) res.res;
bytesRead =3D VG_(read)(fd,cmdBuffer,500);
cmdBuffer[500] =3D 0; /* no command overrun please */
VG_(close)(fd);
Modified: trunk/callgrind/dump.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
--- trunk/callgrind/dump.c 2006-10-17 02:11:55 UTC (rev 6293)
+++ trunk/callgrind/dump.c 2006-10-17 02:15:17 UTC (rev 6294)
@@ -1299,7 +1299,7 @@
file_err();
}
}
- fd =3D (Int) res.val;
+ fd =3D (Int) res.res;
=20
CLG_DEBUG(2, " new_dumpfile '%s'\n", filename);
=20
@@ -1557,7 +1557,7 @@
=20
p++;
}
- =20
+
close_dumpfile(print_buf, print_fd, CLG_(current_tid));
if (array) VG_(free)(array);
=20
@@ -1608,7 +1608,6 @@
=20
print_bbccs(trigger, only_current_thread);
=20
-
bbs_done =3D CLG_(stat).bb_executions++;
=20
if (VG_(clo_verbosity) > 1)
@@ -1723,7 +1722,7 @@
file_err();=20
}
}
- if (!res.isError) VG_(close)( (Int)res.val );
+ if (!res.isError) VG_(close)( (Int)res.res );
=20
init_cmdbuf();
=20
Modified: trunk/coregrind/m_commandline.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
--- trunk/coregrind/m_commandline.c 2006-10-17 02:11:55 UTC (rev 6293)
+++ trunk/coregrind/m_commandline.c 2006-10-17 02:15:17 UTC (rev 6294)
@@ -81,16 +81,16 @@
( NULL =3D=3D dir ? "" : dir ) );
fd =3D VG_(open)(filename, 0, VKI_S_IRUSR);
if ( !fd.isError ) {
- size =3D VG_(fsize)(fd.val);
+ size =3D VG_(fsize)(fd.res);
if (size > 0) {
f_clo =3D VG_(malloc)(size+1);
vg_assert(f_clo);
- n =3D VG_(read)(fd.val, f_clo, size);
+ n =3D VG_(read)(fd.res, f_clo, size);
if (n =3D=3D -1) n =3D 0;
vg_assert(n >=3D 0 && n <=3D size+1);
f_clo[n] =3D '\0';
}
- VG_(close)(fd.val);
+ VG_(close)(fd.res);
}
return f_clo;
}
Modified: trunk/coregrind/m_coredump/coredump-elf.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
--- trunk/coregrind/m_coredump/coredump-elf.c 2006-10-17 02:11:55 UTC (re=
v 6293)
+++ trunk/coregrind/m_coredump/coredump-elf.c 2006-10-17 02:15:17 UTC (re=
v 6294)
@@ -290,7 +290,7 @@
Char *coreext =3D "";
Int seq =3D 0;
Int core_fd;
- NSegment *seg;
+ NSegment const * seg;
ESZ(Ehdr) ehdr;
ESZ(Phdr) *phdrs;
Int num_phdrs;
@@ -323,11 +323,11 @@
VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_TRUNC,=20
VKI_S_IRUSR|VKI_S_IWUSR);
if (!sres.isError) {
- core_fd =3D sres.val;
+ core_fd =3D sres.res;
break;
}
=20
- if (sres.isError && sres.val !=3D VKI_EEXIST)
+ if (sres.isError && sres.err !=3D VKI_EEXIST)
return; /* can't create file */
}
=20
Modified: trunk/coregrind/m_transtab.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
--- trunk/coregrind/m_transtab.c 2006-10-17 02:11:55 UTC (rev 6293)
+++ trunk/coregrind/m_transtab.c 2006-10-17 02:15:17 UTC (rev 6294)
@@ -667,7 +667,7 @@
8 * tc_sector_szQ );
/*NOTREACHED*/
}
- sec->tc =3D (ULong*)sres.val;
+ sec->tc =3D (ULong*)sres.res;
=20
sres =3D VG_(am_mmap_anon_float_valgrind)
( N_TTES_PER_SECTOR * sizeof(TTEntry) );
@@ -676,7 +676,7 @@
N_TTES_PER_SECTOR * sizeof(TTEntry)=
);
/*NOTREACHED*/
}
- sec->tt =3D (TTEntry*)sres.val;
+ sec->tt =3D (TTEntry*)sres.res;
=20
for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
sec->tt[i].status =3D Empty;
@@ -791,8 +791,10 @@
=20
vg_assert(init_done);
vg_assert(vge->n_used >=3D 1 && vge->n_used <=3D 3);
- vg_assert(code_len > 0 && code_len < 20000);
=20
+ /* 60000: should agree with N_TMPBUF in m_translate.c. */
+ vg_assert(code_len > 0 && code_len < 60000);
+
if (0)
VG_(printf)("add_to_transtab(entry =3D 0x%llx, len =3D %d)\n",
entry, code_len);
@@ -1262,7 +1264,7 @@
VG_(out_of_memory_NORETURN)("init_unredir_tt_tc", N_UNREDIR_TT =
* UNREDIR_SZB);
/*NOTREACHED*/
}
- unredir_tc =3D (ULong *)sres.val;
+ unredir_tc =3D (ULong *)sres.res;
}
unredir_tc_used =3D 0;
for (i =3D 0; i < N_UNREDIR_TT; i++)
@@ -1402,7 +1404,7 @@
=20
/* Ensure the calculated value is not way crazy. */
vg_assert(tc_sector_szQ >=3D 2 * N_TTES_PER_SECTOR_USABLE);
- vg_assert(tc_sector_szQ <=3D 50 * N_TTES_PER_SECTOR_USABLE);
+ vg_assert(tc_sector_szQ <=3D 80 * N_TTES_PER_SECTOR_USABLE);
=20
/* Initialise the sectors */
youngest_sector =3D 0;
Modified: trunk/massif/ms_main.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
--- trunk/massif/ms_main.c 2006-10-17 02:11:55 UTC (rev 6293)
+++ trunk/massif/ms_main.c 2006-10-17 02:15:17 UTC (rev 6294)
@@ -1288,7 +1288,7 @@
file_err( hp_file );
return;
} else {
- fd =3D sres.val;
+ fd =3D sres.res;
}
=20
// File header, including command line
@@ -1601,7 +1601,7 @@
file_err( text_file );
return;
} else {
- fd =3D sres.val;
+ fd =3D sres.res;
}
=20
// Header
|
|
From: Tom H. <th...@cy...> - 2006-10-17 02:13:42
|
Nightly build on lloyd ( x86_64, Fedora Core 3 ) started at 2006-10-17 03:05:04 BST
Results differ from 24 hours ago
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... failed
Last 20 lines of verbose log follow echo
make[2]: Entering directory `/tmp/valgrind.20203/valgrind/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/valgrind.20203/valgrind/include'
Making all in coregrind
make[2]: Entering directory `/tmp/valgrind.20203/valgrind/coregrind'
make all-am
make[3]: Entering directory `/tmp/valgrind.20203/valgrind/coregrind'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../coregrind -I.. -I../coregrind/x86 -I../coregrind/linux -I../coregrind/x86-linux -I../include -I../VEX/pub -DVG_PLATFORM="\"x86-linux\"" -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1 -DVG_LIBDIR="\"/tmp/valgrind.20203/Inst/lib/valgrind"\" -m32 -O -g -Wmissing-prototypes -Winline -Wall -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-long-long -Wdeclaration-after-statement -MT libcoregrind_x86_linux_a-m_commandline.o -MD -MP -MF ".deps/libcoregrind_x86_linux_a-m_commandline.Tpo" -c -o libcoregrind_x86_linux_a-m_commandline.o `test -f 'm_commandline.c' || echo './'`m_commandline.c; \
then mv -f ".deps/libcoregrind_x86_linux_a-m_commandline.Tpo" ".deps/libcoregrind_x86_linux_a-m_commandline.Po"; else rm -f ".deps/libcoregrind_x86_linux_a-m_commandline.Tpo"; exit 1; fi
m_commandline.c: In function `read_dot_valgrindrc':
m_commandline.c:84: error: structure has no member named `val'
m_commandline.c:88: error: structure has no member named `val'
m_commandline.c:93: error: structure has no member named `val'
make[3]: *** [libcoregrind_x86_linux_a-m_commandline.o] Error 1
make[3]: Leaving directory `/tmp/valgrind.20203/valgrind/coregrind'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/valgrind.20203/valgrind/coregrind'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/valgrind.20203/valgrind'
make: *** [all] Error 2
=================================================
== Results from 24 hours ago ==
=================================================
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... failed
Regression test results follow
== 274 tests, 214 stderr failures, 100 stdout failures, 0 posttest failures ==
memcheck/tests/addressable (stdout)
memcheck/tests/addressable (stderr)
memcheck/tests/amd64/bt_everything (stdout)
memcheck/tests/amd64/bt_everything (stderr)
memcheck/tests/amd64/bug132146 (stdout)
memcheck/tests/amd64/bug132146 (stderr)
memcheck/tests/amd64/insn_basic (stdout)
memcheck/tests/amd64/insn_basic (stderr)
memcheck/tests/amd64/insn_fpu (stdout)
memcheck/tests/amd64/insn_fpu (stderr)
memcheck/tests/amd64/insn_mmx (stdout)
memcheck/tests/amd64/insn_mmx (stderr)
memcheck/tests/amd64/insn_sse (stdout)
memcheck/tests/amd64/insn_sse (stderr)
memcheck/tests/amd64/insn_sse2 (stdout)
memcheck/tests/amd64/insn_sse2 (stderr)
memcheck/tests/amd64/more_x87_fp (stdout)
memcheck/tests/amd64/more_x87_fp (stderr)
memcheck/tests/amd64/sse_memory (stdout)
memcheck/tests/amd64/sse_memory (stderr)
memcheck/tests/badaddrvalue (stdout)
memcheck/tests/badaddrvalue (stderr)
memcheck/tests/badfree-2trace (stderr)
memcheck/tests/badfree (stderr)
memcheck/tests/badjump (stderr)
memcheck/tests/badjump2 (stderr)
memcheck/tests/badloop (stderr)
memcheck/tests/badpoll (stderr)
memcheck/tests/badrw (stderr)
memcheck/tests/brk (stderr)
memcheck/tests/brk2 (stderr)
memcheck/tests/buflen_check (stderr)
memcheck/tests/clientperm (stdout)
memcheck/tests/clientperm (stderr)
memcheck/tests/custom_alloc (stderr)
memcheck/tests/deep_templates (stdout)
memcheck/tests/deep_templates (stderr)
memcheck/tests/describe-block (stderr)
memcheck/tests/doublefree (stderr)
memcheck/tests/erringfds (stdout)
memcheck/tests/erringfds (stderr)
memcheck/tests/error_counts (stdout)
memcheck/tests/errs1 (stderr)
memcheck/tests/execve (stderr)
memcheck/tests/execve2 (stderr)
memcheck/tests/exitprog (stderr)
memcheck/tests/fprw (stderr)
memcheck/tests/fwrite (stderr)
memcheck/tests/inits (stderr)
memcheck/tests/inline (stdout)
memcheck/tests/inline (stderr)
memcheck/tests/leak-0 (stderr)
memcheck/tests/leak-cycle (stderr)
memcheck/tests/leak-pool-0 (stderr)
memcheck/tests/leak-pool-1 (stderr)
memcheck/tests/leak-pool-2 (stderr)
memcheck/tests/leak-pool-3 (stderr)
memcheck/tests/leak-pool-4 (stderr)
memcheck/tests/leak-pool-5 (stderr)
memcheck/tests/leak-regroot (stderr)
memcheck/tests/leak-tree (stderr)
memcheck/tests/leakotron (stdout)
memcheck/tests/malloc1 (stderr)
memcheck/tests/malloc2 (stderr)
memcheck/tests/malloc3 (stdout)
memcheck/tests/malloc3 (stderr)
memcheck/tests/malloc_usable (stderr)
memcheck/tests/manuel1 (stdout)
memcheck/tests/manuel1 (stderr)
memcheck/tests/manuel2 (stdout)
memcheck/tests/manuel2 (stderr)
memcheck/tests/manuel3 (stderr)
memcheck/tests/match-overrun (stderr)
memcheck/tests/memalign2 (stderr)
memcheck/tests/memalign_test (stderr)
memcheck/tests/memcmptest (stdout)
memcheck/tests/memcmptest (stderr)
memcheck/tests/mempool (stderr)
memcheck/tests/metadata (stdout)
memcheck/tests/metadata (stderr)
memcheck/tests/mismatches (stderr)
memcheck/tests/mmaptest (stderr)
memcheck/tests/nanoleak (stderr)
memcheck/tests/nanoleak_supp (stderr)
memcheck/tests/new_nothrow (stderr)
memcheck/tests/new_override (stdout)
memcheck/tests/new_override (stderr)
memcheck/tests/null_socket (stderr)
memcheck/tests/oset_test (stdout)
memcheck/tests/oset_test (stderr)
memcheck/tests/overlap (stdout)
memcheck/tests/overlap (stderr)
memcheck/tests/partial_load_dflt (stderr)
memcheck/tests/partial_load_ok (stderr)
memcheck/tests/partiallydefinedeq (stdout)
memcheck/tests/partiallydefinedeq (stderr)
memcheck/tests/pdb-realloc (stderr)
memcheck/tests/pdb-realloc2 (stdout)
memcheck/tests/pdb-realloc2 (stderr)
memcheck/tests/pipe (stderr)
memcheck/tests/pointer-trace (stderr)
memcheck/tests/post-syscall (stdout)
memcheck/tests/post-syscall (stderr)
memcheck/tests/realloc1 (stderr)
memcheck/tests/realloc2 (stderr)
memcheck/tests/realloc3 (stderr)
memcheck/tests/sh-mem-random (stdout)
memcheck/tests/sh-mem-random (stderr)
memcheck/tests/sh-mem (stderr)
memcheck/tests/sigaltstack (stderr)
memcheck/tests/sigkill (stderr)
memcheck/tests/signal2 (stdout)
memcheck/tests/signal2 (stderr)
memcheck/tests/sigprocmask (stderr)
memcheck/tests/stack_changes (stdout)
memcheck/tests/stack_changes (stderr)
memcheck/tests/stack_switch (stderr)
memcheck/tests/str_tester (stderr)
memcheck/tests/strchr (stderr)
memcheck/tests/supp1 (stderr)
memcheck/tests/supp2 (stderr)
memcheck/tests/supp_unknown (stderr)
memcheck/tests/suppfree (stderr)
memcheck/tests/toobig-allocs (stderr)
memcheck/tests/trivialleak (stderr)
memcheck/tests/vcpu_bz2 (stdout)
memcheck/tests/vcpu_bz2 (stderr)
memcheck/tests/vcpu_fbench (stdout)
memcheck/tests/vcpu_fbench (stderr)
memcheck/tests/vcpu_fnfns (stdout)
memcheck/tests/vcpu_fnfns (stderr)
memcheck/tests/with-space (stdout)
memcheck/tests/with-space (stderr)
memcheck/tests/wrap1 (stdout)
memcheck/tests/wrap1 (stderr)
memcheck/tests/wrap2 (stdout)
memcheck/tests/wrap2 (stderr)
memcheck/tests/wrap3 (stdout)
memcheck/tests/wrap3 (stderr)
memcheck/tests/wrap4 (stdout)
memcheck/tests/wrap4 (stderr)
memcheck/tests/wrap5 (stdout)
memcheck/tests/wrap5 (stderr)
memcheck/tests/wrap6 (stdout)
memcheck/tests/wrap6 (stderr)
memcheck/tests/wrap7 (stdout)
memcheck/tests/wrap7 (stderr)
memcheck/tests/wrap8 (stdout)
memcheck/tests/wrap8 (stderr)
memcheck/tests/writev (stderr)
memcheck/tests/x86/scalar (stderr)
memcheck/tests/x86/scalar_supp (stderr)
memcheck/tests/xml1 (stdout)
memcheck/tests/xml1 (stderr)
memcheck/tests/zeropage (stdout)
memcheck/tests/zeropage (stderr)
cachegrind/tests/chdir (stderr)
cachegrind/tests/clreq (stderr)
cachegrind/tests/dlclose (stdout)
cachegrind/tests/dlclose (stderr)
cachegrind/tests/wrap5 (stdout)
cachegrind/tests/wrap5 (stderr)
callgrind/tests/clreq (stderr)
callgrind/tests/simwork1 (stdout)
callgrind/tests/simwork1 (stderr)
callgrind/tests/simwork2 (stdout)
callgrind/tests/simwork2 (stderr)
callgrind/tests/simwork3 (stdout)
callgrind/tests/simwork3 (stderr)
callgrind/tests/threads (stderr)
massif/tests/basic_malloc (stderr)
massif/tests/toobig-allocs (stderr)
massif/tests/true_html (stderr)
massif/tests/true_text (stderr)
lackey/tests/true (stderr)
none/tests/amd64/bug127521-64 (stdout)
none/tests/amd64/bug127521-64 (stderr)
none/tests/amd64/bug132813-amd64 (stdout)
none/tests/amd64/bug132813-amd64 (stderr)
none/tests/amd64/bug132918 (stdout)
none/tests/amd64/bug132918 (stderr)
none/tests/amd64/clc (stdout)
none/tests/amd64/clc (stderr)
none/tests/amd64/fcmovnu (stdout)
none/tests/amd64/fcmovnu (stderr)
none/tests/amd64/fxtract (stdout)
none/tests/amd64/fxtract (stderr)
none/tests/amd64/insn_basic (stdout)
none/tests/amd64/insn_basic (stderr)
none/tests/amd64/insn_fpu (stdout)
none/tests/amd64/insn_fpu (stderr)
none/tests/amd64/insn_mmx (stdout)
none/tests/amd64/insn_mmx (stderr)
none/tests/amd64/insn_sse (stdout)
none/tests/amd64/insn_sse (stderr)
none/tests/amd64/insn_sse2 (stdout)
none/tests/amd64/insn_sse2 (stderr)
none/tests/amd64/jrcxz (stdout)
none/tests/amd64/jrcxz (stderr)
none/tests/amd64/looper (stdout)
none/tests/amd64/looper (stderr)
none/tests/amd64/nibz_bennee_mmap (stdout)
none/tests/amd64/nibz_bennee_mmap (stderr)
none/tests/amd64/shrld (stdout)
none/tests/amd64/shrld (stderr)
none/tests/amd64/smc1 (stdout)
none/tests/amd64/smc1 (stderr)
none/tests/ansi (stderr)
none/tests/args (stdout)
none/tests/args (stderr)
none/tests/async-sigs (stdout)
none/tests/async-sigs (stderr)
none/tests/bitfield1 (stderr)
none/tests/blockfault (stderr)
none/tests/bug129866 (stdout)
none/tests/bug129866 (stderr)
none/tests/closeall (stderr)
none/tests/cmdline2 (stdout)
none/tests/coolo_sigaction (stdout)
none/tests/coolo_sigaction (stderr)
none/tests/coolo_strlen (stderr)
none/tests/discard (stdout)
none/tests/discard (stderr)
none/tests/exec-sigmask (stderr)
none/tests/execve (stderr)
none/tests/faultstatus (stderr)
none/tests/fcntl_setown (stderr)
none/tests/fdleak_cmsg (stderr)
none/tests/fdleak_creat (stderr)
none/tests/fdleak_dup (stderr)
none/tests/fdleak_dup2 (stderr)
none/tests/fdleak_fcntl (stderr)
none/tests/fdleak_ipv4 (stdout)
none/tests/fdleak_ipv4 (stderr)
none/tests/fdleak_open (stderr)
none/tests/fdleak_pipe (stderr)
none/tests/fdleak_socketpair (stderr)
none/tests/floored (stdout)
none/tests/floored (stderr)
none/tests/fork (stdout)
none/tests/fork (stderr)
none/tests/fucomip (stderr)
none/tests/gxx304 (stderr)
none/tests/manythreads (stdout)
none/tests/manythreads (stderr)
none/tests/map_unaligned (stderr)
none/tests/map_unmap (stdout)
none/tests/map_unmap (stderr)
none/tests/mq (stderr)
none/tests/mremap (stderr)
none/tests/mremap2 (stdout)
none/tests/mremap2 (stderr)
none/tests/munmap_exe (stderr)
none/tests/nestedfns (stdout)
none/tests/nestedfns (stderr)
none/tests/pending (stdout)
none/tests/pending (stderr)
none/tests/pth_atfork1 (stdout)
none/tests/pth_atfork1 (stderr)
none/tests/pth_blockedsig (stdout)
none/tests/pth_blockedsig (stderr)
none/tests/pth_cancel1 (stdout)
none/tests/pth_cancel1 (stderr)
none/tests/pth_cancel2 (stderr)
none/tests/pth_cvsimple (stdout)
none/tests/pth_cvsimple (stderr)
none/tests/pth_empty (stderr)
none/tests/pth_exit (stderr)
none/tests/pth_exit2 (stderr)
none/tests/pth_mutexspeed (stdout)
none/tests/pth_mutexspeed (stderr)
none/tests/pth_once (stdout)
none/tests/pth_once (stderr)
none/tests/pth_rwlock (stderr)
none/tests/pth_stackalign (stdout)
none/tests/pth_stackalign (stderr)
none/tests/rcrl (stdout)
none/tests/rcrl (stderr)
none/tests/readline1 (stdout)
none/tests/readline1 (stderr)
none/tests/res_search (stdout)
none/tests/res_search (stderr)
none/tests/resolv (stdout)
none/tests/resolv (stderr)
none/tests/rlimit_nofile (stderr)
none/tests/sem (stderr)
none/tests/semlimit (stderr)
none/tests/sha1_test (stderr)
none/tests/shell (stdout)
none/tests/shell (stderr)
none/tests/shell_valid1 (stderr)
none/tests/shell_valid2 (stderr)
none/tests/shell_valid3 (stderr)
none/tests/shortpush (stderr)
none/tests/shorts (stderr)
none/tests/sigstackgrowth (stdout)
none/tests/sigstackgrowth (stderr)
none/tests/stackgrowth (stdout)
none/tests/stackgrowth (stderr)
none/tests/syscall-restart1 (stderr)
none/tests/syscall-restart2 (stderr)
none/tests/system (stderr)
none/tests/thread-exits (stdout)
none/tests/thread-exits (stderr)
none/tests/threaded-fork (stdout)
none/tests/threaded-fork (stderr)
none/tests/threadederrno (stdout)
none/tests/threadederrno (stderr)
none/tests/tls (stdout)
none/tests/tls (stderr)
none/tests/vgprintf (stdout)
none/tests/vgprintf (stderr)
none/tests/x86/smc1 (stdout)
none/tests/x86/smc1 (stderr)
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short Tue Oct 17 03:10:30 2006
--- new.short Tue Oct 17 03:13:26 2006
***************
*** 3,324 ****
Configuring valgrind ... done
! Building valgrind ... done
! Running regression tests ... failed
!
! Regression test results follow
!
! == 274 tests, 214 stderr failures, 100 stdout failures, 0 posttest failures ==
! memcheck/tests/addressable (stdout)
! memcheck/tests/addressable (stderr)
! memcheck/tests/amd64/bt_everything (stdout)
! memcheck/tests/amd64/bt_everything (stderr)
! memcheck/tests/amd64/bug132146 (stdout)
! memcheck/tests/amd64/bug132146 (stderr)
! memcheck/tests/amd64/insn_basic (stdout)
! memcheck/tests/amd64/insn_basic (stderr)
! memcheck/tests/amd64/insn_fpu (stdout)
! memcheck/tests/amd64/insn_fpu (stderr)
! memcheck/tests/amd64/insn_mmx (stdout)
! memcheck/tests/amd64/insn_mmx (stderr)
! memcheck/tests/amd64/insn_sse (stdout)
! memcheck/tests/amd64/insn_sse (stderr)
! memcheck/tests/amd64/insn_sse2 (stdout)
! memcheck/tests/amd64/insn_sse2 (stderr)
! memcheck/tests/amd64/more_x87_fp (stdout)
! memcheck/tests/amd64/more_x87_fp (stderr)
! memcheck/tests/amd64/sse_memory (stdout)
! memcheck/tests/amd64/sse_memory (stderr)
! memcheck/tests/badaddrvalue (stdout)
! memcheck/tests/badaddrvalue (stderr)
! memcheck/tests/badfree-2trace (stderr)
! memcheck/tests/badfree (stderr)
! memcheck/tests/badjump (stderr)
! memcheck/tests/badjump2 (stderr)
! memcheck/tests/badloop (stderr)
! memcheck/tests/badpoll (stderr)
! memcheck/tests/badrw (stderr)
! memcheck/tests/brk (stderr)
! memcheck/tests/brk2 (stderr)
! memcheck/tests/buflen_check (stderr)
! memcheck/tests/clientperm (stdout)
! memcheck/tests/clientperm (stderr)
! memcheck/tests/custom_alloc (stderr)
! memcheck/tests/deep_templates (stdout)
! memcheck/tests/deep_templates (stderr)
! memcheck/tests/describe-block (stderr)
! memcheck/tests/doublefree (stderr)
! memcheck/tests/erringfds (stdout)
! memcheck/tests/erringfds (stderr)
! memcheck/tests/error_counts (stdout)
! memcheck/tests/errs1 (stderr)
! memcheck/tests/execve (stderr)
! memcheck/tests/execve2 (stderr)
! memcheck/tests/exitprog (stderr)
! memcheck/tests/fprw (stderr)
! memcheck/tests/fwrite (stderr)
! memcheck/tests/inits (stderr)
! memcheck/tests/inline (stdout)
! memcheck/tests/inline (stderr)
! memcheck/tests/leak-0 (stderr)
! memcheck/tests/leak-cycle (stderr)
! memcheck/tests/leak-pool-0 (stderr)
! memcheck/tests/leak-pool-1 (stderr)
! memcheck/tests/leak-pool-2 (stderr)
! memcheck/tests/leak-pool-3 (stderr)
! memcheck/tests/leak-pool-4 (stderr)
! memcheck/tests/leak-pool-5 (stderr)
! memcheck/tests/leak-regroot (stderr)
! memcheck/tests/leak-tree (stderr)
! memcheck/tests/leakotron (stdout)
! memcheck/tests/malloc1 (stderr)
! memcheck/tests/malloc2 (stderr)
! memcheck/tests/malloc3 (stdout)
! memcheck/tests/malloc3 (stderr)
! memcheck/tests/malloc_usable (stderr)
! memcheck/tests/manuel1 (stdout)
! memcheck/tests/manuel1 (stderr)
! memcheck/tests/manuel2 (stdout)
! memcheck/tests/manuel2 (stderr)
! memcheck/tests/manuel3 (stderr)
! memcheck/tests/match-overrun (stderr)
! memcheck/tests/memalign2 (stderr)
! memcheck/tests/memalign_test (stderr)
! memcheck/tests/memcmptest (stdout)
! memcheck/tests/memcmptest (stderr)
! memcheck/tests/mempool (stderr)
! memcheck/tests/metadata (stdout)
! memcheck/tests/metadata (stderr)
! memcheck/tests/mismatches (stderr)
! memcheck/tests/mmaptest (stderr)
! memcheck/tests/nanoleak (stderr)
! memcheck/tests/nanoleak_supp (stderr)
! memcheck/tests/new_nothrow (stderr)
! memcheck/tests/new_override (stdout)
! memcheck/tests/new_override (stderr)
! memcheck/tests/null_socket (stderr)
! memcheck/tests/oset_test (stdout)
! memcheck/tests/oset_test (stderr)
! memcheck/tests/overlap (stdout)
! memcheck/tests/overlap (stderr)
! memcheck/tests/partial_load_dflt (stderr)
! memcheck/tests/partial_load_ok (stderr)
! memcheck/tests/partiallydefinedeq (stdout)
! memcheck/tests/partiallydefinedeq (stderr)
! memcheck/tests/pdb-realloc (stderr)
! memcheck/tests/pdb-realloc2 (stdout)
! memcheck/tests/pdb-realloc2 (stderr)
! memcheck/tests/pipe (stderr)
! memcheck/tests/pointer-trace (stderr)
! memcheck/tests/post-syscall (stdout)
! memcheck/tests/post-syscall (stderr)
! memcheck/tests/realloc1 (stderr)
! memcheck/tests/realloc2 (stderr)
! memcheck/tests/realloc3 (stderr)
! memcheck/tests/sh-mem-random (stdout)
! memcheck/tests/sh-mem-random (stderr)
! memcheck/tests/sh-mem (stderr)
! memcheck/tests/sigaltstack (stderr)
! memcheck/tests/sigkill (stderr)
! memcheck/tests/signal2 (stdout)
! memcheck/tests/signal2 (stderr)
! memcheck/tests/sigprocmask (stderr)
! memcheck/tests/stack_changes (stdout)
! memcheck/tests/stack_changes (stderr)
! memcheck/tests/stack_switch (stderr)
! memcheck/tests/str_tester (stderr)
! memcheck/tests/strchr (stderr)
! memcheck/tests/supp1 (stderr)
! memcheck/tests/supp2 (stderr)
! memcheck/tests/supp_unknown (stderr)
! memcheck/tests/suppfree (stderr)
! memcheck/tests/toobig-allocs (stderr)
! memcheck/tests/trivialleak (stderr)
! memcheck/tests/vcpu_bz2 (stdout)
! memcheck/tests/vcpu_bz2 (stderr)
! memcheck/tests/vcpu_fbench (stdout)
! memcheck/tests/vcpu_fbench (stderr)
! memcheck/tests/vcpu_fnfns (stdout)
! memcheck/tests/vcpu_fnfns (stderr)
! memcheck/tests/with-space (stdout)
! memcheck/tests/with-space (stderr)
! memcheck/tests/wrap1 (stdout)
! memcheck/tests/wrap1 (stderr)
! memcheck/tests/wrap2 (stdout)
! memcheck/tests/wrap2 (stderr)
! memcheck/tests/wrap3 (stdout)
! memcheck/tests/wrap3 (stderr)
! memcheck/tests/wrap4 (stdout)
! memcheck/tests/wrap4 (stderr)
! memcheck/tests/wrap5 (stdout)
! memcheck/tests/wrap5 (stderr)
! memcheck/tests/wrap6 (stdout)
! memcheck/tests/wrap6 (stderr)
! memcheck/tests/wrap7 (stdout)
! memcheck/tests/wrap7 (stderr)
! memcheck/tests/wrap8 (stdout)
! memcheck/tests/wrap8 (stderr)
! memcheck/tests/writev (stderr)
! memcheck/tests/x86/scalar (stderr)
! memcheck/tests/x86/scalar_supp (stderr)
! memcheck/tests/xml1 (stdout)
! memcheck/tests/xml1 (stderr)
! memcheck/tests/zeropage (stdout)
! memcheck/tests/zeropage (stderr)
! cachegrind/tests/chdir (stderr)
! cachegrind/tests/clreq (stderr)
! cachegrind/tests/dlclose (stdout)
! cachegrind/tests/dlclose (stderr)
! cachegrind/tests/wrap5 (stdout)
! cachegrind/tests/wrap5 (stderr)
! callgrind/tests/clreq (stderr)
! callgrind/tests/simwork1 (stdout)
! callgrind/tests/simwork1 (stderr)
! callgrind/tests/simwork2 (stdout)
! callgrind/tests/simwork2 (stderr)
! callgrind/tests/simwork3 (stdout)
! callgrind/tests/simwork3 (stderr)
! callgrind/tests/threads (stderr)
! massif/tests/basic_malloc (stderr)
! massif/tests/toobig-allocs (stderr)
! massif/tests/true_html (stderr)
! massif/tests/true_text (stderr)
! lackey/tests/true (stderr)
! none/tests/amd64/bug127521-64 (stdout)
! none/tests/amd64/bug127521-64 (stderr)
! none/tests/amd64/bug132813-amd64 (stdout)
! none/tests/amd64/bug132813-amd64 (stderr)
! none/tests/amd64/bug132918 (stdout)
! none/tests/amd64/bug132918 (stderr)
! none/tests/amd64/clc (stdout)
! none/tests/amd64/clc (stderr)
! none/tests/amd64/fcmovnu (stdout)
! none/tests/amd64/fcmovnu (stderr)
! none/tests/amd64/fxtract (stdout)
! none/tests/amd64/fxtract (stderr)
! none/tests/amd64/insn_basic (stdout)
! none/tests/amd64/insn_basic (stderr)
! none/tests/amd64/insn_fpu (stdout)
! none/tests/amd64/insn_fpu (stderr)
! none/tests/amd64/insn_mmx (stdout)
! none/tests/amd64/insn_mmx (stderr)
! none/tests/amd64/insn_sse (stdout)
! none/tests/amd64/insn_sse (stderr)
! none/tests/amd64/insn_sse2 (stdout)
! none/tests/amd64/insn_sse2 (stderr)
! none/tests/amd64/jrcxz (stdout)
! none/tests/amd64/jrcxz (stderr)
! none/tests/amd64/looper (stdout)
! none/tests/amd64/looper (stderr)
! none/tests/amd64/nibz_bennee_mmap (stdout)
! none/tests/amd64/nibz_bennee_mmap (stderr)
! none/tests/amd64/shrld (stdout)
! none/tests/amd64/shrld (stderr)
! none/tests/amd64/smc1 (stdout)
! none/tests/amd64/smc1 (stderr)
! none/tests/ansi (stderr)
! none/tests/args (stdout)
! none/tests/args (stderr)
! none/tests/async-sigs (stdout)
! none/tests/async-sigs (stderr)
! none/tests/bitfield1 (stderr)
! none/tests/blockfault (stderr)
! none/tests/bug129866 (stdout)
! none/tests/bug129866 (stderr)
! none/tests/closeall (stderr)
! none/tests/cmdline2 (stdout)
! none/tests/coolo_sigaction (stdout)
! none/tests/coolo_sigaction (stderr)
! none/tests/coolo_strlen (stderr)
! none/tests/discard (stdout)
! none/tests/discard (stderr)
! none/tests/exec-sigmask (stderr)
! none/tests/execve (stderr)
! none/tests/faultstatus (stderr)
! none/tests/fcntl_setown (stderr)
! none/tests/fdleak_cmsg (stderr)
! none/tests/fdleak_creat (stderr)
! none/tests/fdleak_dup (stderr)
! none/tests/fdleak_dup2 (stderr)
! none/tests/fdleak_fcntl (stderr)
! none/tests/fdleak_ipv4 (stdout)
! none/tests/fdleak_ipv4 (stderr)
! none/tests/fdleak_open (stderr)
! none/tests/fdleak_pipe (stderr)
! none/tests/fdleak_socketpair (stderr)
! none/tests/floored (stdout)
! none/tests/floored (stderr)
! none/tests/fork (stdout)
! none/tests/fork (stderr)
! none/tests/fucomip (stderr)
! none/tests/gxx304 (stderr)
! none/tests/manythreads (stdout)
! none/tests/manythreads (stderr)
! none/tests/map_unaligned (stderr)
! none/tests/map_unmap (stdout)
! none/tests/map_unmap (stderr)
! none/tests/mq (stderr)
! none/tests/mremap (stderr)
! none/tests/mremap2 (stdout)
! none/tests/mremap2 (stderr)
! none/tests/munmap_exe (stderr)
! none/tests/nestedfns (stdout)
! none/tests/nestedfns (stderr)
! none/tests/pending (stdout)
! none/tests/pending (stderr)
! none/tests/pth_atfork1 (stdout)
! none/tests/pth_atfork1 (stderr)
! none/tests/pth_blockedsig (stdout)
! none/tests/pth_blockedsig (stderr)
! none/tests/pth_cancel1 (stdout)
! none/tests/pth_cancel1 (stderr)
! none/tests/pth_cancel2 (stderr)
! none/tests/pth_cvsimple (stdout)
! none/tests/pth_cvsimple (stderr)
! none/tests/pth_empty (stderr)
! none/tests/pth_exit (stderr)
! none/tests/pth_exit2 (stderr)
! none/tests/pth_mutexspeed (stdout)
! none/tests/pth_mutexspeed (stderr)
! none/tests/pth_once (stdout)
! none/tests/pth_once (stderr)
! none/tests/pth_rwlock (stderr)
! none/tests/pth_stackalign (stdout)
! none/tests/pth_stackalign (stderr)
! none/tests/rcrl (stdout)
! none/tests/rcrl (stderr)
! none/tests/readline1 (stdout)
! none/tests/readline1 (stderr)
! none/tests/res_search (stdout)
! none/tests/res_search (stderr)
! none/tests/resolv (stdout)
! none/tests/resolv (stderr)
! none/tests/rlimit_nofile (stderr)
! none/tests/sem (stderr)
! none/tests/semlimit (stderr)
! none/tests/sha1_test (stderr)
! none/tests/shell (stdout)
! none/tests/shell (stderr)
! none/tests/shell_valid1 (stderr)
! none/tests/shell_valid2 (stderr)
! none/tests/shell_valid3 (stderr)
! none/tests/shortpush (stderr)
! none/tests/shorts (stderr)
! none/tests/sigstackgrowth (stdout)
! none/tests/sigstackgrowth (stderr)
! none/tests/stackgrowth (stdout)
! none/tests/stackgrowth (stderr)
! none/tests/syscall-restart1 (stderr)
! none/tests/syscall-restart2 (stderr)
! none/tests/system (stderr)
! none/tests/thread-exits (stdout)
! none/tests/thread-exits (stderr)
! none/tests/threaded-fork (stdout)
! none/tests/threaded-fork (stderr)
! none/tests/threadederrno (stdout)
! none/tests/threadederrno (stderr)
! none/tests/tls (stdout)
! none/tests/tls (stderr)
! none/tests/vgprintf (stdout)
! none/tests/vgprintf (stderr)
! none/tests/x86/smc1 (stdout)
! none/tests/x86/smc1 (stderr)
--- 3,26 ----
Configuring valgrind ... done
! Building valgrind ... failed
+ Last 20 lines of verbose log follow echo
+ make[2]: Entering directory `/tmp/valgrind.20203/valgrind/include'
+ make[2]: Nothing to be done for `all'.
+ make[2]: Leaving directory `/tmp/valgrind.20203/valgrind/include'
+ Making all in coregrind
+ make[2]: Entering directory `/tmp/valgrind.20203/valgrind/coregrind'
+ make all-am
+ make[3]: Entering directory `/tmp/valgrind.20203/valgrind/coregrind'
+ if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../coregrind -I.. -I../coregrind/x86 -I../coregrind/linux -I../coregrind/x86-linux -I../include -I../VEX/pub -DVG_PLATFORM="\"x86-linux\"" -DVGA_x86=1 -DVGO_linux=1 -DVGP_x86_linux=1 -DVG_LIBDIR="\"/tmp/valgrind.20203/Inst/lib/valgrind"\" -m32 -O -g -Wmissing-prototypes -Winline -Wall -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-long-long -Wdeclaration-after-statement -MT libcoregrind_x86_linux_a-m_commandline.o -MD -MP -MF ".deps/libcoregrind_x86_linux_a-m_commandline.Tpo" -c -o libcoregrind_x86_linux_a-m_commandline.o `test -f 'm_commandline.c' || echo './'`m_commandline.c; \
+ then mv -f ".deps/libcoregrind_x86_linux_a-m_commandline.Tpo" ".deps/libcoregrind_x86_linux_a-m_commandline.Po"; else rm -f ".deps/libcoregrind_x86_linux_a-m_commandline.Tpo"; exit 1; fi
+ m_commandline.c: In function `read_dot_valgrindrc':
+ m_commandline.c:84: error: structure has no member named `val'
+ m_commandline.c:88: error: structure has no member named `val'
+ m_commandline.c:93: error: structure has no member named `val'
+ make[3]: *** [libcoregrind_x86_linux_a-m_commandline.o] Error 1
+ make[3]: Leaving directory `/tmp/valgrind.20203/valgrind/coregrind'
+ make[2]: *** [all] Error 2
+ make[2]: Leaving directory `/tmp/valgrind.20203/valgrind/coregrind'
+ make[1]: *** [all-recursive] Error 1
+ make[1]: Leaving directory `/tmp/valgrind.20203/valgrind'
+ make: *** [all] Error 2
|
|
From: <sv...@va...> - 2006-10-17 02:12:00
|
Author: sewardj
Date: 2006-10-17 03:11:55 +0100 (Tue, 17 Oct 2006)
New Revision: 6293
Log:
Change authorship.
Modified:
trunk/coregrind/m_hashtable.c
trunk/coregrind/pub_core_hashtable.h
trunk/include/pub_tool_hashtable.h
Modified: trunk/coregrind/m_hashtable.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
--- trunk/coregrind/m_hashtable.c 2006-10-17 02:10:42 UTC (rev 6292)
+++ trunk/coregrind/m_hashtable.c 2006-10-17 02:11:55 UTC (rev 6293)
@@ -7,8 +7,8 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
=20
- Copyright (C) 2000-2006 Julian Seward=20
- js...@ac...
+ Copyright (C) 2005-2006 Nicholas Nethercote
+ nj...@va...
=20
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Modified: trunk/coregrind/pub_core_hashtable.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
--- trunk/coregrind/pub_core_hashtable.h 2006-10-17 02:10:42 UTC (rev 629=
2)
+++ trunk/coregrind/pub_core_hashtable.h 2006-10-17 02:11:55 UTC (rev 629=
3)
@@ -7,8 +7,8 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
=20
- Copyright (C) 2000-2006 Julian Seward
- js...@ac...
+ Copyright (C) 2005-2006 Nicholas Nethercote
+ nj...@va...
=20
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Modified: trunk/include/pub_tool_hashtable.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
--- trunk/include/pub_tool_hashtable.h 2006-10-17 02:10:42 UTC (rev 6292)
+++ trunk/include/pub_tool_hashtable.h 2006-10-17 02:11:55 UTC (rev 6293)
@@ -7,8 +7,8 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
=20
- Copyright (C) 2000-2006 Julian Seward
- js...@ac...
+ Copyright (C) 2005-2006 Nicholas Nethercote
+ nj...@va...
=20
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
|
|
From: <sv...@va...> - 2006-10-17 02:10:49
|
Author: sewardj
Date: 2006-10-17 03:10:42 +0100 (Tue, 17 Oct 2006)
New Revision: 6292
Log:
Final merges from branches/AIX5; mostly tracking of SysRes change.
Modified:
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_main.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
--- trunk/coregrind/m_main.c 2006-10-17 02:08:26 UTC (rev 6291)
+++ trunk/coregrind/m_main.c 2006-10-17 02:10:42 UTC (rev 6292)
@@ -80,6 +80,7 @@
VG_(print_tt_tc_stats)();
VG_(print_scheduler_stats)();
VG_(print_ExeContext_stats)();
+ VG_(print_errormgr_stats)();
=20
// Memory stats
if (VG_(clo_verbosity) > 2) {
@@ -360,6 +361,7 @@
=20
else VG_STR_CLO (arg, "--db-command", VG_(clo_db_command))
else VG_STR_CLO (arg, "--sim-hints", VG_(clo_sim_hints))
+ else VG_BOOL_CLO(arg, "--sym-offsets", VG_(clo_sym_offsets))
=20
else VG_NUM_CLO (arg, "--dump-error", VG_(clo_dump_error))
else VG_NUM_CLO (arg, "--input-fd", VG_(clo_input_fd))
@@ -609,15 +611,15 @@
VKI_O_CREAT|VKI_O_WRONLY|VKI_O_EXCL|VKI_O_T=
RUNC,=20
VKI_S_IRUSR|VKI_S_IWUSR);
if (!sres.isError) {
- tmp_log_fd =3D sres.val;
+ tmp_log_fd =3D sres.res;
break; /* for (;;) */
} else {
// If the file already existed, we try the next name. If=
it
// was some other file error, we give up.
- if (sres.val !=3D VKI_EEXIST) {
+ if (sres.err !=3D VKI_EEXIST) {
VG_(message)(Vg_UserMsg,=20
"Can't create log file '%s' (%s); giving up!",=20
- logfilename, VG_(strerror)(sres.val));
+ logfilename, VG_(strerror)(sres.err));
VG_(err_bad_option)(
"--log-file=3D<file> (didn't work out for some reason.)");
/*NOTREACHED*/
@@ -635,7 +637,7 @@
VKI_O_CREAT|VKI_O_WRONLY|VKI_O_TRUNC,=20
VKI_S_IRUSR|VKI_S_IWUSR);
if (!sres.isError) {
- tmp_log_fd =3D sres.val;
+ tmp_log_fd =3D sres.res;
} else {
VG_(message)(Vg_UserMsg,=20
"Can't create/open log file '%s'; giving up!",=20
@@ -874,7 +876,7 @@
} else {
# define BUF_LEN 256
Char version_buf[BUF_LEN];
- Int n =3D VG_(read) ( fd.val, version_buf, BUF_LEN );
+ Int n =3D VG_(read) ( fd.res, version_buf, BUF_LEN );
vg_assert(n <=3D BUF_LEN);
if (n > 0) {
version_buf[n-1] =3D '\0';
@@ -882,7 +884,7 @@
} else {
VG_(message)(Vg_DebugMsg, " (empty?)");
}
- VG_(close)(fd.val);
+ VG_(close)(fd.res);
# undef BUF_LEN
}
=20
@@ -1657,7 +1659,7 @@
=20
/* show interesting ones to the tool */
for (i =3D 0; i < n_seg_starts; i++) {
- NSegment const*const seg=20
+ NSegment const* seg=20
=3D VG_(am_find_nsegment)( seg_starts[i] );
vg_assert(seg);
if (seg->kind =3D=3D SkFileC || seg->kind =3D=3D SkAnonC) {
@@ -1675,7 +1677,7 @@
VG_(free)( seg_starts );
=20
/* Also do the initial stack permissions. */
- { NSegment const*const seg=20
+ { NSegment const* seg=20
=3D VG_(am_find_nsegment)( ciii.initial_client_SP );
vg_assert(seg);
vg_assert(seg->kind =3D=3D SkAnonC);
@@ -1717,7 +1719,7 @@
// p: setup_client_stack
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Initialise scheduler\n");
- { NSegment const*const seg=20
+ { NSegment const* seg=20
=3D VG_(am_find_nsegment)( ciii.initial_client_SP );
vg_assert(seg);
vg_assert(seg->kind =3D=3D SkAnonC);
@@ -1837,12 +1839,11 @@
=20
vg_assert(VG_(is_running_thread)(tid));
=20
- // XXXXXXXXX REINSTATE
- //vg_assert(tids_schedretcode =3D=3D VgSrc_ExitThread
- // || tids_schedretcode =3D=3D VgSrc_ExitProcess
- // || tids_schedretcode =3D=3D VgSrc_FatalSig );
+ vg_assert(tids_schedretcode =3D=3D VgSrc_ExitThread
+ || tids_schedretcode =3D=3D VgSrc_ExitProcess
+ || tids_schedretcode =3D=3D VgSrc_FatalSig );
=20
- if (1 /*tids_schedretcode =3D=3D VgSrc_ExitThread*/) {
+ if (tids_schedretcode =3D=3D VgSrc_ExitThread) {
=20
// We are the last surviving thread. Right?
vg_assert( VG_(count_living_threads)() =3D=3D 1 );
@@ -1943,8 +1944,8 @@
"VG_(terminate_NORETURN)(tid=3D%lld)\n", (ULong)tid)=
;
=20
switch (tids_schedretcode) {
- case /*VgSrc_ExitThread*/ VgSrc_ExitSyscall: /* the normal way out (=
Linux) */
- // case VgSrc_ExitProcess: /* the normal way out (AIX) */
+ case VgSrc_ExitThread: /* the normal way out (Linux) */
+ case VgSrc_ExitProcess: /* the normal way out (AIX) */
/* Change the application return code to user's return code,
if an error was found */
if (VG_(clo_error_exitcode) > 0=20
|
|
From: <sv...@va...> - 2006-10-17 02:08:34
|
Author: sewardj
Date: 2006-10-17 03:08:26 +0100 (Tue, 17 Oct 2006)
New Revision: 6291
Log:
Merge r6217 (also comment cosmetics):
Use 'ctr' rather than 'lr' for indirect jumps, so as not to trash the
branch predictor(s) for returns from generated code. Makes a big
difference on ppc970 (and POWER4).
Modified:
trunk/coregrind/m_dispatch/dispatch-amd64-linux.S
trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
trunk/coregrind/m_dispatch/dispatch-x86-linux.S
Modified: trunk/coregrind/m_dispatch/dispatch-amd64-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_dispatch/dispatch-amd64-linux.S 2006-10-17 02:05:14=
UTC (rev 6290)
+++ trunk/coregrind/m_dispatch/dispatch-amd64-linux.S 2006-10-17 02:08:26=
UTC (rev 6291)
@@ -1,7 +1,7 @@
=20
/*--------------------------------------------------------------------*/
/*--- The core dispatch loop, for jumping to a code address. ---*/
-/*--- dispatch-amd64.S ---*/
+/*--- dispatch-amd64-linux.S ---*/
/*--------------------------------------------------------------------*/
=20
/*
Modified: trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S 2006-10-17 02:05:14=
UTC (rev 6290)
+++ trunk/coregrind/m_dispatch/dispatch-ppc32-linux.S 2006-10-17 02:08:26=
UTC (rev 6291)
@@ -1,7 +1,7 @@
=20
/*--------------------------------------------------------------------*/
/*--- The core dispatch loop, for jumping to a code address. ---*/
-/*--- dispatch-ppc32.S ---*/
+/*--- dispatch-ppc32-linux.S ---*/
/*--------------------------------------------------------------------*/
=20
/*
@@ -275,10 +275,10 @@
/* Found a match. Call tce[1], which is 8 bytes along, since
each tce element is a 64-bit int. */
addi 8,5,8
- mtlr 8
+ mtctr 8
=20
/* run the translation */
- blrl
+ bctrl
=20
/* On return from guest code:
r3 holds destination (original) address.
@@ -338,10 +338,10 @@
/* Found a match. Call tce[1], which is 8 bytes along, since
each tce element is a 64-bit int. */
addi 8,5,8
- mtlr 8
+ mtctr 8
=20
/* run the translation */
- blrl
+ bctrl
=20
/* On return from guest code:
r3 holds destination (original) address.
Modified: trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2006-10-17 02:05:14=
UTC (rev 6290)
+++ trunk/coregrind/m_dispatch/dispatch-ppc64-linux.S 2006-10-17 02:08:26=
UTC (rev 6291)
@@ -1,7 +1,7 @@
=20
/*--------------------------------------------------------------------*/
/*--- The core dispatch loop, for jumping to a code address. ---*/
-/*--- dispatch-ppc64.S ---*/
+/*--- dispatch-ppc64-linux.S ---*/
/*--------------------------------------------------------------------*/
=20
/*
@@ -298,10 +298,10 @@
/* Found a match. Call tce[1], which is 8 bytes along, since
each tce element is a 64-bit int. */
addi 8,5,8
- mtlr 8
+ mtctr 8
=20
/* run the translation */
- blrl
+ bctrl
=20
/* On return from guest code:
r3 holds destination (original) address.
@@ -376,10 +376,10 @@
/* Found a match. Call tce[1], which is 8 bytes along, since
each tce element is a 64-bit int. */
addi 8,5,8
- mtlr 8
+ mtctr 8
=20
/* run the translation */
- blrl
+ bctrl
=20
/* On return from guest code:
r3 holds destination (original) address.
Modified: trunk/coregrind/m_dispatch/dispatch-x86-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_dispatch/dispatch-x86-linux.S 2006-10-17 02:05:14 U=
TC (rev 6290)
+++ trunk/coregrind/m_dispatch/dispatch-x86-linux.S 2006-10-17 02:08:26 U=
TC (rev 6291)
@@ -1,7 +1,7 @@
=20
/*--------------------------------------------------------------------*/
/*--- The core dispatch loop, for jumping to a code address. ---*/
-/*--- dispatch-x86.S ---*/
+/*--- dispatch-x86-linux.S ---*/
/*--------------------------------------------------------------------*/
=20
/*
|
|
From: <sv...@va...> - 2006-10-17 02:05:24
|
Author: sewardj
Date: 2006-10-17 03:05:14 +0100 (Tue, 17 Oct 2006)
New Revision: 6290
Log:
Track VG_(am_find_nsegment) const-ness change.
Modified:
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
Modified: trunk/coregrind/m_sigframe/sigframe-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
--- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2006-10-17 02:03:11=
UTC (rev 6289)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c 2006-10-17 02:05:14=
UTC (rev 6290)
@@ -38,12 +38,11 @@
#include "pub_core_libcprint.h"
#include "pub_core_machine.h"
#include "pub_core_options.h"
-#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
+#include "pub_core_sigframe.h" /* self */
=20
-
/* This module creates and removes signal frames for signal deliveries
on amd64-linux.
=20
@@ -376,7 +375,7 @@
static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
{
ThreadId tid =3D tst->tid;
- NSegment *stackseg =3D NULL;
+ NSegment const* stackseg =3D NULL;
=20
if (VG_(extend_stack)(addr, tst->client_stack_szB)) {
stackseg =3D VG_(am_find_nsegment)(addr);
Modified: trunk/coregrind/m_sigframe/sigframe-ppc32-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
--- trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2006-10-17 02:03:11=
UTC (rev 6289)
+++ trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c 2006-10-17 02:05:14=
UTC (rev 6290)
@@ -494,7 +494,7 @@
static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
{
ThreadId tid =3D tst->tid;
- NSegment *stackseg =3D NULL;
+ NSegment const *stackseg =3D NULL;
=20
if (VG_(extend_stack)(addr, tst->client_stack_szB)) {
stackseg =3D VG_(am_find_nsegment)(addr);
Modified: trunk/coregrind/m_sigframe/sigframe-ppc64-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
--- trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c 2006-10-17 02:03:11=
UTC (rev 6289)
+++ trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c 2006-10-17 02:05:14=
UTC (rev 6290)
@@ -134,7 +134,7 @@
static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
{
ThreadId tid =3D tst->tid;
- NSegment *stackseg =3D NULL;
+ NSegment const *stackseg =3D NULL;
=20
if (VG_(extend_stack)(addr, tst->client_stack_szB)) {
stackseg =3D VG_(am_find_nsegment)(addr);
Modified: trunk/coregrind/m_sigframe/sigframe-x86-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
--- trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2006-10-17 02:03:11 U=
TC (rev 6289)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c 2006-10-17 02:05:14 U=
TC (rev 6290)
@@ -38,10 +38,10 @@
#include "pub_core_libcprint.h"
#include "pub_core_machine.h"
#include "pub_core_options.h"
-#include "pub_core_sigframe.h"
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
+#include "pub_core_sigframe.h" /* self */
=20
=20
/* This module creates and removes signal frames for signal deliveries
@@ -396,7 +396,7 @@
static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
{
ThreadId tid =3D tst->tid;
- NSegment *stackseg =3D NULL;
+ NSegment const* stackseg =3D NULL;
=20
if (VG_(extend_stack)(addr, tst->client_stack_szB)) {
stackseg =3D VG_(am_find_nsegment)(addr);
|
|
From: <sv...@va...> - 2006-10-17 02:03:21
|
Author: sewardj
Date: 2006-10-17 03:03:11 +0100 (Tue, 17 Oct 2006)
New Revision: 6289
Log:
Merge r6159 (parts of):
Minor build-system adjustments, mostly.
Modified:
trunk/coregrind/m_cpuid.S
trunk/coregrind/m_libcassert.c
trunk/coregrind/m_threadmodel.c
trunk/coregrind/pub_core_libcassert.h
trunk/coregrind/vg_preloaded.c
Modified: trunk/coregrind/m_cpuid.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_cpuid.S 2006-10-17 02:01:12 UTC (rev 6288)
+++ trunk/coregrind/m_cpuid.S 2006-10-17 02:03:11 UTC (rev 6289)
@@ -60,8 +60,6 @@
VG_(has_cpuid):
movq $1, %rax
ret
-#elif defined(VGA_appc32)
-//CAB: TODO
#endif
=20
/*
@@ -143,13 +141,13 @@
movq %rbp, %rsp
popq %rbp
ret
-#elif defined(VGA_appc32)
-//CAB: TODO
#endif
- =20
+
+#if defined(VGA_x86) || defined(VGA_amd64) =20
/* Let the linker know we don't need an executable stack */
.section .note.GNU-stack,"",@progbits
- =09
+#endif
+
##--------------------------------------------------------------------##
##--- end ---##
##--------------------------------------------------------------------##
Modified: trunk/coregrind/m_libcassert.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
--- trunk/coregrind/m_libcassert.c 2006-10-17 02:01:12 UTC (rev 6288)
+++ trunk/coregrind/m_libcassert.c 2006-10-17 02:03:11 UTC (rev 6289)
@@ -30,6 +30,7 @@
=20
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
@@ -39,7 +40,6 @@
#include "pub_core_syscall.h"
#include "pub_core_tooliface.h" // For VG_(details).{name,bug_report=
s_to}
#include "pub_core_options.h" // For VG_(clo_xml)
-#include "pub_core_vkiscnums.h"
=20
/* ---------------------------------------------------------------------
Assertery.
@@ -62,7 +62,7 @@
: "=3Dr" (pc),\
"=3Dr" (sp),\
"=3Dr" (fp));
-#elif defined(VGP_ppc32_linux)
+#elif defined(VGP_ppc32_linux) || defined(VGP_ppc32_aix5)
# define GET_REAL_PC_SP_AND_FP(pc, sp, fp) \
asm("mflr 0;" /* r0 =3D lr */ \
"bl m_libcassert_get_ip;" /* lr =3D pc */ \
@@ -76,7 +76,7 @@
"=3Dr" (fp) \
: /* reads none */ \
: "r0" /* trashed */ );
-#elif defined(VGP_ppc64_linux)
+#elif defined(VGP_ppc64_linux) || defined(VGP_ppc64_aix5)
# define GET_REAL_PC_SP_AND_FP(pc, sp, fp) \
asm("mflr 0;" /* r0 =3D lr */ \
"bl .m_libcassert_get_ip;" /* lr =3D pc */ \
@@ -99,7 +99,9 @@
/* Pull down the entire world */
void VG_(exit)( Int status )
{
+# if defined(VGO_linux)
(void)VG_(do_syscall1)(__NR_exit_group, status );
+# endif
(void)VG_(do_syscall1)(__NR_exit, status );
/* Why are we still alive here? */
/*NOTREACHED*/
@@ -108,7 +110,7 @@
}
=20
// Print the scheduler status.
-static void pp_sched_status ( void )
+void VG_(show_sched_status) ( void )
{
Int i;=20
VG_(printf)("\nsched status:\n");=20
@@ -143,11 +145,7 @@
ips, BACKTRACE_DEPTH, ip, sp, fp, lr, sp, stackt=
op);
VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
=20
- // Don't print this, as it's not terribly interesting and avoids a
- // dependence on m_scheduler/, which would be crazy.
- //VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_do=
ne) );
-=20
- pp_sched_status();
+ VG_(show_sched_status)();
VG_(printf)("\n");
VG_(printf)("Note: see also the FAQ.txt in the source distribution.\n=
");
VG_(printf)("It contains workarounds to several common problems.\n");
@@ -169,7 +167,7 @@
=20
static Bool entered =3D False;
if (entered)=20
- VG_(exit)(2);
+ VG_(exit)(2);
entered =3D True;
=20
va_start(vargs, format);
@@ -251,7 +249,7 @@
"Valgrind has to exit now. Sorry. Bye!");
VG_(message)(Vg_UserMsg,
"");
- pp_sched_status();
+ VG_(show_sched_status)();
VG_(exit)(1);
}
=20
Modified: trunk/coregrind/m_threadmodel.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
--- trunk/coregrind/m_threadmodel.c 2006-10-17 02:01:12 UTC (rev 6288)
+++ trunk/coregrind/m_threadmodel.c 2006-10-17 02:03:11 UTC (rev 6289)
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
=20
- Copyright (C) 2005 Jeremy Fitzhardinge
+ Copyright (C) 2005-2006 Jeremy Fitzhardinge
je...@go...
=20
This program is free software; you can redistribute it and/or
Modified: trunk/coregrind/pub_core_libcassert.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
--- trunk/coregrind/pub_core_libcassert.h 2006-10-17 02:01:12 UTC (rev 62=
88)
+++ trunk/coregrind/pub_core_libcassert.h 2006-10-17 02:03:11 UTC (rev 62=
89)
@@ -71,6 +71,9 @@
extern void VG_(unimplemented) ( Char* msg )
__attribute__((__noreturn__));
=20
+/* Show the state of all threads. Mostly for debugging V. */
+extern void VG_(show_sched_status) ( void );
+
#endif // __PUB_CORE_LIBCASSERT_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_preloaded.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
--- trunk/coregrind/vg_preloaded.c 2006-10-17 02:01:12 UTC (rev 6288)
+++ trunk/coregrind/vg_preloaded.c 2006-10-17 02:03:11 UTC (rev 6289)
@@ -55,7 +55,7 @@
void VG_NOTIFY_ON_LOAD(freeres)( void )
{
int res;
-#ifndef __UCLIBC__
+#if !defined(__UCLIBC__) && !defined(VGO_aix5)
extern void __libc_freeres(void);
__libc_freeres();
#endif
|
|
From: <sv...@va...> - 2006-10-17 02:01:25
|
Author: sewardj
Date: 2006-10-17 03:01:12 +0100 (Tue, 17 Oct 2006)
New Revision: 6288
Log:
Merge r6157:
- add extra fields to ThreadOSState to make thread cancellation sort-of=20
work on AIX5
- add function VG_(count_runnable_threads)
Modified:
trunk/coregrind/m_threadstate.c
trunk/coregrind/pub_core_threadstate.h
Modified: trunk/coregrind/m_threadstate.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
--- trunk/coregrind/m_threadstate.c 2006-10-17 02:00:29 UTC (rev 6287)
+++ trunk/coregrind/m_threadstate.c 2006-10-17 02:01:12 UTC (rev 6288)
@@ -111,6 +111,19 @@
return count;
}
=20
+/* Return the number of threads in VgTs_Runnable state */
+Int VG_(count_runnable_threads)(void)
+{
+ Int count =3D 0;
+ ThreadId tid;
+
+ for(tid =3D 1; tid < VG_N_THREADS; tid++)
+ if (VG_(threads)[tid].status =3D=3D VgTs_Runnable)
+ count++;
+
+ return count;
+}
+
/* Given an LWP id (ie, real kernel thread id), find the corresponding
ThreadId */
ThreadId VG_(get_lwp_tid)(Int lwp)
@@ -118,7 +131,8 @@
ThreadId tid;
=20
for(tid =3D 1; tid < VG_N_THREADS; tid++)
- if (VG_(threads)[tid].status !=3D VgTs_Empty && VG_(threads)[tid].=
os_state.lwpid =3D=3D lwp)
+ if (VG_(threads)[tid].status !=3D VgTs_Empty=20
+ && VG_(threads)[tid].os_state.lwpid =3D=3D lwp)
return tid;
=20
return VG_INVALID_THREADID;
Modified: trunk/coregrind/pub_core_threadstate.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
--- trunk/coregrind/pub_core_threadstate.h 2006-10-17 02:00:29 UTC (rev 6=
287)
+++ trunk/coregrind/pub_core_threadstate.h 2006-10-17 02:01:12 UTC (rev 6=
288)
@@ -67,8 +67,8 @@
typedef
enum {=20
VgSrc_None, /* not exiting yet */
- VgSrc_ExitSyscall, /* client called exit(). This is the normal
- route out. */
+ VgSrc_ExitThread, /* just this thread is exiting */
+ VgSrc_ExitProcess, /* entire process is exiting */
VgSrc_FatalSig /* Killed by the default action of a fatal
signal */
}
@@ -121,8 +121,22 @@
Addr valgrind_stack_init_SP; // starting value for SP
=20
/* exit details */
- Int exitcode; // in the case of exitgroup, set by someone else
- Int fatalsig; // fatal signal
+ Word exitcode; // in the case of exitgroup, set by someone else
+ Int fatalsig; // fatal signal
+
+# if defined(VGO_aix5)
+ /* AIX specific fields to make thread cancellation sort-of work */
+ /* What is this thread's current cancellation state a la
+ POSIX (deferred vs async, enable vs disabled) ? */
+ Bool cancel_async; // current cancel mode (async vs deferred)
+ Bool cancel_disabled; // cancellation disabled?
+ /* What's happened so far? */
+ enum { Canc_NoRequest=3D0, // no cancellation requested
+ Canc_Requested=3D1, // requested but not actioned
+ Canc_Actioned=3D2 } // requested and actioned
+ cancel_progress;
+ /* Initial state is False, False, Canc_Normal. */
+# endif
}
ThreadOSstate;
=20
@@ -238,6 +252,9 @@
/* Return the number of non-dead Threads */
extern Int VG_(count_living_threads)(void);
=20
+/* Return the number of threads in VgTs_Runnable state */
+extern Int VG_(count_runnable_threads)(void);
+
/* Given an LWP id (ie, real kernel thread id), find the corresponding
ThreadId */
extern ThreadId VG_(get_lwp_tid)(Int lwpid);
|
|
From: <sv...@va...> - 2006-10-17 02:00:34
|
Author: sewardj
Date: 2006-10-17 03:00:29 +0100 (Tue, 17 Oct 2006)
New Revision: 6287
Log:
Merge r6156:
AIX5 support. No changes in logic; just better factorisation of what
is already here.
- add AIX definitions for VG_UCONTEXT_INSTR_PTR et al
- add abstractions VKI_SIGINFO_si_addr and VKI_SIGINFO_si_pid
to enable the rest of the code to be uniform
- track other minor changes: SysRes, VG_(am_find_nsegment)=20
constness, rearrangement of VG_(sigtimedwait).
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.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
--- trunk/coregrind/m_signals.c 2006-10-17 01:59:30 UTC (rev 6286)
+++ trunk/coregrind/m_signals.c 2006-10-17 02:00:29 UTC (rev 6287)
@@ -81,6 +81,7 @@
=20
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_debuglog.h"
#include "pub_core_threadstate.h"
#include "pub_core_clientstate.h"
@@ -104,7 +105,6 @@
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
#include "pub_core_coredump.h"
-#include "pub_core_vkiscnums.h"
=20
=20
/* ---------------------------------------------------------------------
@@ -113,7 +113,7 @@
=20
static void sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct=
vki_ucontext * );
static void async_signalhandler ( Int sigNo, vki_siginfo_t *info, struct=
vki_ucontext * );
-static void sigvgkill_handler ( Int sigNo, vki_siginfo_t *info, struc=
t vki_ucontext * );
+static void sigvgkill_handler ( Int sigNo, vki_siginfo_t *info, struct v=
ki_ucontext * );
=20
static const Char *signame(Int sigNo);
=20
@@ -127,6 +127,8 @@
vki_siginfo_t sigs[N_QUEUED_SIGNALS];
} SigQueue;
=20
+/* ------ Macros for pulling stuff out of ucontexts ------ */
+
#if defined(VGP_x86_linux)
# define VG_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
@@ -209,14 +211,6 @@
# define VG_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.gp_regs[VKI=
_PT_R1])
# define VG_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.gp_regs[VKI=
_PT_R1])
# define VG_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.gp_regs[VKI=
_PT_R0])
-#if 0
-# define VG_UCONTEXT_SYSCALL_SYSRES(uc) \
- /* Convert the values in uc_mcontext r3,cr into a SysRes. */ \
- VG_(mk_SysRes_ppc64_linux)( \
- (uc)->uc_mcontext.gp_regs[VKI_PT_R3], \
- (((uc)->uc_mcontext.gp_regs[VKI_PT_CCR] >> 28) & 1) \
- )
-#else
/* Dubious hack: if there is an error, only consider the lowest 8
bits of r3. memcheck/tests/post-syscall shows a case where an
interrupted syscall should have produced a ucontext with 0x4
@@ -231,13 +225,106 @@
if (err) r3 &=3D 0xFF;
return VG_(mk_SysRes_ppc64_linux)( r3, err );
}
-#endif
# define VG_UCONTEXT_LINK_REG(uc) ((uc)->uc_mcontext.gp_regs[VKI=
_PT_LNK])=20
=20
-#else
+#elif defined(VGP_ppc32_aix5)
+
+ /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
+# include <ucontext.h>
+ /* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
+ static inline Addr VG_UCONTEXT_INSTR_PTR( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct mstsave* jc =3D &mc->jmp_context;
+ return jc->iar;
+ }
+ static inline Addr VG_UCONTEXT_STACK_PTR( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct mstsave* jc =3D &mc->jmp_context;
+ return jc->gpr[1];
+ }
+ static inline Addr VG_UCONTEXT_SYSCALL_NUM( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct mstsave* jc =3D &mc->jmp_context;
+ return jc->gpr[2];
+ }
+ static inline SysRes VG_UCONTEXT_SYSCALL_SYSRES( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct mstsave* jc =3D &mc->jmp_context;
+ return VG_(mk_SysRes_ppc32_aix5)( jc->gpr[3], jc->gpr[4] );
+ }
+ static inline Addr VG_UCONTEXT_LINK_REG( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct mstsave* jc =3D &mc->jmp_context;
+ return jc->lr;
+ }
+ static inline Addr VG_UCONTEXT_FRAME_PTR( void* ucV ) {
+ return VG_UCONTEXT_STACK_PTR(ucV);
+ }
+
+#elif defined(VGP_ppc64_aix5)
+
+ /* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
+# include <ucontext.h>
+ /* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
+ static inline Addr VG_UCONTEXT_INSTR_PTR( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct __context64* jc =3D &mc->jmp_context;
+ return jc->iar;
+ }
+ static inline Addr VG_UCONTEXT_STACK_PTR( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct __context64* jc =3D &mc->jmp_context;
+ return jc->gpr[1];
+ }
+ static inline Addr VG_UCONTEXT_SYSCALL_NUM( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct __context64* jc =3D &mc->jmp_context;
+ return jc->gpr[2];
+ }
+ static inline SysRes VG_UCONTEXT_SYSCALL_SYSRES( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct __context64* jc =3D &mc->jmp_context;
+ return VG_(mk_SysRes_ppc32_aix5)( jc->gpr[3], jc->gpr[4] );
+ }
+ static inline Addr VG_UCONTEXT_LINK_REG( void* ucV ) {
+ ucontext_t* uc =3D (ucontext_t*)ucV;
+ struct __jmpbuf* mc =3D &(uc->uc_mcontext);
+ struct __context64* jc =3D &mc->jmp_context;
+ return jc->lr;
+ }
+ static inline Addr VG_UCONTEXT_FRAME_PTR( void* ucV ) {
+ return VG_UCONTEXT_STACK_PTR(ucV);
+ }
+
+#else=20
# error Unknown platform
#endif
=20
+
+/* ------ Macros for pulling stuff out of siginfos ------ */
+
+/* These macros allow use of uniform names when working with
+ both the Linux and AIX vki definitions. */
+#if defined(VGO_linux)
+# define VKI_SIGINFO_si_addr _sifields._sigfault._addr
+# define VKI_SIGINFO_si_pid _sifields._kill._pid
+#elif defined(VGO_aix5)
+# define VKI_SIGINFO_si_addr si_addr
+# define VKI_SIGINFO_si_pid si_pid
+#else
+# error Unknown OS
+#endif
+
+
/* ---------------------------------------------------------------------
HIGH LEVEL STUFF TO DO WITH SIGNALS: POLICY (MOSTLY)
------------------------------------------------------------------ */
@@ -503,6 +590,16 @@
".my_sigreturn:\n" \
" li 0, " #name "\n" \
" sc\n"
+#elif defined(VGP_ppc32_aix5)
+# define _MYSIG(name) \
+ ".globl my_sigreturn\n" \
+ "my_sigreturn:\n" \
+ ".long 0\n"
+#elif defined(VGP_ppc64_aix5)
+# define _MYSIG(name) \
+ ".globl my_sigreturn\n" \
+ "my_sigreturn:\n" \
+ ".long 0\n"
#else
# error Unknown platform
#endif
@@ -543,7 +640,8 @@
=20
ksa.ksa_handler =3D skss.skss_per_sig[sig].skss_handler;
ksa.sa_flags =3D skss.skss_per_sig[sig].skss_flags;
-# if !defined(VGP_ppc32_linux)
+# if !defined(VGP_ppc32_linux) && !defined(VGP_ppc32_aix5) \
+ && !defined(VGP_ppc64_aix5)
ksa.sa_restorer =3D my_sigreturn;
# endif
/* Re above ifdef (also the assertion below), PaulM says:
@@ -577,7 +675,8 @@
=3D=3D skss_old.skss_per_sig[sig].skss_handler);
vg_assert(ksa_old.sa_flags=20
=3D=3D skss_old.skss_per_sig[sig].skss_flags);
-# if !defined(VGP_ppc32_linux)
+# if !defined(VGP_ppc32_linux) && !defined(VGP_ppc32_aix5) \
+ && !defined(VGP_ppc64_aix5)
vg_assert(ksa_old.sa_restorer=20
=3D=3D my_sigreturn);
# endif
@@ -695,7 +794,9 @@
old_act->ksa_handler =3D scss.scss_per_sig[signo].scss_handler;
old_act->sa_flags =3D scss.scss_per_sig[signo].scss_flags;
old_act->sa_mask =3D scss.scss_per_sig[signo].scss_mask;
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
old_act->sa_restorer =3D scss.scss_per_sig[signo].scss_restorer;
+# endif
}
=20
/* And now copy new SCSS entry from new_act. */
@@ -703,7 +804,11 @@
scss.scss_per_sig[signo].scss_handler =3D new_act->ksa_handler;
scss.scss_per_sig[signo].scss_flags =3D new_act->sa_flags;
scss.scss_per_sig[signo].scss_mask =3D new_act->sa_mask;
+
+ scss.scss_per_sig[signo].scss_restorer =3D 0;
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
scss.scss_per_sig[signo].scss_restorer =3D new_act->sa_restorer;
+# endif
=20
VG_(sigdelset)(&scss.scss_per_sig[signo].scss_mask, VKI_SIGKILL);
VG_(sigdelset)(&scss.scss_per_sig[signo].scss_mask, VKI_SIGSTOP);
@@ -958,39 +1063,41 @@
static Char buf[10];
=20
switch(sigNo) {
-#define S(x) case VKI_##x: return #x
- S(SIGHUP);
- S(SIGINT);
- S(SIGQUIT);
- S(SIGILL);
- S(SIGTRAP);
- S(SIGABRT);
- S(SIGBUS);
- S(SIGFPE);
- S(SIGKILL);
- S(SIGUSR1);
- S(SIGUSR2);
- S(SIGSEGV);
- S(SIGPIPE);
- S(SIGALRM);
- S(SIGTERM);
- S(SIGSTKFLT);
- S(SIGCHLD);
- S(SIGCONT);
- S(SIGSTOP);
- S(SIGTSTP);
- S(SIGTTIN);
- S(SIGTTOU);
- S(SIGURG);
- S(SIGXCPU);
- S(SIGXFSZ);
- S(SIGVTALRM);
- S(SIGPROF);
- S(SIGWINCH);
- S(SIGIO);
- S(SIGPWR);
- S(SIGUNUSED);
-#undef S
+ case VKI_SIGHUP: return "SIGHUP";
+ case VKI_SIGINT: return "SIGINT";
+ case VKI_SIGQUIT: return "SIGQUIT";
+ case VKI_SIGILL: return "SIGILL";
+ case VKI_SIGTRAP: return "SIGTRAP";
+ case VKI_SIGABRT: return "SIGABRT";
+ case VKI_SIGBUS: return "SIGBUS";
+ case VKI_SIGFPE: return "SIGFPE";
+ case VKI_SIGKILL: return "SIGKILL";
+ case VKI_SIGUSR1: return "SIGUSR1";
+ case VKI_SIGUSR2: return "SIGUSR2";
+ case VKI_SIGSEGV: return "SIGSEGV";
+ case VKI_SIGPIPE: return "SIGPIPE";
+ case VKI_SIGALRM: return "SIGALRM";
+ case VKI_SIGTERM: return "SIGTERM";
+# if defined(VKI_SIGSTKFLT)
+ case VKI_SIGSTKFLT: return "SIGSTKFLT";
+# endif
+ case VKI_SIGCHLD: return "SIGCHLD";
+ case VKI_SIGCONT: return "SIGCONT";
+ case VKI_SIGSTOP: return "SIGSTOP";
+ case VKI_SIGTSTP: return "SIGTSTP";
+ case VKI_SIGTTIN: return "SIGTTIN";
+ case VKI_SIGTTOU: return "SIGTTOU";
+ case VKI_SIGURG: return "SIGURG";
+ case VKI_SIGXCPU: return "SIGXCPU";
+ case VKI_SIGXFSZ: return "SIGXFSZ";
+ case VKI_SIGVTALRM: return "SIGVTALRM";
+ case VKI_SIGPROF: return "SIGPROF";
+ case VKI_SIGWINCH: return "SIGWINCH";
+ case VKI_SIGIO: return "SIGIO";
+ case VKI_SIGPWR: return "SIGPWR";
+# if defined(VKI_SIGUNUSED)
+ case VKI_SIGUNUSED: return "SIGUNUSED";
+# endif
=20
case VKI_SIGRTMIN ... VKI_SIGRTMAX:
VG_(sprintf)(buf, "SIGRT%d", sigNo-VKI_SIGRTMIN);
@@ -1010,7 +1117,9 @@
=20
sa.ksa_handler =3D VKI_SIG_DFL;
sa.sa_flags =3D 0;
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
sa.sa_restorer =3D 0;
+# endif
VG_(sigemptyset)(&sa.sa_mask);
=20
VG_(sigaction)(sigNo, &sa, &origsa);
@@ -1169,7 +1278,7 @@
if (event !=3D NULL) {
if (haveaddr)
VG_(message)(Vg_UserMsg, " %s at address %p",=20
- event, info->_sifields._sigfault._addr);
+ event, info->VKI_SIGINFO_si_addr);
else
VG_(message)(Vg_UserMsg, " %s", event);
}
@@ -1308,7 +1417,7 @@
=20
info.si_signo =3D VKI_SIGSEGV;
info.si_code =3D si_code;
- info._sifields._sigfault._addr =3D (void*)addr;
+ info.VKI_SIGINFO_si_addr =3D (void*)addr;
=20
/* If they're trying to block the signal, force it to be delivered */
if (VG_(sigismember)(&VG_(threads)[tid].sig_mask, VKI_SIGSEGV))
@@ -1344,8 +1453,8 @@
vg_assert(VG_(threads)[tid].status =3D=3D VgTs_Runnable);
=20
info.si_signo =3D VKI_SIGILL;
- info.si_code =3D VKI_ILL_ILLOPC; /* jrs: no idea what this should be =
*/
- info._sifields._sigfault._addr =3D (void*)addr;
+ info.si_code =3D VKI_ILL_ILLOPC; /* jrs: no idea what this should be=
*/
+ info.VKI_SIGINFO_si_addr =3D (void*)addr;
=20
resume_scheduler(tid);
deliver_signal(tid, &info);
@@ -1446,7 +1555,7 @@
idx =3D (idx + 1) % N_QUEUED_SIGNALS;
} while(idx !=3D sq->next);
out: =20
- return ret; =20
+ return ret;
}
=20
/*=20
@@ -1461,8 +1570,6 @@
ThreadId tid =3D VG_(get_lwp_tid)(VG_(gettid)());
ThreadState *tst =3D VG_(get_ThreadState)(tid);
=20
- vg_assert(tst->status =3D=3D VgTs_WaitSys);
-
#ifdef VGO_linux
/* The linux kernel uses the top 16 bits of si_code for it's own
use and only exports the bottom 16 bits to user space - at least
@@ -1475,13 +1582,15 @@
info->si_code =3D (Short)info->si_code;
#endif
=20
- /* The thread isn't currently running, make it so before going on */
- VG_(set_running)(tid);
-
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "Async handler got signal %d for tid %d =
info %d",
sigNo, tid, info->si_code);
=20
+ vg_assert(tst->status =3D=3D VgTs_WaitSys);
+
+ /* The thread isn't currently running, make it so before going on */
+ VG_(set_running)(tid, "async_signalhandler");
+
/* Update thread state properly */
VG_(fixup_guest_state_after_syscall_interrupted)(
tid,=20
@@ -1518,9 +1627,11 @@
SizeT udelta;
=20
/* Find the next Segment above addr */
- NSegment* seg =3D VG_(am_find_nsegment)(addr);
- NSegment* seg_next =3D seg ? VG_(am_next_nsegment)( seg, True/*fwds*/=
)
- : NULL;
+ NSegment const* seg
+ =3D VG_(am_find_nsegment)(addr);
+ NSegment const* seg_next=20
+ =3D seg ? VG_(am_next_nsegment)( (NSegment*)seg, True/*fwds*/ )
+ : NULL;
=20
if (seg && seg->kind =3D=3D SkAnonC)
/* addr is already mapped. Nothing to do. */
@@ -1542,7 +1653,7 @@
"extending a stack base 0x%llx down by %lld\n",
(ULong)seg_next->start, (ULong)udelta);
if (! VG_(am_extend_into_adjacent_reservation_client)
- ( seg_next, -(SSizeT)udelta )) {
+ ( (NSegment*)seg_next, -(SSizeT)udelta )) {
VG_(debugLog)(1, "signals", "extending a stack base: FAILED\n");
return False;
}
@@ -1557,10 +1668,12 @@
return True;
}
=20
-static void (*fault_catcher)(Int sig, Addr addr);
+static void (*fault_catcher)(Int sig, Addr addr) =3D NULL;
=20
void VG_(set_fault_catcher)(void (*catcher)(Int, Addr))
{
+ if (0)
+ VG_(debugLog)(0, "signals", "set fault catcher to %p\n", catcher);
vg_assert2(NULL =3D=3D catcher || NULL =3D=3D fault_catcher,
"Fault catcher is already registered");
=20
@@ -1617,7 +1730,7 @@
VG_(core_panic)("async_signalhandler returned!?\n");
}
=20
- if (info->_sifields._kill._pid =3D=3D 0) {
+ if (info->VKI_SIGINFO_si_pid =3D=3D 0) {
/* There's a per-user limit of pending siginfo signals. If
you exceed this, by having more than that number of
pending signals with siginfo, then new signals are
@@ -1674,15 +1787,30 @@
}
vg_assert(sigNo >=3D 1 && sigNo <=3D VG_(max_signal));
=20
+ /* Check to see if someone is interested in faults. The fault
+ catcher should never be set whilst we're in generated code, so
+ check for that. AFAIK the only use of the catcher right now is
+ memcheck's leak detector.
+ */
+ if (fault_catcher) {
+ vg_assert(VG_(in_generated_code) =3D=3D False);
+
+ (*fault_catcher)(sigNo, (Addr)info->VKI_SIGINFO_si_addr);
+ /* If the catcher returns, then it didn't handle the fault,
+ so carry on panicing. */
+ }
+
/* Special fault-handling case. We can now get signals which can
act upon and immediately restart the faulting instruction.
*/
if (info->si_signo =3D=3D VKI_SIGSEGV) {
- Addr fault =3D (Addr)info->_sifields._sigfault._addr;
+ Addr fault =3D (Addr)info->VKI_SIGINFO_si_addr;
Addr esp =3D VG_(get_SP)(tid);
- NSegment* seg =3D VG_(am_find_nsegment)(fault);
- NSegment* seg_next =3D seg ? VG_(am_next_nsegment)( seg, True/*fwd=
s*/ )
- : NULL;
+ NSegment const* seg
+ =3D VG_(am_find_nsegment)(fault);
+ NSegment const* seg_next=20
+ =3D seg ? VG_(am_next_nsegment)( (NSegment*)seg, True/*fwds*/ )
+ : NULL;
=20
if (VG_(clo_trace_signals)) {
if (seg =3D=3D NULL)
@@ -1743,14 +1871,6 @@
resume_scheduler(tid);
}
=20
- /* Check to see if someone is interested in faults. */
- if (fault_catcher) {
- (*fault_catcher)(sigNo, (Addr)info->_sifields._sigfault._addr);
-
- /* If the catcher returns, then it didn't handle the fault,
- so carry on panicing. */
- }
-
/* If resume_scheduler returns or its our fault, it means we
don't have longjmp set up, implying that we weren't running
client code, and therefore it was actually generated by
@@ -1762,7 +1882,7 @@
=20
VG_(message)(Vg_DebugMsg,=20
"si_code=3D%x; Faulting address: %p; sp: %p",
- info->si_code, info->_sifields._sigfault._addr,
+ info->si_code, info->VKI_SIGINFO_si_addr,
VG_UCONTEXT_STACK_PTR(uc));
=20
if (0)
@@ -1788,18 +1908,32 @@
*/
static void sigvgkill_handler(int signo, vki_siginfo_t *si, struct vki_u=
context *uc)
{
- ThreadId tid =3D VG_(get_lwp_tid)(VG_(gettid)());
+ ThreadId tid =3D VG_(get_lwp_tid)(VG_(gettid)());
+ ThreadStatus at_signal =3D VG_(threads)[tid].status;
=20
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "sigvgkill for lwp %d tid %d", VG_(getti=
d)(), tid);
+ VG_(message)(Vg_DebugMsg,=20
+ "sigvgkill for lwp %d tid %d", VG_(gettid)(), tid);
=20
+ VG_(set_running)(tid, "sigvgkill_handler");
+
vg_assert(signo =3D=3D VG_SIGVGKILL);
vg_assert(si->si_signo =3D=3D signo);
- vg_assert(VG_(threads)[tid].status =3D=3D VgTs_WaitSys);
=20
- VG_(set_running)(tid);
- VG_(post_syscall)(tid);
+ /* jrs 2006 August 3: the following assertion seems incorrect to
+ me, and fails on AIX. sigvgkill could be sent to a thread which
+ is runnable - see VG_(nuke_all_threads_except) in the scheduler.
+ Hence comment these out .. =20
=20
+ vg_assert(VG_(threads)[tid].status =3D=3D VgTs_WaitSys);
+ VG_(post_syscall)(tid);
+
+ and instead do:
+ */
+ if (at_signal =3D=3D VgTs_WaitSys)
+ VG_(post_syscall)(tid);
+ /* jrs 2006 August 3 ends */
+
resume_scheduler(tid);
=20
VG_(core_panic)("sigvgkill_handler couldn't return to the scheduler\n=
");
@@ -1810,7 +1944,14 @@
{
Int i;
VG_(printf)("pp_ksigaction: handler %p, flags 0x%x, restorer %p\n",=20
- sa->ksa_handler, (UInt)sa->sa_flags, sa->sa_restorer);
+ sa->ksa_handler,=20
+ (UInt)sa->sa_flags,=20
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
+ sa->sa_restorer
+# else
+ 0
+# endif
+ );
VG_(printf)("pp_ksigaction: { ");
for (i =3D 1; i <=3D VG_(max_signal); i++)
if (VG_(sigismember(&(sa->sa_mask),i)))
@@ -1827,7 +1968,9 @@
=20
sa.ksa_handler =3D VKI_SIG_DFL;
sa.sa_flags =3D 0;
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
sa.sa_restorer =3D 0;
+# endif
VG_(sigemptyset)(&sa.sa_mask);
=20
VG_(do_sys_sigaction)(signo, &sa, NULL);
@@ -1838,7 +1981,6 @@
*/
void VG_(poll_signals)(ThreadId tid)
{
- static const struct vki_timespec zero =3D { 0, 0 };
vki_siginfo_t si, *sip;
vki_sigset_t pollset;
ThreadState *tst =3D VG_(get_ThreadState)(tid);
@@ -1860,7 +2002,7 @@
sip =3D next_queued(0, &pollset); /* process-wide */
=20
/* If there was nothing queued, ask the kernel for a pending signal *=
/
- if (sip =3D=3D NULL && VG_(sigtimedwait)(&pollset, &si, &zero) > 0) {
+ if (sip =3D=3D NULL && VG_(sigtimedwait_zero)(&pollset, &si) > 0) {
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugMsg, "poll_signals: got signal %d "
"for thread %d", si.si_signo, tid);
@@ -1915,7 +2057,9 @@
=20
tsa.ksa_handler =3D (void *)sync_signalhandler;
tsa.sa_flags =3D VKI_SA_SIGINFO;
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
tsa.sa_restorer =3D 0;
+# endif
VG_(sigfillset)(&tsa.sa_mask);
=20
/* try setting it to some arbitrary handler */
@@ -1937,7 +2081,10 @@
scss.scss_per_sig[i].scss_handler =3D sa.ksa_handler;
scss.scss_per_sig[i].scss_flags =3D sa.sa_flags;
scss.scss_per_sig[i].scss_mask =3D sa.sa_mask;
+ scss.scss_per_sig[i].scss_restorer =3D 0;
+# if !defined(VGP_ppc32_aix5) && !defined(VGP_ppc64_aix5)
scss.scss_per_sig[i].scss_restorer =3D sa.sa_restorer;
+# endif
}
=20
if (VG_(clo_trace_signals))
|
|
From: <sv...@va...> - 2006-10-17 01:59:34
|
Author: sewardj
Date: 2006-10-17 02:59:30 +0100 (Tue, 17 Oct 2006)
New Revision: 6286
Log:
Merge r6154:
Track SysRes change, and remove unused stuff in header. Perhaps
this should be folded into m_initimg in the fullness of time.
Modified:
trunk/coregrind/m_ume.c
trunk/coregrind/pub_core_ume.h
Modified: trunk/coregrind/m_ume.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
--- trunk/coregrind/m_ume.c 2006-10-17 01:54:54 UTC (rev 6285)
+++ trunk/coregrind/m_ume.c 2006-10-17 01:59:30 UTC (rev 6286)
@@ -30,15 +30,11 @@
*/
=20
=20
-#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
-
-// It seems that on SuSE 9.1 (x86) something in <fcntl.h> messes up stuf=
f
-// acquired indirectly from vki-x86-linux.h. Therefore our headers must=
be
-// included ahead of the glibc ones. This fix is a kludge; the right
-// solution is to entirely remove the glibc dependency.
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+
+#if defined(VGO_linux)
+
#include "pub_core_aspacemgr.h" // various mapping fns
#include "pub_core_debuglog.h"
#include "pub_core_libcbase.h"
@@ -49,9 +45,14 @@
#include "pub_core_libcassert.h" // VG_(exit), vg_assert
#include "pub_core_mallocfree.h" // VG_(malloc), VG_(free)
#include "pub_core_syscall.h" // VG_(strerror)
-#include "pub_core_vkiscnums.h" // mmap-related constants
+#include "pub_core_ume.h" // self
=20
-#include "pub_core_ume.h"
+/* --- !!! --- EXTERNAL HEADERS start --- !!! --- */
+#define _GNU_SOURCE
+#define _FILE_OFFSET_BITS 64
+/* This is for ELF types etc, and also the AT_ constants. */
+#include <elf.h>
+/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
=20
=20
#if VG_WORDSIZE =3D=3D 8
@@ -73,7 +74,7 @@
{
if (res.isError) {
VG_(printf)("valgrind: mmap(0x%llx, %lld) failed in UME with error=
%d.\n",=20
- (ULong)base, (Long)len, res.val);
+ (ULong)base, (Long)len, res.err);
VG_(exit)(1);
}
}
@@ -119,9 +120,9 @@
e->fd =3D fd;
=20
sres =3D VG_(pread)(fd, &e->e, sizeof(e->e), 0);
- if (sres.isError || sres.val !=3D sizeof(e->e)) {
+ if (sres.isError || sres.res !=3D sizeof(e->e)) {
VG_(printf)("valgrind: %s: can't read ELF header: %s\n",=20
- filename, VG_(strerror)(sres.val));
+ filename, VG_(strerror)(sres.err));
goto bad;
}
=20
@@ -159,9 +160,9 @@
vg_assert(e->p);
=20
sres =3D VG_(pread)(fd, e->p, phsz, e->e.e_phoff);
- if (sres.isError || sres.val !=3D phsz) {
+ if (sres.isError || sres.res !=3D phsz) {
VG_(printf)("valgrind: can't read phdr: %s\n",=20
- VG_(strerror)(sres.val));
+ VG_(strerror)(sres.err));
VG_(free)(e->p);
goto bad;
}
@@ -384,7 +385,7 @@
VG_(printf)("valgrind: m_ume.c: can't open interpreter\n");
VG_(exit)(1);
}
- intfd =3D sres.val;
+ intfd =3D sres.res;
=20
interp =3D readelf(intfd, buf);
if (interp =3D=3D NULL) {
@@ -573,7 +574,7 @@
VG_(close)(fd);
return VKI_EACCES;
} else {
- len =3D res.val;
+ len =3D res.res;
}
=20
vg_assert('#' =3D=3D hdr[0] && '!' =3D=3D hdr[1]);
@@ -641,7 +642,7 @@
if (res.isError) {
return res;
}
- fd =3D res.val;
+ fd =3D res.res;
=20
// Check we have execute permissions
ret =3D VG_(check_executable)((HChar*)exe_name);
@@ -655,11 +656,11 @@
bufsz =3D fsz;
=20
res =3D VG_(pread)(fd, buf, bufsz, 0);
- if (res.isError || res.val !=3D bufsz) {
+ if (res.isError || res.res !=3D bufsz) {
VG_(close)(fd);
return VG_(mk_SysRes_Error)(VKI_EACCES);
}
- bufsz =3D res.val;
+ bufsz =3D res.res;
=20
if (match_ELF(buf, bufsz)) {
res =3D VG_(mk_SysRes_Success)(VG_EXE_FORMAT_ELF);
@@ -692,9 +693,9 @@
=20
res =3D VG_(pre_exec_check)(exe, &fd);
if (res.isError)
- return res.val;
+ return res.err;
=20
- switch (res.val) {
+ switch (res.res) {
case VG_EXE_FORMAT_ELF: ret =3D load_ELF (fd, exe, info); break=
;
case VG_EXE_FORMAT_SCRIPT: ret =3D load_script(fd, exe, info); break=
;
default:
@@ -712,7 +713,7 @@
SysRes res =3D VG_(open)(f, VKI_O_RDONLY, 0);
if (!res.isError) {
Char buf[3] =3D {0,0,0};
- Int fd =3D res.val;
+ Int fd =3D res.res;
Int n =3D VG_(read)(fd, buf, 2);=20
if (n =3D=3D 2 && VG_STREQ("#!", buf))
return True;
@@ -728,7 +729,7 @@
SysRes res =3D VG_(open)(f, VKI_O_RDONLY, 0);
if (!res.isError) {
UChar buf[80];
- Int fd =3D res.val;
+ Int fd =3D res.res;
Int n =3D VG_(read)(fd, buf, 80);=20
Int i;
for (i =3D 0; i < n; i++) {
@@ -833,6 +834,8 @@
return ret;
}
=20
+#endif /* defined(VGO_linux) */
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_ume.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
--- trunk/coregrind/pub_core_ume.h 2006-10-17 01:54:54 UTC (rev 6285)
+++ trunk/coregrind/pub_core_ume.h 2006-10-17 01:59:30 UTC (rev 6286)
@@ -33,42 +33,10 @@
=20
//--------------------------------------------------------------------
// PURPOSE: This module implements user-mode execve, ie. program loading
-// and exec'ing. It is shared between stage1 and stage2.
+// and exec'ing.
//--------------------------------------------------------------------
=20
-#include <elf.h>
-#include <sys/types.h>
-
/*------------------------------------------------------------*/
-/*--- General stuff ---*/
-/*------------------------------------------------------------*/
-
-/* This is only here so it can be shared between stage1 and stage2 */
-
-/* JRS 9 Aug 05: both of these are apparently unused, except by
- memcheck/tests/vgtest_ume.c. */
-//zz extern
-//zz void VG_(foreach_map)(int (*fn)(char *start, char *end,
-//zz const char *perm, off_t offset,
-//zz int maj, int min, int ino, void* extra),
-//zz void* extra);
-//zz=20
-//zz /* Jump to 'dst', but first set the stack pointer to 'stack'. Also=
,
-//zz clear all the integer registers before entering 'dst'. It's
-//zz important that the stack pointer is set to exactly 'stack' and n=
ot
-//zz (eg) stack - apparently_harmless_looking_small_offset. Basicall=
y
-//zz because the code at 'dst' might be wanting to scan the area abov=
e
-//zz 'stack' (viz, the auxv array), and putting spurious words on the
-//zz stack confuses it.
-//zz=20
-//zz This is only exported so that vgtest_ume.c can use it.
-//zz */
-//zz extern
-//zz __attribute__((noreturn))
-//zz void VG_(jump_and_switch_stacks) ( Addr stack, Addr dst );
-
-
-/*------------------------------------------------------------*/
/*--- Loading ELF files ---*/
/*------------------------------------------------------------*/
=20
|
|
From: <sv...@va...> - 2006-10-17 01:54:56
|
Author: sewardj
Date: 2006-10-17 02:54:54 +0100 (Tue, 17 Oct 2006)
New Revision: 6285
Log:
Merge r6153: Add client startup code for AIX5.
Modified:
trunk/coregrind/m_trampoline.S
trunk/coregrind/pub_core_trampoline.h
Modified: trunk/coregrind/m_trampoline.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_trampoline.S 2006-10-17 01:54:20 UTC (rev 6284)
+++ trunk/coregrind/m_trampoline.S 2006-10-17 01:54:54 UTC (rev 6285)
@@ -29,8 +29,14 @@
*/
=20
#include "pub_core_basics_asm.h"
-#include "pub_core_vkiscnums.h"
=20
+/* We need pub_core_vkiscnums.h, but the AIX5 formulation
+ brings in a load of C declarations. Defining this macro
+ makes them invisible. Yes, a nasty hack. */
+#define VG_IN_ASSEMBLY_SOURCE
+# include "pub_core_vkiscnums.h"
+#undef VG_IN_ASSEMBLY_SOURCE
+
/* ------------------ SIMULATED CPU HELPERS ------------------ */
/*=20
Replacements for some functions to do with vsyscalls and signals.
@@ -299,8 +305,8 @@
VG_(trampoline_stuff_start):
=20
/* See comment in pub_core_trampoline.h for what this is for */
-.global VG_(ppc64_linux_magic_redirect_return_stub)
-VG_(ppc64_linux_magic_redirect_return_stub):
+.global VG_(ppctoc_magic_redirect_return_stub)
+VG_(ppctoc_magic_redirect_return_stub):
trap
=20
/* this function is written using the "dotless" ABI convention */
@@ -377,6 +383,279 @@
# undef UD2_1024
# undef UD2_PAGE
=20
+/*---------------- ppc32-aix5 ----------------*/
+#else
+#if defined(VGP_ppc32_aix5)
+
+# define UD2_16 trap ; trap ; trap; trap
+# define UD2_64 UD2_16 ; UD2_16 ; UD2_16 ; UD2_16
+# define UD2_256 UD2_64 ; UD2_64 ; UD2_64 ; UD2_64
+# define UD2_1024 UD2_256 ; UD2_256 ; UD2_256 ; UD2_256
+# define UD2_PAGE UD2_1024 ; UD2_1024 ; UD2_1024 ; UD2_1024 =20
+
+ .csect .text[PR]
+
+ /* a leading page of unexecutable code */
+ UD2_PAGE
+
+.globl VG_(trampoline_stuff_start)
+VG_(trampoline_stuff_start):
+
+/* See pub_core_trampoline.h for an explaination of this. Also
+ see pub_core_initimg.h, struct AIX5PreloadPage. On entry, r3
+ points to an AIX5PreloadPage structure. Note we can only=20
+ use r2-r10 as scratch registers here since those are the
+ only ones restored from the preload page when finally
+ starting the client. */
+.globl VG_(ppc32_aix5_do_preloads_then_start_client)
+VG_(ppc32_aix5_do_preloads_then_start_client):
+ stwu 1,-1024(1)
+ stw 3,512(1) /* stash r3 512 bytes up stack */
+
+ /* Try to load .../vgpreload_core.so */
+ lwz 2,0(3) /* r2 =3D __NR___loadx */
+ lwz 5,20(3) /* r5 =3D off_preloadcorename */
+ add 6,3,5 /* r6 =3D preloadcorename */
+ bl do___loadx
+ cmpwi 0,3,0
+ beq .Lfailed
+
+ /* Try to load .../vgpreload_tool.so, if it exists */
+ lwz 3,512(1) /* restore r3 */
+ lwz 2,0(3) /* r2 =3D __NR___loadx */
+ lwz 5,24(3) /* r5 =3D off_preloadtoolname */
+ cmpwi 0,5,0 /* skip tool preload if */
+ beq .Ltry_preload /* name not present */
+ add 6,3,5 /* r6 =3D preloadtoolname */
+ bl do___loadx
+ cmpwi 0,3,0
+ beq .Lfailed
+
+.Ltry_preload:
+ /* Try to load the LD_PRELOAD=3D file, if it exists */
+ lwz 3,512(1) /* restore r3 */
+ lwz 2,0(3) /* r2 =3D __NR___loadx */
+ lwz 5,28(3) /* r5 =3D off_ld_preloadname */
+ cmpwi 0,5,0 /* skip ld_preload if */
+ beq .Lstart_client /* name not present */
+ add 6,3,5 /* r6 =3D ld_preloadname */
+ bl do___loadx
+ cmpwi 0,3,0
+ beq .Lfailed
+=09
+.Lstart_client:
+ /* Success. Restore r2-r10 from preloadpage-> and start
+ the client. */
+ lwz 3,512(1) /* restore r3 */
+ addi 1,1,1024
+ lwz 2,32+4(3) /* preloadpage->client_start */
+ mtctr 2
+ lwz 2,40+4(3) /* preloadpage->r2 */
+ lwz 4,56+4(3) /* preloadpage->r4 */
+ lwz 5,64+4(3) /* preloadpage->r5 */
+ lwz 6,72+4(3) /* preloadpage->r6 */
+ lwz 7,80+4(3) /* preloadpage->r7 */
+ lwz 8,88+4(3) /* preloadpage->r8 */
+ lwz 9,96+4(3) /* preloadpage->r9 */
+ lwz 10,104+4(3) /* preloadpage->r10 */
+ lwz 3,48+4(3) /* preloadpage->r3 */
+ bctr
+ /*NOTREACHED*/
+ trap
+
+.Lfailed:
+ /* __loadx barfed for some reason. Print the error
+ message and get out. */
+ /* First the error msg */
+ lwz 3,512(1) /* restore r3 */
+ lwz 2,4(3) /* r2 =3D __NR_kwrite */
+ lwz 4,12(3) /* r4 =3D offset of err msg */
+ add 4,4,3 /* r4 =3D err msg */
+ lwz 5,16(3) /* r5 =3D length err msg */
+ li 3,2 /* r3 =3D stderr */
+ bl do_syscall
+ /* now call the diagnosis fn */
+ lwz 3,512(1) /* restore r3 */
+ lwz 4,112(3) /* preloadpage->p_diagnose_load_failure */
+ lwz 2,4(4) /* get its TOC ptr */
+ lwz 4,0(4) /* get its entry point */
+ mtlr 4
+ blrl
+ /* Now do _exit(1) */
+ lwz 3,512(1) /* restore r3 */
+ lwz 2,8(3) /* r2 =3D __NR_exit */
+ li 3,1 /* doing _exit(1) */
+ addi 1,1,1024 /* fix stack pointer */
+ bl do_syscall
+ /*NOTREACHED*/
+ trap
+=09
+do___loadx:
+ /* On entry: r2 =3D __NR___loadx, r6 =3D name of module */
+ li 3,1
+ slwi 3,3,24 /* r3 =3D 0x1000000 =3D VKI_DL_LOAD */
+ li 4,0
+ li 5,0
+ li 7,0
+ li 8,0
+ li 9,0
+ li 10,0
+do_syscall:
+ sc
+ /* sc continues at 'lr', hence this=20
+ constitutes an automatic return */
+
+
+ /* See comment in pub_core_trampoline.h for what this is for */
+.globl VG_(ppctoc_magic_redirect_return_stub)
+VG_(ppctoc_magic_redirect_return_stub):
+ trap
+=09
+.globl VG_(trampoline_stuff_end)
+VG_(trampoline_stuff_end):
+
+ /* and a trailing page of unexecutable code */
+ UD2_PAGE
+
+# undef UD2_16
+# undef UD2_64
+# undef UD2_256
+# undef UD2_1024
+# undef UD2_PAGE
+
+/*---------------- ppc64-aix5 ----------------*/
+#else
+#if defined(VGP_ppc64_aix5)
+
+# define UD2_16 trap ; trap ; trap; trap
+# define UD2_64 UD2_16 ; UD2_16 ; UD2_16 ; UD2_16
+# define UD2_256 UD2_64 ; UD2_64 ; UD2_64 ; UD2_64
+# define UD2_1024 UD2_256 ; UD2_256 ; UD2_256 ; UD2_256
+# define UD2_PAGE UD2_1024 ; UD2_1024 ; UD2_1024 ; UD2_1024 =20
+
+.globl VG_(trampoline_stuff_start)
+VG_(trampoline_stuff_start):
+/* See pub_core_trampoline.h for an explaination of this. Also
+ see pub_core_initimg.h, struct AIX5PreloadPage. On entry, r3
+ points to an AIX5PreloadPage structure. Note we can only=20
+ use r2-r10 as scratch registers here since those are the
+ only ones restored from the preload page when finally
+ starting the client. */
+.globl VG_(ppc64_aix5_do_preloads_then_start_client)
+VG_(ppc64_aix5_do_preloads_then_start_client):
+ stdu 1,-1024(1)
+ std 3,512(1) /* stash r3 512 bytes up stack */
+
+ /* Try to load .../vgpreload_core.so */
+ lwz 2,0(3) /* r2 =3D __NR_kload */
+ lwz 5,20(3) /* r5 =3D off_preloadcorename */
+ add 3,3,5 /* r6 =3D preloadcorename */
+ bl do_kload
+ cmpdi 0,3,0
+ beq .Lfailed
+
+ /* Try to load .../vgpreload_tool.so, if it exists */
+ ld 3,512(1) /* restore r3 */
+ lwz 2,0(3) /* r2 =3D __NR_kload */
+ lwz 5,24(3) /* r5 =3D off_preloadtoolname */
+ cmpwi 0,5,0 /* skip tool preload if */
+ beq .Ltry_preload /* name not present */
+ add 3,3,5 /* r6 =3D preloadtoolname */
+ bl do_kload
+ cmpdi 0,3,0
+ beq .Lfailed
+
+.Ltry_preload:
+ /* Try to load the LD_PRELOAD=3D file, if it exists */
+ ld 3,512(1) /* restore r3 */
+ lwz 2,0(3) /* r2 =3D __NR_kload */
+ lwz 5,28(3) /* r5 =3D off_ld_preloadname */
+ cmpwi 0,5,0 /* skip ld_preload if */
+ beq .Lstart_client /* name not present */
+ add 3,3,5 /* r6 =3D ld_preloadname */
+ bl do_kload
+ cmpdi 0,3,0
+ beq .Lfailed
+=09
+.Lstart_client:
+ /* Success. Restore r2-r10 from preloadpage-> and start
+ the client. */
+ ld 3,512(1) /* restore r3 */
+ addi 1,1,1024
+ ld 2,32+0(3) /* preloadpage->client_start */
+ mtctr 2
+ ld 2,40+0(3) /* preloadpage->r2 */
+ ld 4,56+0(3) /* preloadpage->r4 */
+ ld 5,64+0(3) /* preloadpage->r5 */
+ ld 6,72+0(3) /* preloadpage->r6 */
+ ld 7,80+0(3) /* preloadpage->r7 */
+ ld 8,88+0(3) /* preloadpage->r8 */
+ ld 9,96+0(3) /* preloadpage->r9 */
+ ld 10,104+0(3) /* preloadpage->r10 */
+ ld 3,48+0(3) /* preloadpage->r3 */
+ bctr
+ /*NOTREACHED*/
+ trap
+
+.Lfailed:
+ /* __loadx barfed for some reason. Print the error
+ message and get out. */
+ /* First the error msg */
+ ld 3,512(1) /* restore r3 */
+ lwz 2,4(3) /* r2 =3D __NR_kwrite */
+ lwz 4,12(3) /* r4 =3D offset of err msg */
+ add 4,4,3 /* r4 =3D err msg */
+ lwz 5,16(3) /* r5 =3D length err msg */
+ li 3,2 /* r3 =3D stderr */
+ bl do_syscall
+ /* now call the diagnosis fn */
+ ld 3,512(1) /* restore r3 */
+ ld 4,112(3) /* preloadpage->p_diagnose_load_failure */
+ ld 11,16(4)
+ ld 2,8(4) /* get its TOC ptr */
+ ld 4,0(4) /* get its entry point */
+ mtlr 4
+ blrl
+ /* Now do _exit(1) */
+ lwz 3,512(1) /* restore r3 */
+ lwz 2,8(3) /* r2 =3D __NR_exit */
+ li 3,1 /* doing _exit(1) */
+ addi 1,1,1024 /* fix stack pointer */
+ bl do_syscall
+ /*NOTREACHED*/
+ trap
+=09
+do_kload:
+ /* On entry: r2 =3D __NR_kload, r3 =3D name of module */
+ li 4,0
+ li 5,0
+ li 6,0
+ li 7,0
+ li 8,0
+ li 9,0
+ li 10,0
+do_syscall:
+ sc
+ /* sc continues at 'lr', hence this=20
+ constitutes an automatic return */
+
+ /* See comment in pub_core_trampoline.h for what this is for */
+.globl VG_(ppctoc_magic_redirect_return_stub)
+VG_(ppctoc_magic_redirect_return_stub):
+ trap
+=09
+.globl VG_(trampoline_stuff_end)
+VG_(trampoline_stuff_end):
+
+ /* and a trailing page of unexecutable code */
+ UD2_PAGE
+
+# undef UD2_16
+# undef UD2_64
+# undef UD2_256
+# undef UD2_1024
+# undef UD2_PAGE
+=09
/*---------------- unknown ----------------*/
#else
# error Unknown platform
@@ -385,11 +664,14 @@
#endif
#endif
#endif
+#endif
+#endif
=20
-
+#if defined(VGO_linux)
/* Let the linker know we don't need an executable stack */
.section .note.GNU-stack,"",@progbits
- =09
+#endif
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_trampoline.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
--- trunk/coregrind/pub_core_trampoline.h 2006-10-17 01:54:20 UTC (rev 62=
84)
+++ trunk/coregrind/pub_core_trampoline.h 2006-10-17 01:54:54 UTC (rev 62=
85)
@@ -79,13 +79,35 @@
extern void* VG_(ppc64_linux_REDIR_FOR_strchr)( void*, Int );
/* A label (sans dot) marking the ultra-magical return stub via which
all redirected and wrapped functions are made to "return" on
- ppc64-linux. The one insn at this label is never really
- translated. Instead, m_translate generates IR to restore the
- thread's LR and R2 registers from a small stack in the ppc64 guest
- state structure, and then branch to LR. Convoluted? Confusing?
- You betcha. Could I think of anything simpler? No. */
-extern void VG_(ppc64_linux_magic_redirect_return_stub);
+ ppc64-linux/ppc64-aix5/ppc32-aix5. The one insn at this label is
+ never really translated. Instead, m_translate generates IR to
+ restore the thread's LR and R2 registers from a small stack in the
+ ppc64 guest state structure, and then branch to LR. Convoluted?
+ Confusing? You betcha. Could I think of anything simpler? No. */
+extern void VG_(ppctoc_magic_redirect_return_stub);
#endif
+
+#if defined(VGP_ppc32_aix5)
+/* A label (sans dot) marking the client start point for ppc32_aix5.
+ This function is entered with r3 holding a pointer to the
+ AIX5PreloadPage struct set up by m_initimg. It first tries to
+ __loadx the _core.so and _tool.so preloads mentioned in the struct;
+ then it cleans up the register state to be more what it really
+ should be at client startup, and finally it jumps to the client's
+ real entry point. */
+extern void VG_(ppc32_aix5_do_preloads_then_start_client);
+
+/* See comment for VG_(ppctoc_magic_redirect_return_stub) above. */
+extern void VG_(ppctoc_magic_redirect_return_stub);
+#endif
+
+#if defined(VGP_ppc64_aix5)
+/* See comment for VG_(ppctoc_magic_redirect_return_stub) above. */
+extern void VG_(ppctoc_magic_redirect_return_stub);
+
+/* See comment for ppc32_aix5 equivalent above. */
+extern void VG_(ppc64_aix5_do_preloads_then_start_client);
+#endif
=20
#endif // __PUB_CORE_TRAMPOLINE_H
=20
|
|
From: <sv...@va...> - 2006-10-17 01:54:22
|
Author: sewardj
Date: 2006-10-17 02:54:20 +0100 (Tue, 17 Oct 2006)
New Revision: 6284
Log:
Merge r6152: Add dummy cases for AIX5.
Modified:
trunk/coregrind/m_debugger.c
Modified: trunk/coregrind/m_debugger.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
--- trunk/coregrind/m_debugger.c 2006-10-17 01:53:34 UTC (rev 6283)
+++ trunk/coregrind/m_debugger.c 2006-10-17 01:54:20 UTC (rev 6284)
@@ -46,7 +46,7 @@
=20
static Int ptrace_setregs(Int pid, VexGuestArchState* vex)
{
-#if defined(VGA_x86)
+#if defined(VGP_x86_linux)
struct vki_user_regs_struct regs;
regs.cs =3D vex->guest_CS;
regs.ss =3D vex->guest_SS;
@@ -66,7 +66,7 @@
regs.eip =3D vex->guest_EIP;
return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, ®s);
=20
-#elif defined(VGA_amd64)
+#elif defined(VGP_amd64_linux)
struct vki_user_regs_struct regs;
regs.rax =3D vex->guest_RAX;
regs.rbx =3D vex->guest_RBX;
@@ -88,7 +88,7 @@
regs.rip =3D vex->guest_RIP;
return VG_(ptrace)(VKI_PTRACE_SETREGS, pid, NULL, ®s);
=20
-#elif defined(VGA_ppc32)
+#elif defined(VGP_ppc32_linux)
Int rc =3D 0;
/* apparently the casting to void* is the Right Thing To Do */
rc |=3D VG_(ptrace)(VKI_PTRACE_POKEUSR, pid, (void*)(VKI_PT_R0 * 4),=
(void*)vex->guest_GPR0);
@@ -132,9 +132,15 @@
(void*)LibVEX_GuestPPC32_get_XER(vex));
return rc;
=20
-#elif defined(VGA_ppc64)
+#elif defined(VGP_ppc64_linux)
I_die_here;
=20
+#elif defined(VGP_ppc32_aix5)
+ I_die_here;
+
+#elif defined(VGP_ppc64_aix5)
+ I_die_here;
+
#else
# error Unknown arch
#endif
|
|
From: <sv...@va...> - 2006-10-17 01:53:43
|
Author: sewardj
Date: 2006-10-17 02:53:34 +0100 (Tue, 17 Oct 2006)
New Revision: 6283
Log:
Merge r6150 and 6151:
- track SysRes changes
- add AIX support
Modified:
trunk/coregrind/m_debuglog.c
trunk/coregrind/m_syscall.c
trunk/coregrind/pub_core_syscall.h
Modified: trunk/coregrind/m_debuglog.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
--- trunk/coregrind/m_debuglog.c 2006-10-17 01:52:05 UTC (rev 6282)
+++ trunk/coregrind/m_debuglog.c 2006-10-17 01:53:34 UTC (rev 6283)
@@ -47,6 +47,7 @@
stage1 and stage2. */
=20
#include "pub_core_basics.h" /* basic types */
+#include "pub_core_vkiscnums.h" /* for syscall numbers */
#include "pub_core_debuglog.h" /* our own iface */
#include "valgrind.h" /* for RUNNING_ON_VALGRIND */
=20
@@ -60,7 +61,7 @@
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Int block[2];
+ volatile Int block[2];
block[0] =3D (Int)buf;
block[1] =3D n;
__asm__ volatile (
@@ -69,7 +70,7 @@
"pushl %%ebx\n" /* save &block */
"movl 0(%%ebx), %%ecx\n" /* %ecx =3D buf */
"movl 4(%%ebx), %%edx\n" /* %edx =3D n */
- "movl $4, %%eax\n" /* %eax =3D __NR_write */
+ "movl $"VG_STRINGIFY(__NR_write)", %%eax\n" /* %eax =3D __NR_writ=
e */
"movl $1, %%ebx\n" /* %ebx =3D stderr */
"int $0x80\n" /* write(stderr, buf, n) */
"popl %%ebx\n" /* reestablish &block */
@@ -88,7 +89,7 @@
{
UInt __res;
__asm__ volatile (
- "movl $20, %%eax\n" /* set %eax =3D __NR_getpid */
+ "movl $"VG_STRINGIFY(__NR_getpid)", %%eax\n" /* %eax =3D __NR_getp=
id */
"int $0x80\n" /* getpid() */
"movl %%eax, %0\n" /* set __res =3D eax */
: "=3Dmr" (__res)
@@ -101,7 +102,7 @@
__attribute__((noinline))
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Long block[2];
+ volatile Long block[2];
block[0] =3D (Long)buf;
block[1] =3D n;
__asm__ volatile (
@@ -109,7 +110,7 @@
"pushq %%r15\n" /* r15 is callee-save */
"movq %0, %%r15\n" /* r15 =3D &block */
"pushq %%r15\n" /* save &block */
- "movq $1, %%rax\n" /* rax =3D __NR_write */
+ "movq $"VG_STRINGIFY(__NR_write)", %%rax\n" /* rax =3D __NR_write=
*/
"movq $2, %%rdi\n" /* rdi =3D stderr */
"movq 0(%%r15), %%rsi\n" /* rsi =3D buf */
"movq 8(%%r15), %%rdx\n" /* rdx =3D n */
@@ -131,7 +132,7 @@
{
UInt __res;
__asm__ volatile (
- "movq $39, %%rax\n" /* set %rax =3D __NR_getpid */
+ "movq $"VG_STRINGIFY(__NR_getpid)", %%rax\n" /* %rax =3D __NR_getp=
id */
"syscall\n" /* getpid() */
"movl %%eax, %0\n" /* set __res =3D %eax */
: "=3Dmr" (__res)
@@ -144,14 +145,14 @@
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Int block[2];
+ volatile Int block[2];
block[0] =3D (Int)buf;
block[1] =3D n;
__asm__ volatile (
"addi 1,1,-256\n\t"
"mr 5,%0\n\t" /* r5 =3D &block[0] */
"stw 5,0(1)\n\t" /* stash on stack */
- "li 0,4\n\t" /* set %r0 =3D __NR_write (=3D=3D 4) */
+ "li 0,"VG_STRINGIFY(__NR_write)"\n\t" /* set %r0 =3D __NR_write =
*/
"li 3,2\n\t" /* set %r3 =3D stderr */
"lwz 4,0(5)\n\t" /* set %r4 =3D buf */
"lwz 5,4(5)\n\t" /* set %r5 =3D n */
@@ -176,7 +177,7 @@
"li 0, %1\n\t"
"sc"
: "=3D&r" (__res)
- : "i" (20) /* =3D=3D __NR_getpid */
+ : "i" (__NR_getpid)
: "cc","memory","cr0","ctr",
"r0","r2","r4","r5","r6","r7","r8","r9","r10","r11","r12"
);
@@ -187,14 +188,14 @@
=20
static UInt local_sys_write_stderr ( HChar* buf, Int n )
{
- Long block[2];
+ volatile Long block[2];
block[0] =3D (Long)buf;
block[1] =3D (Long)n;
__asm__ volatile (
"addi 1,1,-256\n\t"
"mr 5,%0\n\t" /* r5 =3D &block[0] */
"std 5,0(1)\n\t" /* stash on stack */
- "li 0,4\n\t" /* set %r0 =3D __NR_write (=3D=3D 4) */
+ "li 0,"VG_STRINGIFY(__NR_write)"\n\t" /* %r0 =3D __NR_write */
"li 3,2\n\t" /* set %r3 =3D stderr */
"ld 4,0(5)\n\t" /* set %r4 =3D buf */
"ld 5,8(5)\n\t" /* set %r5 =3D n */
@@ -219,13 +220,179 @@
"li 0, %1\n\t"
"sc"
: "=3D&r" (__res)
- : "i" (20) /* =3D=3D __NR_getpid */
+ : "i" (__NR_getpid)
: "cc","memory","cr0","ctr",
"r0","r2","r4","r5","r6","r7","r8","r9","r10","r11","r12"
);
return (UInt)__res;
}
=20
+#elif defined(VGP_ppc32_aix5)
+
+static UInt local_sys_write_stderr ( HChar* buf, Int n )
+{
+ /* For some reason gcc-3.3.2 doesn't preserve r31 across the asm
+ even though we state it to be trashed. So use r27 instead. */
+ volatile UInt block[3];
+ block[0] =3D (UInt)buf;
+ block[1] =3D n;
+ block[2] =3D __NR_write;
+ __asm__ __volatile__ (
+ "mr 28,%0\n\t" /* establish base ptr */
+ "mr 27,2\n\t" /* save r2 in r27 */
+ "mflr 30\n\t" /* save lr in r30 */
+
+ "lwz 2,8(28)\n\t" /* set %r2 =3D __NR_write */
+ "li 3,2\n\t" /* set %r3 =3D stderr */
+ "lwz 4,0(28)\n\t" /* set %r4 =3D buf */
+ "lwz 5,4(28)\n\t" /* set %r5 =3D n */
+
+ ".long 0x48000005\n\t" /* bl .+4 */
+ "mflr 29\n\t"
+ "addi 29,29,20\n\t"
+ "mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
+ "sc\n\t" /* write() */
+
+ "stw 3,0(28)\n\t" /* result */
+ "stw 4,4(28)\n\t" /* error? */
+
+ "mr 2,27\n\t" /* restore r2 */
+ "mtlr 30" /* restore lr */
+
+ : /*out*/
+ : /*in*/ "b" (&block[0])
+ : /*trash*/
+ /*temps*/ "r31","r30","r29","r28","r27",
+ /*args*/ "r3","r4","r5","r6","r7","r8","r9","r10",
+ /*paranoia*/ "memory","cc","r0","r1","r11","r12","r13",
+ "xer","ctr","cr0","cr1","cr2","cr3",
+ "cr4","cr5","cr6","cr7"
+ );
+ if (block[1] !=3D 0)
+ return -1;
+ else
+ return block[0];
+}
+
+static UInt local_sys_getpid ( void )
+{
+ /* For some reason gcc-3.3.2 doesn't preserve r31 across the asm
+ even though we state it to be trashed. So use r27 instead. */
+ volatile UInt block[1];
+ block[0] =3D __NR_getpid;
+ __asm__ __volatile__ (
+ "mr 28,%0\n\t" /* establish base ptr */
+ "mr 27,2\n\t" /* save r2 in r27 */
+ "mflr 30\n\t" /* save lr in r30 */
+
+ "lwz 2,0(28)\n\t" /* set %r2 =3D __NR_getpid */
+
+ ".long 0x48000005\n\t" /* bl .+4 */
+ "mflr 29\n\t"
+ "addi 29,29,20\n\t"
+ "mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
+ "sc\n\t" /* getpid() */
+
+ "stw 3,0(28)\n\t" /* result -> block[0] */
+
+ "mr 2,27\n\t" /* restore r2 */
+ "mtlr 30" /* restore lr */
+
+ : /*out*/
+ : /*in*/ "b" (&block[0])
+ : /*trash*/
+ /*temps*/ "r31","r30","r29","r28","r27",
+ /*args*/ "r3","r4","r5","r6","r7","r8","r9","r10",
+ /*paranoia*/ "memory","cc","r0","r1","r11","r12","r13",
+ "xer","ctr","cr0","cr1","cr2","cr3",
+ "cr4","cr5","cr6","cr7"
+ );
+ return block[0];
+}
+
+#elif defined(VGP_ppc64_aix5)
+
+static UInt local_sys_write_stderr ( HChar* buf, Int n )
+{
+ volatile ULong block[3];
+ block[0] =3D (ULong)buf;
+ block[1] =3D n;
+ block[2] =3D (ULong)__NR_write;
+ __asm__ __volatile__ (
+ "mr 28,%0\n\t" /* establish base ptr */
+ "mr 27,2\n\t" /* save r2 in r27 */
+ "mflr 30\n\t" /* save lr in r30 */
+
+ "ld 2,16(28)\n\t" /* set %r2 =3D __NR_write */
+ "li 3,2\n\t" /* set %r3 =3D stderr */
+ "ld 4,0(28)\n\t" /* set %r4 =3D buf */
+ "ld 5,8(28)\n\t" /* set %r5 =3D n */
+
+ ".long 0x48000005\n\t" /* bl .+4 */
+ "mflr 29\n\t"
+ "addi 29,29,20\n\t"
+ "mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
+ "sc\n\t" /* write() */
+
+ "std 3,0(28)\n\t" /* result */
+ "std 4,8(28)\n\t" /* error? */
+
+ "mr 2,27\n\t" /* restore r2 */
+ "mtlr 30" /* restore lr */
+
+ : /*out*/
+ : /*in*/ "b" (&block[0])
+ : /*trash*/
+ /*temps*/ "r31","r30","r29","r28","r27",
+ /*args*/ "r3","r4","r5","r6","r7","r8","r9","r10",
+ /*paranoia*/ "memory","cc","r0","r1","r11","r12","r13",
+ "xer","ctr","cr0","cr1","cr2","cr3",
+ "cr4","cr5","cr6","cr7"
+ );
+ if (block[1] !=3D 0)
+ return (UInt)-1;
+ else
+ return (UInt)block[0];
+}
+
+static UInt local_sys_getpid ( void )
+{
+ volatile ULong block[1];
+ block[0] =3D __NR_getpid;
+ __asm__ __volatile__ (
+ "mr 28,%0\n\t" /* establish base ptr */
+ "mr 27,2\n\t" /* save r2 in r27 */
+ "mflr 30\n\t" /* save lr in r30 */
+
+ "ld 2,0(28)\n\t" /* set %r2 =3D __NR_getpid */
+
+ ".long 0x48000005\n\t" /* bl .+4 */
+ "mflr 29\n\t"
+ "addi 29,29,20\n\t"
+ "mtlr 29\n\t"
+ "crorc 6,6,6\n\t"
+ "sc\n\t" /* getpid() */
+
+ "std 3,0(28)\n\t" /* result -> block[0] */
+
+ "mr 2,27\n\t" /* restore r2 */
+ "mtlr 30" /* restore lr */
+
+ : /*out*/
+ : /*in*/ "b" (&block[0])
+ : /*trash*/
+ /*temps*/ "r31","r30","r29","r28","r27",
+ /*args*/ "r3","r4","r5","r6","r7","r8","r9","r10",
+ /*paranoia*/ "memory","cc","r0","r1","r11","r12","r13",
+ "xer","ctr","cr0","cr1","cr2","cr3",
+ "cr4","cr5","cr6","cr7"
+ );
+ return (UInt)block[0];
+}
+
#else
# error Unknown platform
#endif
Modified: trunk/coregrind/m_syscall.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
--- trunk/coregrind/m_syscall.c 2006-10-17 01:52:05 UTC (rev 6282)
+++ trunk/coregrind/m_syscall.c 2006-10-17 01:53:34 UTC (rev 6283)
@@ -30,6 +30,7 @@
=20
#include "pub_core_basics.h"
#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_syscall.h"
=20
/* ---------------------------------------------------------------------
@@ -58,7 +59,13 @@
SysRes VG_(mk_SysRes_x86_linux) ( UInt val ) {
SysRes res;
res.isError =3D val >=3D -4095 && val <=3D -1;
- res.val =3D res.isError ? -val : val;
+ if (res.isError) {
+ res.err =3D -val;
+ res.res =3D 0;
+ } else {
+ res.err =3D 0;
+ res.res =3D val;
+ }
return res;
}
=20
@@ -66,16 +73,28 @@
SysRes VG_(mk_SysRes_amd64_linux) ( ULong val ) {
SysRes res;
res.isError =3D val >=3D -4095 && val <=3D -1;
- res.val =3D res.isError ? -val : val;
+ if (res.isError) {
+ res.err =3D -val;
+ res.res =3D 0;
+ } else {
+ res.err =3D 0;
+ res.res =3D val;
+ }
return res;
}
=20
-/* PPC uses the CR7.SO bit to flag an error (CR0 in IBM-speke) */
+/* PPC uses the CR7.SO bit to flag an error (CR0 in IBM-speak) */
/* Note this must be in the bottom bit of the second arg */
SysRes VG_(mk_SysRes_ppc32_linux) ( UInt val, UInt cr0so ) {
SysRes res;
res.isError =3D (cr0so & 1) !=3D 0;
- res.val =3D val;
+ if (res.isError) {
+ res.err =3D val;
+ res.res =3D 0;
+ } else {
+ res.err =3D 0;
+ res.res =3D val;
+ }
return res;
}
=20
@@ -83,22 +102,54 @@
SysRes VG_(mk_SysRes_ppc64_linux) ( ULong val, ULong cr0so ) {
SysRes res;
res.isError =3D (cr0so & 1) !=3D 0;
- res.val =3D val;
+ if (res.isError) {
+ res.err =3D val;
+ res.res =3D 0;
+ } else {
+ res.err =3D 0;
+ res.res =3D val;
+ }
return res;
}
=20
+/* AIX scheme: we have to record both 'res' (r3) and 'err' (r4). If
+ 'err' is nonzero then the call has failed, but it could still be
+ that AIX userspace will ignore 'err' and instead consult 'res' to
+ determine if the call failed. So we have to record both. */
+SysRes VG_(mk_SysRes_ppc32_aix5) ( UInt res, UInt err ) {
+ SysRes r;
+ r.res =3D res;
+ r.err =3D err;
+ r.isError =3D r.err !=3D 0;
+ return r;
+}
=20
-SysRes VG_(mk_SysRes_Error) ( UWord val ) {
- SysRes r =3D { val, True };
+SysRes VG_(mk_SysRes_ppc64_aix5) ( ULong res, ULong err ) {
+ SysRes r;
+ r.res =3D res;
+ r.err =3D err;
+ r.isError =3D r.err !=3D 0;
return r;
}
=20
-SysRes VG_(mk_SysRes_Success) ( UWord val ) {
- SysRes r =3D { val, False };
+/* Generic constructors. */
+SysRes VG_(mk_SysRes_Error) ( UWord err ) {
+ SysRes r;
+ r.res =3D 0;
+ r.err =3D err;
+ r.isError =3D True;
return r;
}
=20
+SysRes VG_(mk_SysRes_Success) ( UWord res ) {
+ SysRes r;
+ r.res =3D res;
+ r.err =3D 0;
+ r.isError =3D False;
+ return r;
+}
=20
+
/* ---------------------------------------------------------------------
A function for doing syscalls.
------------------------------------------------------------------ */
@@ -247,24 +298,181 @@
" std 3,8(5)\n" /* argblock[1] =3D cr0.s0 & 1 */
" blr\n"
);
+
+#elif defined(VGP_ppc32_aix5)
+static void do_syscall_WRK ( UWord* res_r3, UWord* res_r4,
+ UWord sysno,=20
+ UWord a1, UWord a2, UWord a3,
+ UWord a4, UWord a5, UWord a6,
+ UWord a7, UWord a8 )
+{
+ /* Syscalls on AIX are very similar to function calls:
+ - up to 8 args in r3-r10
+ - syscall number in r2
+ - kernel resumes at 'lr', so must set it appropriately beforehand
+ - r3 holds the result and r4 any applicable error code
+ See http://www.cs.utexas.edu/users/cart/publications/tr00-04.ps
+ and also 'man truss'.
+ */
+ /* For some reason gcc-3.3.2 doesn't preserve r31 across the asm
+ even though we state it to be trashed. So use r27 instead. */
+ UWord args[9];
+ args[0] =3D sysno;
+ args[1] =3D a1; args[2] =3D a2;
+ args[3] =3D a3; args[4] =3D a4;
+ args[5] =3D a5; args[6] =3D a6;
+ args[7] =3D a7; args[8] =3D a8;
+
+ __asm__ __volatile__(
+
+ // establish base ptr
+ "mr 28,%0\n\t"
+
+ // save r2, lr
+ "mr 27,2\n\t" // save r2 in r27
+ "mflr 30\n\t" // save lr in r30
+
+ // set syscall number and args
+ "lwz 2, 0(28)\n\t"
+ "lwz 3, 4(28)\n\t"
+ "lwz 4, 8(28)\n\t"
+ "lwz 5, 12(28)\n\t"
+ "lwz 6, 16(28)\n\t"
+ "lwz 7, 20(28)\n\t"
+ "lwz 8, 24(28)\n\t"
+ "lwz 9, 28(28)\n\t"
+ "lwz 10, 32(28)\n\t"
+
+ // set up LR to point just after the sc insn
+ ".long 0x48000005\n\t" // "bl here+4" -- lr :=3D & next insn
+ "mflr 29\n\t"
+ "addi 29,29,20\n\t"
+ "mtlr 29\n\t"
+
+ // set bit 3 of CR1 otherwise AIX 5.1 returns to the
+ // wrong address after the sc instruction
+ "crorc 6,6,6\n\t"
+
+ // do it!
+ "sc\n\t"
+
+ // result is now in r3; save it in args[0]
+ "stw 3,0(28)\n\t"
+ // error code in r4; save it in args[1]
+ "stw 4,4(28)\n\t"
+
+ // restore
+ "mr 2,27\n\t"
+ "mtlr 30\n\t"
+
+ : /*out*/
+ : /*in*/ "b" (&args[0])
+ : /*trash*/
+ /*temps*/ "r31","r30","r29","r28","r27",
+ /*args*/ "r3","r4","r5","r6","r7","r8","r9","r10",
+ /*paranoia*/ "memory","cc","r0","r1","r11","r12","r13",
+ "xer","ctr","cr0","cr1","cr2","cr3",
+ "cr4","cr5","cr6","cr7"
+ );
+
+ *res_r3 =3D args[0];
+ *res_r4 =3D args[1];
+}
+
+#elif defined(VGP_ppc64_aix5)
+static void do_syscall_WRK ( UWord* res_r3, UWord* res_r4,
+ UWord sysno,=20
+ UWord a1, UWord a2, UWord a3,
+ UWord a4, UWord a5, UWord a6,
+ UWord a7, UWord a8 )
+{
+ /* Same scheme as ppc32-aix5. */
+ UWord args[9];
+ args[0] =3D sysno;
+ args[1] =3D a1; args[2] =3D a2;
+ args[3] =3D a3; args[4] =3D a4;
+ args[5] =3D a5; args[6] =3D a6;
+ args[7] =3D a7; args[8] =3D a8;
+
+ __asm__ __volatile__(
+
+ // establish base ptr
+ "mr 28,%0\n\t"
+
+ // save r2, lr
+ "mr 27,2\n\t" // save r2 in r27
+ "mflr 30\n\t" // save lr in r30
+
+ // set syscall number and args
+ "ld 2, 0(28)\n\t"
+ "ld 3, 8(28)\n\t"
+ "ld 4, 16(28)\n\t"
+ "ld 5, 24(28)\n\t"
+ "ld 6, 32(28)\n\t"
+ "ld 7, 40(28)\n\t"
+ "ld 8, 48(28)\n\t"
+ "ld 9, 56(28)\n\t"
+ "ld 10, 64(28)\n\t"
+
+ // set up LR to point just after the sc insn
+ ".long 0x48000005\n\t" // "bl here+4" -- lr :=3D & next insn
+ "mflr 29\n\t"
+ "addi 29,29,20\n\t"
+ "mtlr 29\n\t"
+
+ // set bit 3 of CR1 otherwise AIX 5.1 returns to the
+ // wrong address after the sc instruction
+ "crorc 6,6,6\n\t"
+
+ // do it!
+ "sc\n\t"
+
+ // result is now in r3; save it in args[0]
+ "std 3,0(28)\n\t"
+ // error code in r4; save it in args[1]
+ "std 4,8(28)\n\t"
+
+ // restore
+ "mr 2,27\n\t"
+ "mtlr 30\n\t"
+
+ : /*out*/
+ : /*in*/ "b" (&args[0])
+ : /*trash*/
+ /*temps*/ "r31","r30","r29","r28","r27",
+ /*args*/ "r3","r4","r5","r6","r7","r8","r9","r10",
+ /*paranoia*/ "memory","cc","r0","r1","r11","r12","r13",
+ "xer","ctr","cr0","cr1","cr2","cr3",
+ "cr4","cr5","cr6","cr7"
+ );
+
+ *res_r3 =3D args[0];
+ *res_r4 =3D args[1];
+}
+
#else
# error Unknown platform
#endif
=20
+
SysRes VG_(do_syscall) ( UWord sysno, UWord a1, UWord a2, UWord a3,
- UWord a4, UWord a5, UWord a6 )
+ UWord a4, UWord a5, UWord a6,
+ UWord a7, UWord a8 )
{
#if defined(VGP_x86_linux)
UWord val =3D do_syscall_WRK(sysno,a1,a2,a3,a4,a5,a6);
return VG_(mk_SysRes_x86_linux)( val );
+
#elif defined(VGP_amd64_linux)
UWord val =3D do_syscall_WRK(sysno,a1,a2,a3,a4,a5,a6);
return VG_(mk_SysRes_amd64_linux)( val );
+
#elif defined(VGP_ppc32_linux)
ULong ret =3D do_syscall_WRK(sysno,a1,a2,a3,a4,a5,a6);
UInt val =3D (UInt)(ret>>32);
UInt cr0so =3D (UInt)(ret);
return VG_(mk_SysRes_ppc32_linux)( val, cr0so );
+
#elif defined(VGP_ppc64_linux)
ULong argblock[7];
argblock[0] =3D sysno;
@@ -276,6 +484,47 @@
argblock[6] =3D a6;
do_syscall_WRK( &argblock[0] );
return VG_(mk_SysRes_ppc64_linux)( argblock[0], argblock[1] );
+
+#elif defined(VGP_ppc32_aix5)
+ UWord res;
+ UWord err;
+ do_syscall_WRK( &res, &err,=20
+ sysno, a1, a2, a3, a4, a5, a6, a7, a8);
+ /* Try to set the error number to zero if the syscall hasn't
+ really failed. */
+ if (sysno =3D=3D __NR_AIX5_kread
+ || sysno =3D=3D __NR_AIX5_kwrite) {
+ if (res !=3D (UWord)-1L)
+ err =3D 0;
+ }
+ else if (sysno =3D=3D __NR_AIX5_sigprocmask
+ || sysno =3D=3D __NR_AIX5__sigpending) {
+ if (res =3D=3D 0)
+ err =3D 0;
+ }
+
+ return VG_(mk_SysRes_ppc32_aix5)( res, err );
+
+#elif defined(VGP_ppc64_aix5)
+ UWord res;
+ UWord err;
+ do_syscall_WRK( &res, &err,=20
+ sysno, a1, a2, a3, a4, a5, a6, a7, a8);
+ /* Try to set the error number to zero if the syscall hasn't
+ really failed. */
+ if (sysno =3D=3D __NR_AIX5_kread
+ || sysno =3D=3D __NR_AIX5_kwrite) {
+ if (res !=3D (UWord)-1L)
+ err =3D 0;
+ }
+ else if (sysno =3D=3D __NR_AIX5_sigprocmask
+ || sysno =3D=3D __NR_AIX5__sigpending) {
+ if (res =3D=3D 0)
+ err =3D 0;
+ }
+
+ return VG_(mk_SysRes_ppc64_aix5)( res, err );
+
#else
# error Unknown platform
#endif
Modified: trunk/coregrind/pub_core_syscall.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
--- trunk/coregrind/pub_core_syscall.h 2006-10-17 01:52:05 UTC (rev 6282)
+++ trunk/coregrind/pub_core_syscall.h 2006-10-17 01:53:34 UTC (rev 6283)
@@ -46,25 +46,31 @@
=20
extern SysRes VG_(do_syscall) ( UWord sysno,=20
UWord, UWord, UWord,=20
- UWord, UWord, UWord );
+ UWord, UWord, UWord,=20
+ UWord, UWord );
=20
/* Macros make life easier. */
=20
-#define vgPlain_do_syscall0(s) VG_(do_syscall)((s),0,0,0,0,0=
,0)
-#define vgPlain_do_syscall1(s,a) VG_(do_syscall)((s),(a),0,0,0=
,0,0)
-#define vgPlain_do_syscall2(s,a,b) VG_(do_syscall)((s),(a),(b),0=
,0,0,0)
-#define vgPlain_do_syscall3(s,a,b,c) VG_(do_syscall)((s),(a),(b),(=
c),0,0,0)
+#define vgPlain_do_syscall0(s) VG_(do_syscall)((s),0,0,0,0,0=
,0,0,0)
+#define vgPlain_do_syscall1(s,a) VG_(do_syscall)((s),(a),\
+ 0,0,0,0,0,0,0=
)
+#define vgPlain_do_syscall2(s,a,b) VG_(do_syscall)((s),(a),(b),\
+ 0,0,0,0,0,0)
+#define vgPlain_do_syscall3(s,a,b,c) VG_(do_syscall)((s),(a),(b),(=
c),\
+ 0,0,0,0,0)
#define vgPlain_do_syscall4(s,a,b,c,d) VG_(do_syscall)((s),(a),(b),\
- (c),(d),0,0)
+ (c),(d),0,0,0=
,0)
#define vgPlain_do_syscall5(s,a,b,c,d,e) VG_(do_syscall)((s),(a),(b),\
- (c),(d),(e),0=
)
-#define vgPlain_do_syscall6(s,a,b,c,d,e,f) VG_(do_syscall)((s),(a),(b),\
- (c),(d),(e),(=
f))
+ (c),(d),(e),0=
,0,0)
+#define vgPlain_do_syscall6(s,a,b,c,d,e,f) VG_(do_syscall)((s),(a),(b),(=
c),\
+ (d),(e),(f),0=
,0)
=20
extern SysRes VG_(mk_SysRes_x86_linux) ( UInt val );
extern SysRes VG_(mk_SysRes_amd64_linux) ( ULong val );
extern SysRes VG_(mk_SysRes_ppc32_linux) ( UInt val, UInt cr0so );
extern SysRes VG_(mk_SysRes_ppc64_linux) ( ULong val, ULong cr0so );
+extern SysRes VG_(mk_SysRes_ppc32_aix5) ( UInt val, UInt err );
+extern SysRes VG_(mk_SysRes_ppc64_aix5) ( ULong val, ULong err );
extern SysRes VG_(mk_SysRes_Error) ( UWord val );
extern SysRes VG_(mk_SysRes_Success) ( UWord val );
=20
|
|
From: <sv...@va...> - 2006-10-17 01:52:13
|
Author: sewardj
Date: 2006-10-17 02:52:05 +0100 (Tue, 17 Oct 2006)
New Revision: 6282
Log:
Merge r6149:
Generalise the machinery developed for function intercepts/wrapping
ppc64-linux, in which we have to deal with the big extra complexity
resulting from TOC pointers. This generalises it to work in 32-bit
mode too.
Add helpers to deal with AIX stack redzones.
Track VG_(am_find_nsegment) constness change and other minor=20
changes to the m_aspacemgr interface.
(All platforms): use the new VexMiscInfo structure to tell VEX about
host and guest ABI conventions.
This module could do with further tidying up and documentation.
Modified:
trunk/coregrind/m_translate.c
Modified: trunk/coregrind/m_translate.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
--- trunk/coregrind/m_translate.c 2006-10-17 01:51:24 UTC (rev 6281)
+++ trunk/coregrind/m_translate.c 2006-10-17 01:52:05 UTC (rev 6282)
@@ -54,7 +54,7 @@
// VG_(run_a_noredir_translation__return_=
point)
=20
#include "pub_core_threadstate.h" // VexGuestArchState
-#include "pub_core_trampoline.h" // VG_(ppc64_linux_magic_redirect_ret=
urn_stub)
+#include "pub_core_trampoline.h" // VG_(ppctoc_magic_redirect_return_s=
tub)
=20
=20
/*------------------------------------------------------------*/
@@ -474,7 +474,9 @@
=20
/* Vex dumps the final code in here. Then we can copy it off
wherever we like. */
-#define N_TMPBUF 20000
+/* 60000: should agree with assertion in VG_(add_to_transtab) in
+ m_transtab.c. */
+#define N_TMPBUF 60000
static UChar tmpbuf[N_TMPBUF];
=20
=20
@@ -504,7 +506,7 @@
/* Look for reasons to disallow making translations from the given
segment. */
=20
-static Bool translations_allowable_from_seg ( NSegment* seg )
+static Bool translations_allowable_from_seg ( NSegment const* seg )
{
# if defined(VGA_x86)
Bool allowR =3D True;
@@ -520,7 +522,7 @@
/* Is a self-check required for a translation of a guest address
inside segment SEG when requested by thread TID ? */
=20
-static Bool self_check_required ( NSegment* seg, ThreadId tid )
+static Bool self_check_required ( NSegment const* seg, ThreadId tid )
{
switch (VG_(clo_smc_check)) {
case Vg_SmcNone: return False;
@@ -548,7 +550,7 @@
static Bool chase_into_ok ( void* closureV, Addr64 addr64 )
{
Addr addr =3D (Addr)addr64;
- NSegment* seg =3D VG_(am_find_nsegment)(addr);
+ NSegment const* seg =3D VG_(am_find_nsegment)(addr);
VgCallbackClosure* closure =3D (VgCallbackClosure*)closureV;
=20
/* Work through a list of possibilities why we might not want to
@@ -566,9 +568,12 @@
if (addr !=3D VG_(redir_do_lookup)(addr, NULL))
goto dontchase;
=20
-# if defined(VGP_ppc64_linux)
- /* This needs to be at the start of its own block. Don't chase. */
- if (addr64 =3D=3D (Addr64)&VG_(ppc64_linux_magic_redirect_return_stub=
))
+# if defined(VG_PLAT_USES_PPCTOC)
+ /* This needs to be at the start of its own block. Don't chase. Re
+ ULong_to_Ptr, be careful to ensure we only compare 32 bits on a
+ 32-bit target.*/
+ if (ULong_to_Ptr(addr64)
+ =3D=3D (void*)&VG_(ppctoc_magic_redirect_return_stub))
goto dontchase;
# endif
=20
@@ -584,36 +589,84 @@
}
=20
=20
-/* --------------- ppc64-linux specific helpers --------------- */
+/* --------------- helpers for with-TOC platforms --------------- */
=20
+/* NOTE: with-TOC platforms are: ppc64-linux, ppc32-aix5, ppc64-aix5. */
+
static IRExpr* mkU64 ( ULong n ) {
return IRExpr_Const(IRConst_U64(n));
}
static IRExpr* mkU32 ( UInt n ) {
return IRExpr_Const(IRConst_U32(n));
}
-#if defined(VGP_ppc64_linux)
+
+#if defined(VG_PLAT_USES_PPCTOC)
static IRExpr* mkU8 ( UChar n ) {
return IRExpr_Const(IRConst_U8(n));
}
+static IRExpr* narrowTo32 ( IRTypeEnv* tyenv, IRExpr* e ) {
+ if (typeOfIRExpr(tyenv, e) =3D=3D Ity_I32) {
+ return e;
+ } else {
+ vg_assert(typeOfIRExpr(tyenv, e) =3D=3D Ity_I64);
+ return IRExpr_Unop(Iop_64to32, e);
+ }
+}
=20
+/* Generate code to push word-typed expression 'e' onto this thread's
+ redir stack, checking for stack overflow and generating code to
+ bomb out if so. */
+
static void gen_PUSH ( IRBB* bb, IRExpr* e )
{
- Int stack_size =3D VEX_GUEST_PPC64_REDIR_STACK_SIZE;
- Int offB_REDIR_SP =3D offsetof(VexGuestPPC64State,guest_REDIR_SP);
- Int offB_REDIR_STACK =3D offsetof(VexGuestPPC64State,guest_REDIR_STAC=
K);
- Int offB_EMWARN =3D offsetof(VexGuestPPC64State,guest_EMWARN);
+ IRArray* descr;
+ IRTemp t1;
+ IRExpr* one;
=20
- IRArray* descr =3D mkIRArray( offB_REDIR_STACK, Ity_I64, stack_size )=
;
- IRTemp t1 =3D newIRTemp( bb->tyenv, Ity_I64 );
- IRExpr* one =3D mkU64(1);
+# if defined(VGP_ppc64_linux) || defined(VGP_ppc64_aix5)
+ Int stack_size =3D VEX_GUEST_PPC64_REDIR_STACK_SIZE;
+ Int offB_REDIR_SP =3D offsetof(VexGuestPPC64State,guest_REDIR_S=
P);
+ Int offB_REDIR_STACK =3D offsetof(VexGuestPPC64State,guest_REDIR_S=
TACK);
+ Int offB_EMWARN =3D offsetof(VexGuestPPC64State,guest_EMWARN)=
;
+ Bool is64 =3D True;
+ IRType ty_Word =3D Ity_I64;
+ IROp op_CmpNE =3D Iop_CmpNE64;
+ IROp op_Sar =3D Iop_Sar64;
+ IROp op_Sub =3D Iop_Sub64;
+ IROp op_Add =3D Iop_Add64;
+ IRExpr*(*mkU)(ULong) =3D mkU64;
+ vg_assert(VG_WORDSIZE =3D=3D 8);
+# else
+ Int stack_size =3D VEX_GUEST_PPC32_REDIR_STACK_SIZE;
+ Int offB_REDIR_SP =3D offsetof(VexGuestPPC32State,guest_REDIR_S=
P);
+ Int offB_REDIR_STACK =3D offsetof(VexGuestPPC32State,guest_REDIR_S=
TACK);
+ Int offB_EMWARN =3D offsetof(VexGuestPPC32State,guest_EMWARN)=
;
+ Bool is64 =3D False;
+ IRType ty_Word =3D Ity_I32;
+ IROp op_CmpNE =3D Iop_CmpNE32;
+ IROp op_Sar =3D Iop_Sar32;
+ IROp op_Sub =3D Iop_Sub32;
+ IROp op_Add =3D Iop_Add32;
+ IRExpr*(*mkU)(UInt) =3D mkU32;
+ vg_assert(VG_WORDSIZE =3D=3D 4);
+# endif
=20
+ vg_assert(sizeof(void*) =3D=3D VG_WORDSIZE);
+ vg_assert(sizeof(Word) =3D=3D VG_WORDSIZE);
+ vg_assert(sizeof(Addr) =3D=3D VG_WORDSIZE);
+
+ descr =3D mkIRArray( offB_REDIR_STACK, ty_Word, stack_size );
+ t1 =3D newIRTemp( bb->tyenv, ty_Word );
+ one =3D mkU(1);
+
+ vg_assert(typeOfIRExpr(bb->tyenv, e) =3D=3D ty_Word);
+
/* t1 =3D guest_REDIR_SP + 1 */
addStmtToIRBB(
bb,=20
IRStmt_Tmp(
t1,=20
- IRExpr_Binop(Iop_Add64, IRExpr_Get( offB_REDIR_SP, Ity_I64 ), o=
ne)
+ IRExpr_Binop(op_Add, IRExpr_Get( offB_REDIR_SP, ty_Word ), one)
)
);
=20
@@ -630,16 +683,16 @@
bb,
IRStmt_Exit(
IRExpr_Binop(
- Iop_CmpNE64,
+ op_CmpNE,
IRExpr_Binop(
- Iop_Sar64,
- IRExpr_Binop(Iop_Sub64,mkU64(stack_size-1),IRExpr_Tmp(t1)=
),
- mkU8(63)
+ op_Sar,
+ IRExpr_Binop(op_Sub,mkU(stack_size-1),IRExpr_Tmp(t1)),
+ mkU8(8 * VG_WORDSIZE - 1)
),
- mkU64(0)
+ mkU(0)
),
Ijk_EmFail,
- IRConst_U64(0)
+ is64 ? IRConst_U64(0) : IRConst_U32(0)
)
);
=20
@@ -647,28 +700,57 @@
addStmtToIRBB(bb, IRStmt_Put(offB_REDIR_SP, IRExpr_Tmp(t1)));
=20
/* guest_REDIR_STACK[t1+0] =3D e */
+ /* PutI/GetI have I32-typed indexes regardless of guest word size */
addStmtToIRBB(
bb,=20
- IRStmt_PutI(descr, IRExpr_Unop(Iop_64to32,IRExpr_Tmp(t1)), 0, e)
+ IRStmt_PutI(descr, narrowTo32(bb->tyenv,IRExpr_Tmp(t1)), 0, e)
);
}
=20
+
+/* Generate code to pop a word-sized value from this thread's redir
+ stack, binding it to a new temporary, which is returned. As with
+ gen_PUSH, an overflow check is also performed. */
+
static IRTemp gen_POP ( IRBB* bb )
{
- Int stack_size =3D VEX_GUEST_PPC64_REDIR_STACK_SIZE;
- Int offB_REDIR_SP =3D offsetof(VexGuestPPC64State,guest_REDIR_SP);
- Int offB_REDIR_STACK =3D offsetof(VexGuestPPC64State,guest_REDIR_STAC=
K);
- Int offB_EMWARN =3D offsetof(VexGuestPPC64State,guest_EMWARN);
+# if defined(VGP_ppc64_linux) || defined(VGP_ppc64_aix5)
+ Int stack_size =3D VEX_GUEST_PPC64_REDIR_STACK_SIZE;
+ Int offB_REDIR_SP =3D offsetof(VexGuestPPC64State,guest_REDIR_S=
P);
+ Int offB_REDIR_STACK =3D offsetof(VexGuestPPC64State,guest_REDIR_S=
TACK);
+ Int offB_EMWARN =3D offsetof(VexGuestPPC64State,guest_EMWARN)=
;
+ Bool is64 =3D True;
+ IRType ty_Word =3D Ity_I64;
+ IROp op_CmpNE =3D Iop_CmpNE64;
+ IROp op_Sar =3D Iop_Sar64;
+ IROp op_Sub =3D Iop_Sub64;
+ IRExpr*(*mkU)(ULong) =3D mkU64;
+# else
+ Int stack_size =3D VEX_GUEST_PPC32_REDIR_STACK_SIZE;
+ Int offB_REDIR_SP =3D offsetof(VexGuestPPC32State,guest_REDIR_S=
P);
+ Int offB_REDIR_STACK =3D offsetof(VexGuestPPC32State,guest_REDIR_S=
TACK);
+ Int offB_EMWARN =3D offsetof(VexGuestPPC32State,guest_EMWARN)=
;
+ Bool is64 =3D False;
+ IRType ty_Word =3D Ity_I32;
+ IROp op_CmpNE =3D Iop_CmpNE32;
+ IROp op_Sar =3D Iop_Sar32;
+ IROp op_Sub =3D Iop_Sub32;
+ IRExpr*(*mkU)(UInt) =3D mkU32;
+# endif
=20
- IRArray* descr =3D mkIRArray( offB_REDIR_STACK, Ity_I64, stack_size )=
;
- IRTemp t1 =3D newIRTemp( bb->tyenv, Ity_I64 );
- IRTemp res =3D newIRTemp( bb->tyenv, Ity_I64 );
- IRExpr* one =3D mkU64(1);
+ IRArray* descr =3D mkIRArray( offB_REDIR_STACK, ty_Word, stack_size )=
;
+ IRTemp t1 =3D newIRTemp( bb->tyenv, ty_Word );
+ IRTemp res =3D newIRTemp( bb->tyenv, ty_Word );
+ IRExpr* one =3D mkU(1);
=20
+ vg_assert(sizeof(void*) =3D=3D VG_WORDSIZE);
+ vg_assert(sizeof(Word) =3D=3D VG_WORDSIZE);
+ vg_assert(sizeof(Addr) =3D=3D VG_WORDSIZE);
+
/* t1 =3D guest_REDIR_SP */
addStmtToIRBB(
bb,=20
- IRStmt_Tmp( t1, IRExpr_Get( offB_REDIR_SP, Ity_I64 ) )
+ IRStmt_Tmp( t1, IRExpr_Get( offB_REDIR_SP, ty_Word ) )
);
=20
/* Bomb out if t1 < 0. Same comments as gen_PUSH apply. */
@@ -680,54 +762,77 @@
bb,
IRStmt_Exit(
IRExpr_Binop(
- Iop_CmpNE64,
+ op_CmpNE,
IRExpr_Binop(
- Iop_Sar64,
+ op_Sar,
IRExpr_Tmp(t1),
- mkU8(63)
+ mkU8(8 * VG_WORDSIZE - 1)
),
- mkU64(0)
+ mkU(0)
),
Ijk_EmFail,
- IRConst_U64(0)
+ is64 ? IRConst_U64(0) : IRConst_U32(0)
)
);
=20
/* res =3D guest_REDIR_STACK[t1+0] */
+ /* PutI/GetI have I32-typed indexes regardless of guest word size */
addStmtToIRBB(
bb,
IRStmt_Tmp(
res,=20
- IRExpr_GetI(descr, IRExpr_Unop(Iop_64to32,IRExpr_Tmp(t1)), 0)
+ IRExpr_GetI(descr, narrowTo32(bb->tyenv,IRExpr_Tmp(t1)), 0)
)
);
=20
/* guest_REDIR_SP =3D t1-1 */
addStmtToIRBB(
bb,=20
- IRStmt_Put(offB_REDIR_SP, IRExpr_Binop(Iop_Sub64, IRExpr_Tmp(t1), =
one))
+ IRStmt_Put(offB_REDIR_SP, IRExpr_Binop(op_Sub, IRExpr_Tmp(t1), one=
))
);
=20
return res;
}
=20
+/* Generate code to push LR and R2 onto this thread's redir stack,
+ then set R2 to the new value (which is the TOC pointer to be used
+ for the duration of the replacement function, as determined by
+ m_debuginfo), and set LR to the magic return stub, so we get to
+ intercept the return and restore R2 and L2 to the values saved
+ here. */
+
static void gen_push_and_set_LR_R2 ( IRBB* bb, Addr64 new_R2_value )
{
- Addr64 bogus_RA =3D (Addr64)&VG_(ppc64_linux_magic_redirect_return_st=
ub);
- Int offB_GPR2 =3D offsetof(VexGuestPPC64State,guest_GPR2);
- Int offB_LR =3D offsetof(VexGuestPPC64State,guest_LR);
+# if defined(VGP_ppc64_linux) || defined(VGP_ppc64_aix5)
+ Addr64 bogus_RA =3D (Addr64)&VG_(ppctoc_magic_redirect_return_stub);
+ Int offB_GPR2 =3D offsetof(VexGuestPPC64State,guest_GPR2);
+ Int offB_LR =3D offsetof(VexGuestPPC64State,guest_LR);
gen_PUSH( bb, IRExpr_Get(offB_LR, Ity_I64) );
gen_PUSH( bb, IRExpr_Get(offB_GPR2, Ity_I64) );
addStmtToIRBB( bb, IRStmt_Put( offB_LR, mkU64( bogus_RA )) );
addStmtToIRBB( bb, IRStmt_Put( offB_GPR2, mkU64( new_R2_value )) );
+
+# elif defined(VGP_ppc32_aix5)
+ Addr32 bogus_RA =3D (Addr32)&VG_(ppctoc_magic_redirect_return_stub);
+ Int offB_GPR2 =3D offsetof(VexGuestPPC32State,guest_GPR2);
+ Int offB_LR =3D offsetof(VexGuestPPC32State,guest_LR);
+ gen_PUSH( bb, IRExpr_Get(offB_LR, Ity_I32) );
+ gen_PUSH( bb, IRExpr_Get(offB_GPR2, Ity_I32) );
+ addStmtToIRBB( bb, IRStmt_Put( offB_LR, mkU32( bogus_RA )) );
+ addStmtToIRBB( bb, IRStmt_Put( offB_GPR2, mkU32( new_R2_value )) );
+
+# else
+# error Platform is not TOC-afflicted, fortunately
+# endif
}
=20
static void gen_pop_R2_LR_then_bLR ( IRBB* bb )
{
- Int offB_GPR2 =3D offsetof(VexGuestPPC64State,guest_GPR2);
- Int offB_LR =3D offsetof(VexGuestPPC64State,guest_LR);
- IRTemp old_R2 =3D newIRTemp( bb->tyenv, Ity_I64 );
- IRTemp old_LR =3D newIRTemp( bb->tyenv, Ity_I64 );
+# if defined(VGP_ppc64_linux) || defined(VGP_ppc64_aix5)
+ Int offB_GPR2 =3D offsetof(VexGuestPPC64State,guest_GPR2);
+ Int offB_LR =3D offsetof(VexGuestPPC64State,guest_LR);
+ IRTemp old_R2 =3D newIRTemp( bb->tyenv, Ity_I64 );
+ IRTemp old_LR =3D newIRTemp( bb->tyenv, Ity_I64 );
/* Restore R2 */
old_R2 =3D gen_POP( bb );
addStmtToIRBB( bb, IRStmt_Put( offB_GPR2, IRExpr_Tmp(old_R2)) );
@@ -737,13 +842,36 @@
/* Branch to LR */
/* re boring, we arrived here precisely because a wrapped fn did a
blr (hence Ijk_Ret); so we should just mark this jump as Boring,
- else one _Call will have resulted in to _Rets. */
+ else one _Call will have resulted in two _Rets. */
bb->jumpkind =3D Ijk_Boring;
bb->next =3D IRExpr_Binop(Iop_And64, IRExpr_Tmp(old_LR), mkU64(~(3ULL=
)));
+
+# elif defined(VGP_ppc32_aix5)
+ Int offB_GPR2 =3D offsetof(VexGuestPPC32State,guest_GPR2);
+ Int offB_LR =3D offsetof(VexGuestPPC32State,guest_LR);
+ IRTemp old_R2 =3D newIRTemp( bb->tyenv, Ity_I32 );
+ IRTemp old_LR =3D newIRTemp( bb->tyenv, Ity_I32 );
+ /* Restore R2 */
+ old_R2 =3D gen_POP( bb );
+ addStmtToIRBB( bb, IRStmt_Put( offB_GPR2, IRExpr_Tmp(old_R2)) );
+ /* Restore LR */
+ old_LR =3D gen_POP( bb );
+ addStmtToIRBB( bb, IRStmt_Put( offB_LR, IRExpr_Tmp(old_LR)) );
+
+ /* Branch to LR */
+ /* re boring, we arrived here precisely because a wrapped fn did a
+ blr (hence Ijk_Ret); so we should just mark this jump as Boring,
+ else one _Call will have resulted in two _Rets. */
+ bb->jumpkind =3D Ijk_Boring;
+ bb->next =3D IRExpr_Binop(Iop_And32, IRExpr_Tmp(old_LR), mkU32(~3));
+
+# else
+# error Platform is not TOC-afflicted, fortunately
+# endif
}
=20
static
-Bool mk_preamble__ppc64_magic_return_stub ( void* closureV, IRBB* bb )
+Bool mk_preamble__ppctoc_magic_return_stub ( void* closureV, IRBB* bb )
{
VgCallbackClosure* closure =3D (VgCallbackClosure*)closureV;
/* Since we're creating the entire IRBB right here, give it a
@@ -762,21 +890,22 @@
}
#endif
=20
-/* --------------- END ppc64-linux specific helpers --------------- */
+/* --------------- END helpers for with-TOC platforms --------------- */
=20
-/* This is an the IR preamble generators used for replacement
+
+/* This is the IR preamble generator used for replacement
functions. It adds code to set the guest_NRADDR{_GPR2} to zero
(technically not necessary, but facilitates detecting mixups in
which a replacement function has been erroneously declared using
VG_REPLACE_FUNCTION_Z{U,Z} when instead it should have been written
using VG_WRAP_FUNCTION_Z{U,Z}).
=20
- On ppc64-linux the follow hacks are also done: LR and R2 are pushed
- onto a hidden stack, sets R2 to the correct value for the
- replacement function, and sets LR to point at the magic return-stub
- address. Setting LR causes the return of the wrapped/redirected
- function to lead to our magic return stub, which restores LR and R2
- from said stack and returns for real.
+ On with-TOC platforms the follow hacks are also done: LR and R2 are
+ pushed onto a hidden stack, R2 is set to the correct value for the
+ replacement function, and LR is set to point at the magic
+ return-stub address. Setting LR causes the return of the
+ wrapped/redirected function to lead to our magic return stub, which
+ restores LR and R2 from said stack and returns for real.
=20
VG_(get_StackTrace2) understands that the LR value may point to the
return stub address, and that in that case it can get the real LR
@@ -787,6 +916,7 @@
Int nraddr_szB
=3D sizeof(((VexGuestArchState*)0)->guest_NRADDR);
vg_assert(nraddr_szB =3D=3D 4 || nraddr_szB =3D=3D 8);
+ vg_assert(nraddr_szB =3D=3D VG_WORDSIZE);
addStmtToIRBB(=20
bb,
IRStmt_Put(=20
@@ -794,13 +924,13 @@
nraddr_szB =3D=3D 8 ? mkU64(0) : mkU32(0)
)
);
-# if defined(VGP_ppc64_linux)
+# if defined(VG_PLAT_USES_PPCTOC)
{ VgCallbackClosure* closure =3D (VgCallbackClosure*)closureV;
addStmtToIRBB(
bb,
IRStmt_Put(
offsetof(VexGuestArchState,guest_NRADDR_GPR2),
- mkU64(0)
+ VG_WORDSIZE=3D=3D8 ? mkU64(0) : mkU32(0)
)
);
gen_push_and_set_LR_R2 ( bb, VG_(get_tocptr)( closure->readdr ) );
@@ -812,7 +942,7 @@
/* Ditto, except set guest_NRADDR to nraddr (the un-redirected guest
address). This is needed for function wrapping - so the wrapper
can read _NRADDR and find the address of the function being
- wrapped. */
+ wrapped. On toc-afflicted platforms we must also snarf r2. */
static=20
Bool mk_preamble__set_NRADDR_to_nraddr ( void* closureV, IRBB* bb )
{
@@ -820,6 +950,7 @@
Int nraddr_szB
=3D sizeof(((VexGuestArchState*)0)->guest_NRADDR);
vg_assert(nraddr_szB =3D=3D 4 || nraddr_szB =3D=3D 8);
+ vg_assert(nraddr_szB =3D=3D VG_WORDSIZE);
addStmtToIRBB(=20
bb,
IRStmt_Put(=20
@@ -829,13 +960,14 @@
: IRExpr_Const(IRConst_U32( (UInt)closure->nraddr ))
)
);
-# if defined(VGP_ppc64_linux)
+# if defined(VGP_ppc64_linux) || defined(VGP_ppc32_aix5) \
+ || defined(VGP_ppc64_aix5)
addStmtToIRBB(=20
bb,
IRStmt_Put(=20
offsetof(VexGuestArchState,guest_NRADDR_GPR2),
IRExpr_Get(offsetof(VexGuestArchState,guest_GPR2),=20
- Ity_I64)
+ VG_WORDSIZE=3D=3D8 ? Ity_I64 : Ity_I32)
)
);
gen_push_and_set_LR_R2 ( bb, VG_(get_tocptr)( closure->readdr ) );
@@ -843,7 +975,56 @@
return False;
}
=20
+/* --- Helpers to do with PPC related stack redzones. --- */
=20
+__attribute__((unused))
+static Bool const_True ( Addr64 guest_addr )
+{
+ return True;
+}
+
+__attribute__((unused))
+static Bool bl_RZ_zap_ok_for_AIX ( Addr64 bl_target )
+{
+ /* paranoia */
+ if (sizeof(void*) =3D=3D 4)
+ bl_target &=3D 0xFFFFFFFFULL;
+
+ /* don't zap the redzone for calls to millicode. */
+ if (bl_target < 0x10000ULL)
+ return False;
+
+ /* don't zap the redzone for calls to .$SAVEF14 .. .$SAVEF31.
+ First we need to be reasonably sure we won't segfault by looking
+ at the branch target. */
+ { NSegment const*const seg =3D VG_(am_find_nsegment)( (Addr)bl_target=
);
+ if (seg && seg->hasR) {
+ switch ( *(UInt*)(Addr)bl_target ) {
+ case 0xd9c1ff70: /* stfd f14,-144(r1) */
+ case 0xd9e1ff78: /* stfd f15,-136(r1) */
+ case 0xda01ff80: /* stfd f16,-128(r1) */
+ case 0xda21ff88: /* stfd f17,-120(r1) */
+ case 0xda41ff90: /* stfd f18,-112(r1) */
+ case 0xda61ff98: /* stfd f19,-104(r1) */
+ case 0xda81ffa0: /* stfd f20,-96(r1) */
+ case 0xdaa1ffa8: /* stfd f21,-88(r1) */
+ case 0xdac1ffb0: /* stfd f22,-80(r1) */
+ case 0xdae1ffb8: /* stfd f23,-72(r1) */
+ case 0xdb01ffc0: /* stfd f24,-64(r1) */
+ case 0xdb21ffc8: /* stfd f25,-56(r1) */
+ case 0xdb41ffd0: /* stfd f26,-48(r1) */
+ case 0xdb61ffd8: /* stfd f27,-40(r1) */
+ case 0xdb81ffe0: /* stfd f28,-32(r1) */
+ case 0xdba1ffe8: /* stfd f29,-24(r1) */
+ case 0xdbc1fff0: /* stfd f30,-16(r1) */
+ case 0xdbe1fff8: /* stfd f31,-8(r1) */
+ return False;
+ }
+ }
+ }
+ return True;
+}
+
/* --------------- main translation function --------------- */
=20
/* Note: see comments at top of m_redir.c for the Big Picture on how
@@ -886,10 +1067,10 @@
Int tmpbuf_used, verbosity, i;
Bool notrace_until_done, do_self_check;
UInt notrace_until_limit =3D 0;
- NSegment* seg;
Bool (*preamble_fn)(void*,IRBB*);
VexArch vex_arch;
VexArchInfo vex_archinfo;
+ VexMiscInfo vex_miscinfo;
VexGuestExtents vge;
VexTranslateArgs vta;
VexTranslateResult tres;
@@ -971,9 +1152,13 @@
=20
/* Are we allowed to translate here? */
=20
- seg =3D VG_(am_find_nsegment)(addr);
+ { /* BEGIN new scope specially for 'seg' */
+ NSegment const* seg =3D VG_(am_find_nsegment)(addr);
=20
if (!translations_allowable_from_seg(seg)) {
+ if (VG_(clo_trace_signals))
+ VG_(message)(Vg_DebugMsg, "translations not allowed here "
+ "- throwing SEGV");
/* U R busted, sonny. Place your hands on your head and step
away from the orig_addr. */
/* Code address is bad - deliver a signal instead */
@@ -1010,8 +1195,10 @@
else=20
if (kind =3D=3D T_Redir_Wrap)
preamble_fn =3D mk_preamble__set_NRADDR_to_nraddr;
-# if defined(VGP_ppc64_linux)
- if (nraddr =3D=3D (Addr64)&VG_(ppc64_linux_magic_redirect_return_stub=
)) {
+
+# if defined(VG_PLAT_USES_PPCTOC)
+ if (ULong_to_Ptr(nraddr)
+ =3D=3D (void*)&VG_(ppctoc_magic_redirect_return_stub)) {
/* If entering the special return stub, this means a wrapped or
redirected function is returning. Make this translation one
which restores R2 and LR from the thread's hidden redir
@@ -1019,8 +1206,8 @@
really causing the function to return. */
vg_assert(kind =3D=3D T_Normal);
vg_assert(nraddr =3D=3D addr);
- preamble_fn =3D mk_preamble__ppc64_magic_return_stub;
- }
+ preamble_fn =3D mk_preamble__ppctoc_magic_return_stub;
+ }
# endif
=20
/* ------ Actually do the translation. ------ */
@@ -1030,6 +1217,29 @@
/* Get the CPU info established at startup. */
VG_(machine_get_VexArchInfo)( &vex_arch, &vex_archinfo );
=20
+ /* Set up 'misc info' structure with stuff Vex needs to know about
+ the guest and host ABIs. */
+
+ LibVEX_default_VexMiscInfo( &vex_miscinfo );
+ vex_miscinfo.guest_stack_redzone_size =3D VG_STACK_REDZONE_SZB;
+
+# if defined(VGP_ppc32_linux)
+ vex_miscinfo.guest_ppc_zap_RZ_at_blr =3D False;
+ vex_miscinfo.guest_ppc_zap_RZ_at_bl =3D NULL;
+ vex_miscinfo.host_ppc32_regalign_int64_args =3D True;
+# endif
+# if defined(VGP_ppc64_linux)
+ vex_miscinfo.guest_ppc_zap_RZ_at_blr =3D True;
+ vex_miscinfo.guest_ppc_zap_RZ_at_bl =3D const_True;
+ vex_miscinfo.host_ppc_calls_use_fndescrs =3D True;
+# endif
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ vex_miscinfo.guest_ppc_zap_RZ_at_blr =3D False;
+ vex_miscinfo.guest_ppc_zap_RZ_at_bl =3D bl_RZ_zap_ok_for_AIX;
+ vex_miscinfo.guest_ppc_sc_continues_at_LR =3D True;
+ vex_miscinfo.host_ppc_calls_use_fndescrs =3D True;
+# endif
+
/* Set up closure args. */
closure.tid =3D tid;
closure.nraddr =3D nraddr;
@@ -1040,6 +1250,7 @@
vta.archinfo_guest =3D vex_archinfo;
vta.arch_host =3D vex_arch;
vta.archinfo_host =3D vex_archinfo;
+ vta.miscinfo_both =3D vex_miscinfo;
vta.guest_bytes =3D (UChar*)ULong_to_Ptr(addr);
vta.guest_bytes_addr =3D (Addr64)addr;
vta.callback_opaque =3D (void*)&closure;
@@ -1106,13 +1317,15 @@
should already point to it. */
=20
vg_assert( vge.base[0] =3D=3D (Addr64)addr );
- if (seg->kind =3D=3D SkFileC || seg->kind =3D=3D SkAnonC)
- seg->hasT =3D True; /* has cached code */
+ /* set 'translations taken from this segment' flag */
+ VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( (NSegment*)seg );
+ } /* END new scope specially for 'seg' */
=20
for (i =3D 1; i < vge.n_used; i++) {
- seg =3D VG_(am_find_nsegment)( vge.base[i] );
- if (seg->kind =3D=3D SkFileC || seg->kind =3D=3D SkAnonC)
- seg->hasT =3D True; /* has cached code */
+ NSegment const* seg=20
+ =3D VG_(am_find_nsegment)( vge.base[i] );
+ /* set 'translations taken from this segment' flag */
+ VG_(am_set_segment_hasT_if_SkFileC_or_SkAnonC)( (NSegment*)seg );
}
=20
/* Copy data at trans_addr into the translation cache. */
|
|
From: <sv...@va...> - 2006-10-17 01:51:27
|
Author: sewardj
Date: 2006-10-17 02:51:24 +0100 (Tue, 17 Oct 2006)
New Revision: 6281
Log:
Merge r6148:
Minor adjustments to the scheduler, mostly cosmetic.
- rename VG_(kill_thread) to VG_(get_thread_out_of_syscall), which
is what it actually does.
- Remove 'semaphore' terminology in places and use 'lock' instead.
- Give an extra 'HChar* who' arg to VG_(set_running) and=20
VG_(set_sleeping), which is printed when --trace-sched=3Dyes.
This makes it easier to make sense of lock ownership changes
from the debug output.
- various other improvements to debug printing
- add a kludge to encourage the AIX scheduler to switch threads
more often when more than one is runnable (am not claiming to=20
understand this); otherwise CPU starvation can appear to happen
- more assertions in sema.c (the pipe-based lock); cycle the token
through 'A' to 'Z' to make strace/truss output more understandable;
fix longstanding bug wherein sema_down() tries to read two bytes
even though sema_up only writes one.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_scheduler/sema.c
trunk/coregrind/pub_core_scheduler.h
Modified: trunk/coregrind/m_scheduler/scheduler.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
--- trunk/coregrind/m_scheduler/scheduler.c 2006-10-17 01:50:31 UTC (rev =
6280)
+++ trunk/coregrind/m_scheduler/scheduler.c 2006-10-17 01:51:24 UTC (rev =
6281)
@@ -59,7 +59,7 @@
=20
#include "pub_core_basics.h"
#include "pub_core_vki.h"
-#include "pub_core_vkiscnums.h"
+#include "pub_core_vkiscnums.h" // __NR_sched_yield
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_clreq.h" // for VG_USERREQ__*
@@ -74,7 +74,6 @@
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
#include "pub_core_replacemalloc.h"
-#include "pub_core_scheduler.h"
#include "pub_core_signals.h"
#include "pub_core_stacks.h"
#include "pub_core_stacktrace.h" // For VG_(get_and_pp_StackTrace)()
@@ -84,6 +83,7 @@
#include "pub_core_translate.h" // For VG_(translate)()
#include "pub_core_transtab.h"
#include "priv_sema.h"
+#include "pub_core_scheduler.h" // self
=20
/* #include "pub_core_debuginfo.h" */ // DEBUGGING HACK ONLY
=20
@@ -195,15 +195,30 @@
=20
When this returns, we'll actually be running.
*/
-void VG_(set_running)(ThreadId tid)
+void VG_(set_running)(ThreadId tid, HChar* who)
{
- ThreadState *tst =3D VG_(get_ThreadState)(tid);
+ ThreadState *tst;
=20
+#if 0
+ if (VG_(clo_trace_sched)) {
+ HChar buf[100];
+ vg_assert(VG_(strlen)(who) <=3D 100-50);
+ VG_(sprintf)(buf, "waiting for lock (%s)", who);
+ print_sched_event(tid, buf);
+ }
+#endif
+
+ /* First, acquire the lock. We can't do anything else safely prior
+ to this point. Even doing debug printing prior to this point
+ is, technically, wrong. */
+ ML_(sema_down)(&run_sema);
+
+ tst =3D VG_(get_ThreadState)(tid);
+
vg_assert(tst->status !=3D VgTs_Runnable);
=20
tst->status =3D VgTs_Runnable;
- =20
- ML_(sema_down)(&run_sema);
+
if (VG_(running_tid) !=3D VG_INVALID_THREADID)
VG_(printf)("tid %d found %d running\n", tid, VG_(running_tid));
vg_assert(VG_(running_tid) =3D=3D VG_INVALID_THREADID);
@@ -211,8 +226,12 @@
=20
VG_(unknown_SP_update)(VG_(get_SP(tid)), VG_(get_SP(tid)));
=20
- if (VG_(clo_trace_sched))
- print_sched_event(tid, "now running");
+ if (VG_(clo_trace_sched)) {
+ HChar buf[150];
+ vg_assert(VG_(strlen)(who) <=3D 150-50);
+ VG_(sprintf)(buf, " acquired lock (%s)", who);
+ print_sched_event(tid, buf);
+ }
=20
// While thre modeling is disable, issue thread_run events here
// VG_(tm_thread_switchto)(tid);
@@ -226,7 +245,7 @@
but it may mean that we remain in a Runnable state and we're just
yielding the CPU to another thread).
*/
-void VG_(set_sleeping)(ThreadId tid, ThreadStatus sleepstate)
+void VG_(set_sleeping)(ThreadId tid, ThreadStatus sleepstate, HChar* who=
)
{
ThreadState *tst =3D VG_(get_ThreadState)(tid);
=20
@@ -240,16 +259,17 @@
vg_assert(VG_(running_tid) =3D=3D tid);
VG_(running_tid) =3D VG_INVALID_THREADID;
=20
+ if (VG_(clo_trace_sched)) {
+ Char buf[200];
+ vg_assert(VG_(strlen)(who) <=3D 200-100);
+ VG_(sprintf)(buf, "releasing lock (%s) -> %s",
+ who, VG_(name_of_ThreadStatus)(sleepstate));
+ print_sched_event(tid, buf);
+ }
+
/* Release the run_sema; this will reschedule any runnable
thread. */
ML_(sema_up)(&run_sema);
-
- if (VG_(clo_trace_sched)) {
- Char buf[50];
- VG_(sprintf)(buf, "now sleeping in state %s",=20
- VG_(name_of_ThreadStatus)(sleepstate));
- print_sched_event(tid, buf);
- }
}
=20
/* Clear out the ThreadState and release the semaphore. Leaves the
@@ -267,21 +287,24 @@
/* There should still be a valid exitreason for this thread */
vg_assert(VG_(threads)[tid].exitreason !=3D VgSrc_None);
=20
+ if (VG_(clo_trace_sched))
+ print_sched_event(tid, "release lock in VG_(exit_thread)");
+
ML_(sema_up)(&run_sema);
}
=20
-/* Kill a thread. This interrupts whatever a thread is doing, and
- makes it exit ASAP. This does not set the exitreason or
- exitcode. */
-void VG_(kill_thread)(ThreadId tid)
+/* If 'tid' is blocked in a syscall, send it SIGVGKILL so as to get it
+ out of the syscall and onto doing the next thing, whatever that is.
+ If it isn't blocked in a syscall, has no effect on the thread. */
+void VG_(get_thread_out_of_syscall)(ThreadId tid)
{
vg_assert(VG_(is_valid_tid)(tid));
vg_assert(!VG_(is_running_thread)(tid));
- vg_assert(VG_(is_exiting)(tid));
=20
if (VG_(threads)[tid].status =3D=3D VgTs_WaitSys) {
if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "kill_thread zaps tid %d lwp %d",
+ VG_(message)(Vg_DebugMsg,=20
+ "get_thread_out_of_syscall zaps tid %d lwp %d",
tid, VG_(threads)[tid].os_state.lwpid);
VG_(tkill)(VG_(threads)[tid].os_state.lwpid, VG_SIGVGKILL);
}
@@ -292,25 +315,19 @@
*/
void VG_(vg_yield)(void)
{
- struct vki_timespec ts =3D { 0, 1 };
ThreadId tid =3D VG_(running_tid);
=20
vg_assert(tid !=3D VG_INVALID_THREADID);
vg_assert(VG_(threads)[tid].os_state.lwpid =3D=3D VG_(gettid)());
=20
- VG_(set_sleeping)(tid, VgTs_Yielding);
+ VG_(set_sleeping)(tid, VgTs_Yielding, "VG_(vg_yield)");
=20
- //VG_(printf)("tid %d yielding EIP=3D%p\n", tid, VG_(threads)[tid].ar=
ch.m_eip);
-
/*=20
Tell the kernel we're yielding.
*/
- if (1)
- VG_(do_syscall0)(__NR_sched_yield);
- else
- VG_(nanosleep)(&ts);
+ VG_(do_syscall0)(__NR_sched_yield);
=20
- VG_(set_running)(tid);
+ VG_(set_running)(tid, "VG_(vg_yield)");
}
=20
=20
@@ -340,6 +357,11 @@
{
tst->os_state.lwpid =3D 0;
tst->os_state.threadgroup =3D 0;
+# if defined(VGO_aix5)
+ tst->os_state.cancel_async =3D False;
+ tst->os_state.cancel_disabled =3D False;
+ tst->os_state.cancel_progress =3D Canc_NoRequest;
+# endif
}
=20
static void os_state_init(ThreadState *tst)
@@ -434,7 +456,6 @@
ML_(sema_init)(&run_sema);
=20
for (i =3D 0 /* NB; not 1 */; i < VG_N_THREADS; i++) {
-
/* Paranoia .. completely zero it out. */
VG_(memset)( & VG_(threads)[i], 0, sizeof( VG_(threads)[i] ) );
=20
@@ -542,19 +563,6 @@
do_pre_run_checks(tst);
/* end Paranoia */
=20
- //if (0) {
- // Char buf[100];
- // Bool ok =3D VG_(get_fnname_if_entry) ( tst->arch.vex.guest_CIA,
- // buf, 100 );
- // if (ok) {
- // Addr r2actual =3D tst->arch.vex.guest_GPR2;
- // Addr r2tocptr =3D VG_(get_tocptr)( tst->arch.vex.guest_CIA );
- // if (1) VG_(printf)("R2 act 0x%016llx toc 0x%016llx %s\n",=20
- // r2actual, r2tocptr, buf);
- // if (r2tocptr !=3D 0) vg_assert(r2actual =3D=3D r2tocptr);
- // }
- //}
-
trc =3D 0;
dispatch_ctr_SAVED =3D VG_(dispatch_ctr);
=20
@@ -574,9 +582,36 @@
VG_(threads)[tid].arch.vex.guest_RESVN =3D 0;
# endif =20
=20
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ /* On AIX, we need to get a plausible value for SPRG3 for this
+ thread, since it's used I think as a thread-state pointer. It
+ is presumably set by the kernel for each dispatched thread and
+ cannot be changed by user space. It therefore seems safe enough
+ to copy the host's value of it into the guest state at the point
+ the thread is dispatched.
+ (Later): Hmm, looks like SPRG3 is only used in 32-bit mode.
+ Oh well. */
+ { UWord host_sprg3;
+ __asm__ __volatile__( "mfspr %0,259\n" : "=3Db"(host_sprg3) );
+ VG_(threads)[tid].arch.vex.guest_SPRG3_RO =3D host_sprg3;
+ vg_assert(sizeof(VG_(threads)[tid].arch.vex.guest_SPRG3_RO) =3D=3D s=
izeof(void*));
+ }
+# endif
+
/* there should be no undealt-with signals */
//vg_assert(VG_(threads)[tid].siginfo.si_signo =3D=3D 0);
=20
+ if (0) {
+ vki_sigset_t m;
+ Int i, err =3D VG_(sigprocmask)(VKI_SIG_SETMASK, NULL, &m);
+ vg_assert(err =3D=3D 0);
+ VG_(printf)("tid %d: entering code with unblocked signals: ", tid)=
;
+ for (i =3D 1; i <=3D _VKI_NSIG; i++)
+ if (!VG_(sigismember)(&m, i))
+ VG_(printf)("%d ", i);
+ VG_(printf)("\n");
+ }
+
vg_assert(VG_(in_generated_code) =3D=3D False);
VG_(in_generated_code) =3D True;
=20
@@ -792,15 +827,56 @@
=20
VG_(dispatch_ctr) =3D SCHEDULING_QUANTUM + 1;
=20
- while(!VG_(is_exiting)(tid)) {
+ while (!VG_(is_exiting)(tid)) {
+
if (VG_(dispatch_ctr) =3D=3D 1) {
- /* Our slice is done, so yield the CPU to another thread. This
- doesn't sleep between sleeping and running, since that would
- take too much time. */
- VG_(set_sleeping)(tid, VgTs_Yielding);
- /* nothing */
- VG_(set_running)(tid);
=20
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ /* Note: count runnable threads before dropping The Lock. */
+ Int rt =3D VG_(count_runnable_threads)();
+# endif
+
+ /* Our slice is done, so yield the CPU to another thread. On
+ Linux, this doesn't sleep between sleeping and running,
+ since that would take too much time. On AIX, we have to
+ prod the scheduler to get it consider other threads; not
+ doing so appears to cause very long delays before other
+ runnable threads get rescheduled. */
+
+ /* 4 July 06: it seems that a zero-length nsleep is needed to
+ cause async thread cancellation (canceller.c) to terminate
+ in finite time; else it is in some kind of race/starvation
+ situation and completion is arbitrarily delayed (although
+ this is not a deadlock).
+
+ Unfortunately these sleeps cause MPI jobs not to terminate
+ sometimes (some kind of livelock). So sleeping once
+ every N opportunities appears to work. */
+
+ /* 3 Aug 06: doing sys__nsleep works but crashes some apps.
+ sys_yield also helps the problem, whilst not crashing apps. =
*/
+
+ VG_(set_sleeping)(tid, VgTs_Yielding,=20
+ "VG_(scheduler):timeslice");
+ /* ------------ now we don't have The Lock ------------ */
+
+# if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ { static Int ctr=3D0;
+ vg_assert(__NR_AIX5__nsleep !=3D __NR_AIX5_UNKNOWN);
+ vg_assert(__NR_AIX5_yield !=3D __NR_AIX5_UNKNOWN);
+ if (1 && rt > 0 && ((++ctr % 3) =3D=3D 0)) {=20
+ //struct vki_timespec ts;
+ //ts.tv_sec =3D 0;
+ //ts.tv_nsec =3D 0*1000*1000;
+ //VG_(do_syscall2)(__NR_AIX5__nsleep, (UWord)&ts, (UWord)N=
ULL);
+ VG_(do_syscall0)(__NR_AIX5_yield);
+ }
+ }
+# endif
+
+ VG_(set_running)(tid, "VG_(scheduler):timeslice");
+ /* ------------ now we do have The Lock ------------ */
+
/* OK, do some relatively expensive housekeeping stuff */
scheduler_sanity(tid);
VG_(sanity_check_general)(False);
@@ -1057,7 +1133,7 @@
VG_(threads)[tid].exitreason =3D src;
if (src =3D=3D VgSrc_FatalSig)
VG_(threads)[tid].os_state.fatalsig =3D VKI_SIGKILL;
- VG_(kill_thread)(tid);
+ VG_(get_thread_out_of_syscall)(tid);
}
}
=20
@@ -1117,7 +1193,7 @@
if (0 || VG_(clo_trace_syscalls) || VG_(clo_trace_sched))
VG_(message)(Vg_DebugMsg,=20
"__libc_freeres() done; really quitting!");
- VG_(threads)[tid].exitreason =3D VgSrc_ExitSyscall;
+ VG_(threads)[tid].exitreason =3D VgSrc_ExitThread;
break;
=20
default:
@@ -1300,26 +1376,55 @@
void scheduler_sanity ( ThreadId tid )
{
Bool bad =3D False;
+ static UInt lasttime =3D 0;
+ UInt now;
+ Int lwpid =3D VG_(gettid)();
=20
if (!VG_(is_running_thread)(tid)) {
VG_(message)(Vg_DebugMsg,
- "Thread %d is supposed to be running, but doesn't own run_sema (own=
ed by %d)\n",=20
+ "Thread %d is supposed to be running, "
+ "but doesn't own run_sema (owned by %d)\n",=20
tid, VG_(running_tid));
bad =3D True;
}
=20
- if (VG_(gettid)() !=3D VG_(threads)[tid].os_state.lwpid) {
+ if (lwpid !=3D VG_(threads)[tid].os_state.lwpid) {
VG_(message)(Vg_DebugMsg,
"Thread %d supposed to be in LWP %d, but we're actual=
ly %d\n",
tid, VG_(threads)[tid].os_state.lwpid, VG_(gettid)())=
;
bad =3D True;
}
+
+ if (lwpid !=3D run_sema.owner_thread) {
+ VG_(message)(Vg_DebugMsg,
+ "Thread %d doesn't own the run_sema\n",
+ tid);
+ bad =3D True;
+ }
+
+ /* Periodically show the state of all threads, for debugging
+ purposes. */
+ now =3D VG_(read_millisecond_timer)();
+ if (0 && (!bad) && (lasttime + 4000/*ms*/ <=3D now)) {
+ lasttime =3D now;
+ VG_(printf)("\n------------ Sched State at %d ms ------------\n",
+ (Int)now);
+ VG_(show_sched_status)();
+ }
+
+ /* core_panic also shows the sched status, which is why we don't
+ show it above if bad=3D=3DTrue. */
+ if (bad)
+ VG_(core_panic)("scheduler_sanity: failed");
}
=20
void VG_(sanity_check_general) ( Bool force_expensive )
{
ThreadId tid;
=20
+ static UInt next_slow_check_at =3D 1;
+ static UInt slow_check_interval =3D 25;
+
if (VG_(clo_sanity_level) < 1) return;
=20
/* --- First do all the tests that we can do quickly. ---*/
@@ -1336,11 +1441,18 @@
=20
/* --- Now some more expensive checks. ---*/
=20
- /* Once every 25 times, check some more expensive stuff. */
+ /* Once every now and again, check some more expensive stuff.
+ Gradually increase the interval between such checks so as not to
+ burden long-running programs too much. */
if ( force_expensive
- || VG_(clo_sanity_level) > 1
- || (VG_(clo_sanity_level) =3D=3D 1 && (sanity_fast_count % 25) =3D=3D=
0)) {
+ || VG_(clo_sanity_level) > 1
+ || (VG_(clo_sanity_level) =3D=3D 1=20
+ && sanity_fast_count =3D=3D next_slow_check_at)) {
=20
+ if (0) VG_(printf)("SLOW at %d\n", sanity_fast_count-1);
+
+ next_slow_check_at =3D sanity_fast_count - 1 + slow_check_interval=
;
+ slow_check_interval++;
sanity_slow_count++;
=20
if (VG_(needs).sanity_checks) {
Modified: trunk/coregrind/m_scheduler/sema.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
--- trunk/coregrind/m_scheduler/sema.c 2006-10-17 01:50:31 UTC (rev 6280)
+++ trunk/coregrind/m_scheduler/sema.c 2006-10-17 01:51:24 UTC (rev 6281)
@@ -29,6 +29,7 @@
*/
=20
#include "pub_core_basics.h"
+#include "pub_core_debuglog.h"
#include "pub_core_vki.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcfile.h"
@@ -40,45 +41,78 @@
pipe-based token passing scheme.
*/
=20
+/* Cycle the char passed through the pipe through 'A' .. 'Z' to make
+ it easier to make sense of strace/truss output - makes it possible
+ to see more clearly the change of ownership of the lock. Need to
+ be careful to reinitialise it at fork() time. */
+static Char sema_char =3D '!'; /* will cause assertion failures if used
+ before sema_init */
+
void ML_(sema_init)(vg_sema_t *sema)
{
- Int res;
- VG_(pipe)(sema->pipe);
+ Char buf[2];
+ Int res, r;
+ r =3D VG_(pipe)(sema->pipe);
+ vg_assert(r =3D=3D 0);
+
+ vg_assert(sema->pipe[0] !=3D sema->pipe[1]);
+
sema->pipe[0] =3D VG_(safe_fd)(sema->pipe[0]);
sema->pipe[1] =3D VG_(safe_fd)(sema->pipe[1]);
=20
+ if (0)=20
+ VG_(debugLog)(0,"zz","sema_init: %d %d\n", sema->pipe[0],=20
+ sema->pipe[1]);
+ vg_assert(sema->pipe[0] !=3D sema->pipe[1]);
+
sema->owner_thread =3D -1;
=20
/* create initial token */
- res =3D VG_(write)(sema->pipe[1], "T", 1);
+ sema_char =3D 'A';
+ buf[0] =3D sema_char;=20
+ buf[1] =3D 0;
+ sema_char++;
+ res =3D VG_(write)(sema->pipe[1], buf, 1);
vg_assert(res =3D=3D 1);
}
=20
void ML_(sema_deinit)(vg_sema_t *sema)
{
+ vg_assert(sema->owner_thread !=3D -1); /* must be initialised */
+ vg_assert(sema->pipe[0] !=3D sema->pipe[1]);
VG_(close)(sema->pipe[0]);
VG_(close)(sema->pipe[1]);
sema->pipe[0] =3D sema->pipe[1] =3D -1;
+ sema->owner_thread =3D -1;
}
=20
/* get a token */
void ML_(sema_down)(vg_sema_t *sema)
{
- Char buf[2] =3D { 'x' };
+ Char buf[2];
Int ret;
Int lwpid =3D VG_(gettid)();
=20
vg_assert(sema->owner_thread !=3D lwpid); /* can't have it already */
+ vg_assert(sema->pipe[0] !=3D sema->pipe[1]);
=20
again:
- ret =3D VG_(read)(sema->pipe[0], buf, 2);
+ buf[0] =3D buf[1] =3D 0;
+ ret =3D VG_(read)(sema->pipe[0], buf, 1);
=20
+ if (ret !=3D 1)=20
+ VG_(debugLog)(0, "scheduler",=20
+ "VG_(sema_down): read returned %d\n", ret);
+
if (ret =3D=3D -VKI_EINTR)
goto again;
=20
vg_assert(ret =3D=3D 1); /* should get exactly 1 token */
- vg_assert(buf[0] =3D=3D 'T');
+ vg_assert(buf[0] >=3D 'A' && buf[0] <=3D 'Z');
+ vg_assert(buf[1] =3D=3D 0);
=20
+ if (sema_char =3D=3D 'Z') sema_char =3D 'A'; else sema_char++;
+
sema->owner_thread =3D lwpid;
}
=20
@@ -86,12 +120,21 @@
void ML_(sema_up)(vg_sema_t *sema)
{
Int ret;
-
+ Char buf[2];
+ buf[0] =3D sema_char;=20
+ buf[1] =3D 0;
+ vg_assert(sema->owner_thread !=3D -1); /* must be initialised */
+ vg_assert(sema->pipe[0] !=3D sema->pipe[1]);
vg_assert(sema->owner_thread =3D=3D VG_(gettid)()); /* must have it *=
/
=20
sema->owner_thread =3D 0;
=20
- ret =3D VG_(write)(sema->pipe[1], "T", 1);
+ ret =3D VG_(write)(sema->pipe[1], buf, 1);
+
+ if (ret !=3D 1)=20
+ VG_(debugLog)(0, "scheduler",=20
+ "VG_(sema_up):write returned %d\n", ret);
+
vg_assert(ret =3D=3D 1);
}
=20
Modified: trunk/coregrind/pub_core_scheduler.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
--- trunk/coregrind/pub_core_scheduler.h 2006-10-17 01:50:31 UTC (rev 628=
0)
+++ trunk/coregrind/pub_core_scheduler.h 2006-10-17 01:51:24 UTC (rev 628=
1)
@@ -43,31 +43,31 @@
/* A thread exits. tid must currently be running. */
extern void VG_(exit_thread)(ThreadId tid);
=20
-/* Kill a thread. This interrupts whatever a thread is doing, and
- makes it exit ASAP. This does not set the exitreason or
- exitcode. */
-extern void VG_(kill_thread)(ThreadId tid);
+/* If 'tid' is blocked in a syscall, send it SIGVGKILL so as to get it
+ out of the syscall and onto doing the next thing, whatever that is.
+ If it isn't blocked in a syscall, has no effect on the thread. */
+extern void VG_(get_thread_out_of_syscall)(ThreadId tid);
=20
/* Nuke all threads except tid. */
extern void VG_(nuke_all_threads_except) ( ThreadId me,
VgSchedReturnCode reason );
=20
/* Make a thread the running thread. The thread must previously been
- sleeping, and not holding the CPU semaphore. This will set the
+ sleeping, and not holding the CPU lock. This will set the
thread state to VgTs_Runnable, and the thread will attempt to take
- the CPU semaphore. By the time it returns, tid will be the running
+ the CPU lock. By the time it returns, tid will be the running
thread. */
-extern void VG_(set_running) ( ThreadId tid );
+extern void VG_(set_running) ( ThreadId tid, HChar* who );
=20
/* Set a thread into a sleeping state. Before the call, the thread
- must be runnable, and holding the CPU semaphore. When this call
+ must be runnable, and holding the CPU lock. When this call
returns, the thread will be set to the specified sleeping state,
- and will not be holding the CPU semaphore. Note that another
+ and will not be holding the CPU lock. Note that another
thread could be running by the time this call returns, so the
caller must be careful not to touch any shared state. It is also
the caller's responsibility to actually block until the thread is
ready to run again. */
-extern void VG_(set_sleeping) ( ThreadId tid, ThreadStatus state );
+extern void VG_(set_sleeping) ( ThreadId tid, ThreadStatus state, HChar*=
who );
=20
/* Yield the CPU for a while */
extern void VG_(vg_yield)(void);
|
|
From: <sv...@va...> - 2006-10-17 01:50:34
|
Author: sewardj
Date: 2006-10-17 02:50:31 +0100 (Tue, 17 Oct 2006)
New Revision: 6280
Log:
Merge r6146:
Generally tidy up, and add bindings for both gcc and xlc's C/C++
libraries on AIX.
Modified:
trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
Modified: trunk/coregrind/m_replacemalloc/vg_replace_malloc.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
--- trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2006-10-17 01:49:=
50 UTC (rev 6279)
+++ trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2006-10-17 01:50:=
31 UTC (rev 6280)
@@ -50,14 +50,40 @@
// VALGRIND_NON_SIMD_CALL[12]
#include "pub_core_debuginfo.h" // needed for pub_core_redir.h :(
#include "pub_core_mallocfree.h" // for VG_MIN_MALLOC_SZB, VG_AR_CLIE=
NT
-#include "pub_core_redir.h" // for VG_REDIRECT_FUNCTION_*
+#include "pub_core_redir.h" // for VG_REPLACE_FUNCTION_*
#include "pub_core_replacemalloc.h"
=20
-/* Some handy Z-encoded names */
-#define m_libstc_plus_plus_star libstdcZpZpZa // libstdc++*
-#define m_libc_dot_so_star libcZdsoZa // libc.so*
-//#define m_libpgc_dot_so libpgcZdso // libpgc.so
+/* --------- Some handy Z-encoded names. --------- */
=20
+/* --- Soname of the standard C library. --- */
+
+#if defined(VGO_linux)
+# define m_libc_soname libcZdsoZa // libc.so*
+#elif defined(VGP_ppc32_aix5)
+ /* AIX has both /usr/lib/libc.a and /usr/lib/libc_r.a. */
+# define m_libc_soname libcZaZdaZLshrZdoZR // libc*.a(shr.o)
+#elif defined(VGP_ppc64_aix5)
+# define m_libc_soname libcZaZdaZLshrZu64ZdoZR // libc*.a(shr_64.o=
)
+#else
+# error "Unknown platform"
+#endif
+
+/* --- Soname of the GNU C++ library. --- */
+
+#define m_libstdcxx_soname libstdcZpZpZa // libstdc++*
+
+/* --- Soname of XLC's C++ library. --- */
+
+/* AIX: xlC's C++ runtime library is called libC.a, and the
+ interesting symbols appear to be in ansicore_32.o or ansicore_64.o
+ respectively. */
+#if defined(VGP_ppc32_aix5)
+# define m_libC_dot_a libCZdaZLansicoreZu32ZdoZR // libC.a(ansicore_=
32.o)
+#elif defined(VGP_ppc64_aix5)
+# define m_libC_dot_a libCZdaZLansicoreZu64ZdoZR // libC.a(ansicore_=
64.o)
+#endif
+
+
/* 2 Apr 05: the Portland Group compiler, which uses cfront/ARM style
mangling, could be supported properly by the redirects in this
module. Except we can't because it doesn't put its allocation
@@ -65,10 +91,38 @@
compilation unit holding main(), which makes them impossible to
intercept directly. Fortunately those fns seem to route everything
through to malloc/free.
+
+ mid-06: could be improved, since we can now intercept in the main
+ executable too.
*/
=20
extern void _exit(int);
=20
+/* Apparently it is necessary to make ourselves free of any dependency
+ on memcpy() on ppc32-aix5; else programs linked with -brtl fail.
+ memcpy() is used by gcc for a struct assignment in mallinfo()
+ below. Add the following conservative implementation (memmove,
+ really). */
+#if defined(VGO_aix5)
+__attribute__((weak))
+void *memcpy(void *destV, const void *srcV, unsigned long n)
+{
+ unsigned char* src =3D (unsigned char*)srcV;
+ unsigned char* dest =3D (unsigned char*)destV;
+ unsigned long i;
+ if (dest < src) {
+ for (i =3D 0; i < n; i++)
+ dest[i] =3D src[i];
+ }
+ if (dest > src) {
+ for (i =3D n; i > 0; i--)
+ dest[i-1] =3D src[i-1];
+ }
+ return dest;
+}
+#endif
+
+
/*------------------------------------------------------------*/
/*--- Replacing malloc() et al ---*/
/*------------------------------------------------------------*/
@@ -98,6 +152,9 @@
replacing.
*/
=20
+
+/*---------------------- malloc ----------------------*/
+
/* Generate a replacement for 'fnname' in object 'soname', which calls
'vg_replacement' to allocate memory. If that fails, return NULL.
*/
@@ -146,74 +203,103 @@
// (from_so, from_fn, v's replacement)
=20
// malloc
-ALLOC_or_NULL(m_libstc_plus_plus_star, malloc, malloc);
-ALLOC_or_NULL(m_libc_dot_so_star, malloc, malloc);
-//ALLOC_or_NULL(m_libpgc_dot_so, malloc, malloc);
+ALLOC_or_NULL(m_libstdcxx_soname, malloc, malloc);
+ALLOC_or_NULL(m_libc_soname, malloc, malloc);
=20
=20
+/*---------------------- new ----------------------*/
+
// operator new(unsigned int), not mangled (for gcc 2.96)
-ALLOC_or_BOMB(m_libstc_plus_plus_star, builtin_new, __builtin_new);
-ALLOC_or_BOMB(m_libc_dot_so_star, builtin_new, __builtin_new);
+ALLOC_or_BOMB(m_libcstdcxx_soname, builtin_new, __builtin_new);
+ALLOC_or_BOMB(m_libc_soname, builtin_new, __builtin_new);
=20
-ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_new, __builtin_new);
-ALLOC_or_BOMB(m_libc_dot_so_star, __builtin_new, __builtin_new);
+ALLOC_or_BOMB(m_libcstdcxx_soname, __builtin_new, __builtin_new);
+ALLOC_or_BOMB(m_libc_soname, __builtin_new, __builtin_new);
=20
-// operator new(unsigned int), GNU mangling, 32-bit platforms
-// operator new(unsigned long), GNU mangling, 64-bit platforms
+// operator new(unsigned int), GNU mangling
#if VG_WORDSIZE =3D=3D 4
- ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwj, __builtin_new);
- ALLOC_or_BOMB(m_libc_dot_so_star, _Znwj, __builtin_new);
+ ALLOC_or_BOMB(m_libstdcxx_soname, _Znwj, __builtin_new);
+ ALLOC_or_BOMB(m_libc_soname, _Znwj, __builtin_new);
#endif
-#if VG_WORDSIZE =3D=3D 8
- ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znwm, __builtin_new);
- ALLOC_or_BOMB(m_libc_dot_so_star, _Znwm, __builtin_new);
+
+// operator new(unsigned long), GNU mangling
+#if VG_WORDSIZE =3D=3D 8 || defined(VGP_ppc32_aix5)
+ ALLOC_or_BOMB(m_libstdcxx_soname, _Znwm, __builtin_new);
+ ALLOC_or_BOMB(m_libc_soname, _Znwm, __builtin_new);
#endif
=20
+// operator new(unsigned long), ARM/cfront mangling
+#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ ALLOC_or_BOMB(m_libC_dot_a, __nw__FUl, __builtin_new);
+#endif
=20
-// operator new(unsigned int), ARM/cfront mangling
-//ALLOC_or_BOMB(m_libpgc_dot_so, __nw__FUi, __builtin_new);
=20
+/*---------------------- new nothrow ----------------------*/
=20
-// operator new(unsigned, std::nothrow_t const&), GNU mangling, 32-bit
-// operator new(unsigned long, std::nothrow_t const&), GNU mangling, 64-=
bit
+// operator new(unsigned, std::nothrow_t const&), GNU mangling
#if VG_WORDSIZE =3D=3D 4
- ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwjRKSt9nothrow_t, __builtin_=
new);
- ALLOC_or_NULL(m_libc_dot_so_star, _ZnwjRKSt9nothrow_t, __builtin_=
new);
+ ALLOC_or_NULL(m_libstdcxx_soname, _ZnwjRKSt9nothrow_t, __builtin_new);
+ ALLOC_or_NULL(m_libc_soname, _ZnwjRKSt9nothrow_t, __builtin_new);
#endif
-#if VG_WORDSIZE =3D=3D 8
- ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnwmRKSt9nothrow_t, __builtin_=
new);
- ALLOC_or_NULL(m_libc_dot_so_star, _ZnwmRKSt9nothrow_t, __builtin_=
new);
+
+// operator new(unsigned long, std::nothrow_t const&), GNU mangling
+#if VG_WORDSIZE =3D=3D 8 || defined(VGP_ppc32_aix5) || defined(VGP_ppc64=
_aix5)
+ ALLOC_or_NULL(m_libstdcxx_soname, _ZnwmRKSt9nothrow_t, __builtin_new);
+ ALLOC_or_NULL(m_libc_soname, _ZnwmRKSt9nothrow_t, __builtin_new);
#endif
=20
+// operator new(unsigned long, std::nothrow_t const&), ARM/cfront mangli=
ng
+#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ ALLOC_or_NULL(m_libC_dot_a, __nw__FUlRCQ2_3std9nothrow_t, __builtin_=
new);
+#endif
=20
+
+/*---------------------- new [] ----------------------*/
+
// operator new[](unsigned int), not mangled (for gcc 2.96)
-ALLOC_or_BOMB(m_libstc_plus_plus_star, __builtin_vec_new, __builtin_vec_=
new );
-ALLOC_or_BOMB(m_libc_dot_so_star, __builtin_vec_new, __builtin_vec_=
new );
+ALLOC_or_BOMB(m_libcstdcxx_soname, __builtin_vec_new, __builtin_vec_new =
);
+ALLOC_or_BOMB(m_libc_soname, __builtin_vec_new, __builtin_vec_new =
);
=20
-// operator new[](unsigned int), GNU mangling, 32-bit platforms
-// operator new[](unsigned long), GNU mangling, 64-bit platforms
+// operator new[](unsigned int), GNU mangling
#if VG_WORDSIZE =3D=3D 4
- ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znaj, __builtin_vec=
_new );
- ALLOC_or_BOMB(m_libc_dot_so_star, _Znaj, __builtin_vec=
_new );
+ ALLOC_or_BOMB(m_libstdcxx_soname, _Znaj, __builtin_vec_new =
);
+ ALLOC_or_BOMB(m_libc_soname, _Znaj, __builtin_vec_new =
);
#endif
-#if VG_WORDSIZE =3D=3D 8
- ALLOC_or_BOMB(m_libstc_plus_plus_star, _Znam, __builtin_vec=
_new );
- ALLOC_or_BOMB(m_libc_dot_so_star, _Znam, __builtin_vec_=
new );
+
+// operator new[](unsigned long), GNU mangling
+#if VG_WORDSIZE =3D=3D 8 || defined(VGP_ppc32_aix5) || defined(VGP_ppc64=
_aix5)
+ ALLOC_or_BOMB(m_libstdcxx_soname, _Znam, __builtin_vec_new =
);
+ ALLOC_or_BOMB(m_libc_soname, _Znam, __builtin_vec_new =
);
#endif
=20
+// operator new[](unsigned long), ARM/cfront mangling
+#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ ALLOC_or_BOMB(m_libC_dot_a, __vn__FUl, __builtin_vec_new)=
;
+#endif
=20
-// operator new[](unsigned, std::nothrow_t const&), GNU mangling, 32-bit
-// operator new[](unsigned long, std::nothrow_t const&), GNU mangling, 6=
4-bit
+
+/*---------------------- new [] nothrow ----------------------*/
+
+// operator new[](unsigned, std::nothrow_t const&), GNU mangling
#if VG_WORDSIZE =3D=3D 4
- ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnajRKSt9nothrow_t, __builtin_v=
ec_new );
- ALLOC_or_NULL(m_libc_dot_so_star, _ZnajRKSt9nothrow_t, __builtin_v=
ec_new );
+ ALLOC_or_NULL(m_libstdcxx_soname, _ZnajRKSt9nothrow_t, __builtin_vec_ne=
w );
+ ALLOC_or_NULL(m_libc_soname, _ZnajRKSt9nothrow_t, __builtin_vec_ne=
w );
#endif
-#if VG_WORDSIZE =3D=3D 8
- ALLOC_or_NULL(m_libstc_plus_plus_star, _ZnamRKSt9nothrow_t, __builtin_v=
ec_new );
- ALLOC_or_NULL(m_libc_dot_so_star, _ZnamRKSt9nothrow_t, __builtin_v=
ec_new );
+
+// operator new[](unsigned long, std::nothrow_t const&), GNU mangling
+#if VG_WORDSIZE =3D=3D 8 || defined(VGP_ppc32_aix5) || defined(VGP_ppc64=
_aix5)
+ ALLOC_or_NULL(m_libstdcxx_soname, _ZnamRKSt9nothrow_t, __builtin_vec_ne=
w );
+ ALLOC_or_NULL(m_libc_soname, _ZnamRKSt9nothrow_t, __builtin_vec_ne=
w );
#endif
=20
+// operator new [](unsigned long, std::nothrow_t const&), ARM/cfront man=
gling
+#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ ALLOC_or_BOMB(m_libC_dot_a, __vn__FUlRCQ2_3std9nothrow_t, __builtin_v=
ec_new );
+#endif
=20
+
+/*---------------------- free ----------------------*/
+
/* Generate a replacement for 'fnname' in object 'soname', which calls
'vg_replacement' to free previously allocated memory.
*/
@@ -230,38 +316,63 @@
}
=20
// free
-FREE(m_libstc_plus_plus_star, free, free );
-FREE(m_libc_dot_so_star, free, free );
+FREE(m_libstdcxx_soname, free, free );
+FREE(m_libc_soname, free, free );
=20
+
+/*---------------------- cfree ----------------------*/
+
// cfree
-FREE(m_libstc_plus_plus_star, cfree, free );
-FREE(m_libc_dot_so_star, cfree, free );
+FREE(m_libstdcxx_soname, cfree, free );
+FREE(m_libc_soname, cfree, free );
=20
+
+/*---------------------- delete ----------------------*/
// operator delete(void*), not mangled (for gcc 2.96)
-FREE(m_libstc_plus_plus_star, __builtin_delete, __builtin_delete );
-FREE(m_libc_dot_so_star, __builtin_delete, __builtin_delete );
+FREE(m_libcstdcxx_soname, __builtin_delete, __builtin_delete );
+FREE(m_libc_soname, __builtin_delete, __builtin_delete );
=20
// operator delete(void*), GNU mangling
-FREE(m_libstc_plus_plus_star, _ZdlPv, __builtin_delete );
-FREE(m_libc_dot_so_star, _ZdlPv, __builtin_delete );
+FREE(m_libstdcxx_soname, _ZdlPv, __builtin_delete );
+FREE(m_libc_soname, _ZdlPv, __builtin_delete );
=20
+// operator delete(void*), ARM/cfront mangling
+#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+FREE(m_libC_dot_a, __dl__FPv, __builtin_delete );
+#endif
+
+
+/*---------------------- delete nothrow ----------------------*/
+
// operator delete(void*, std::nothrow_t const&), GNU mangling
-FREE(m_libstc_plus_plus_star, _ZdlPvRKSt9nothrow_t, __builtin_delete );
-FREE(m_libc_dot_so_star, _ZdlPvRKSt9nothrow_t, __builtin_delete );
+FREE(m_libstdcxx_soname, _ZdlPvRKSt9nothrow_t, __builtin_delete );
+FREE(m_libc_soname, _ZdlPvRKSt9nothrow_t, __builtin_delete );
=20
+
+/*---------------------- delete [] ----------------------*/
// operator delete[](void*), not mangled (for gcc 2.96)
-FREE(m_libstc_plus_plus_star, __builtin_vec_delete, __builtin_vec_delet=
e );
-FREE(m_libc_dot_so_star, __builtin_vec_delete, __builtin_vec_delet=
e );
+FREE(m_libcstdcxx_soname, __builtin_vec_delete, __builtin_vec_delete );
+FREE(m_libc_soname, __builtin_vec_delete, __builtin_vec_delete );
=20
// operator delete[](void*), GNU mangling
-FREE(m_libstc_plus_plus_star, _ZdaPv, __builtin_vec_delet=
e );
-FREE(m_libc_dot_so_star, _ZdaPv, __builtin_vec_delet=
e );
+FREE(m_libstdcxx_soname, _ZdaPv, __builtin_vec_delete );
+FREE(m_libc_soname, _ZdaPv, __builtin_vec_delete );
=20
+// operator delete[](void*), ARM/cfront mangling
+#if defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+FREE(m_libC_dot_a, __vd__FPv, __builtin_vec_delete );
+#endif
+
+
+/*---------------------- delete [] nothrow ----------------------*/
+
// operator delete[](void*, std::nothrow_t const&), GNU mangling
-FREE(m_libstc_plus_plus_star, _ZdaPvRKSt9nothrow_t, __builtin_vec_delet=
e );
-FREE(m_libc_dot_so_star, _ZdaPvRKSt9nothrow_t, __builtin_vec_delet=
e );
+FREE(m_libstdcxx_soname, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
+FREE(m_libc_soname, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
=20
=20
+/*---------------------- calloc ----------------------*/
+
#define CALLOC(soname, fnname) \
\
void* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( SizeT nmemb, SizeT size=
); \
@@ -277,9 +388,11 @@
return v; \
}
=20
-CALLOC(m_libc_dot_so_star, calloc);
+CALLOC(m_libc_soname, calloc);
=20
=20
+/*---------------------- realloc ----------------------*/
+
#define REALLOC(soname, fnname) \
\
void* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( void* ptrV, SizeT new_s=
ize );\
@@ -293,9 +406,9 @@
if (ptrV =3D=3D NULL) \
/* We need to call a malloc-like function; so let's use \
one which we know exists. */ \
- return VG_REPLACE_FUNCTION_ZU(libcZdsoZa,malloc) (new_size); \
+ return VG_REPLACE_FUNCTION_ZU(m_libc_soname,malloc) (new_size);=
\
if (new_size <=3D 0) { \
- VG_REPLACE_FUNCTION_ZU(libcZdsoZa,free)(ptrV); \
+ VG_REPLACE_FUNCTION_ZU(m_libc_soname,free)(ptrV); \
MALLOC_TRACE(" =3D 0"); \
return NULL; \
} \
@@ -304,9 +417,11 @@
return v; \
}
=20
-REALLOC(m_libc_dot_so_star, realloc);
+REALLOC(m_libc_soname, realloc);
=20
=20
+/*---------------------- memalign ----------------------*/
+
#define MEMALIGN(soname, fnname) \
\
void* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( SizeT alignment, SizeT =
n ); \
@@ -330,20 +445,24 @@
return v; \
}
=20
-MEMALIGN(m_libc_dot_so_star, memalign);
+MEMALIGN(m_libc_soname, memalign);
=20
=20
+/*---------------------- valloc ----------------------*/
+
#define VALLOC(soname, fnname) \
\
void* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( SizeT size ); \
void* VG_REPLACE_FUNCTION_ZU(soname,fnname) ( SizeT size ) \
{ \
- return VG_REPLACE_FUNCTION_ZU(libcZdsoZa,memalign)(VKI_PAGE_SIZE, =
size); \
+ return VG_REPLACE_FUNCTION_ZU(m_libc_soname,memalign)(VKI_PAGE_SIZ=
E, size); \
}
=20
-VALLOC(m_libc_dot_so_star, valloc);
+VALLOC(m_libc_soname, valloc);
=20
=20
+/*---------------------- mallopt ----------------------*/
+
/* Various compatibility wrapper functions, for glibc and libstdc++. */
=20
#define MALLOPT(soname, fnname) \
@@ -356,9 +475,10 @@
return 1; \
}
=20
-MALLOPT(m_libc_dot_so_star, mallopt);
+MALLOPT(m_libc_soname, mallopt);
=20
=20
+/*---------------------- malloc_trim ----------------------*/
// Documentation says:
// malloc_trim(size_t pad);
//=20
@@ -391,9 +511,11 @@
return 0; \
}
=20
-MALLOC_TRIM(m_libc_dot_so_star, malloc_trim);
+MALLOC_TRIM(m_libc_soname, malloc_trim);
=20
=20
+/*---------------------- posix_memalign ----------------------*/
+
#define POSIX_MEMALIGN(soname, fnname) \
\
int VG_REPLACE_FUNCTION_ZU(soname, fnname) ( void **memptr, \
@@ -409,7 +531,7 @@
|| (alignment & (alignment - 1)) !=3D 0) \
return VKI_EINVAL; \
\
- mem =3D VG_REPLACE_FUNCTION_ZU(libcZdsoZa,memalign)(alignment, siz=
e); \
+ mem =3D VG_REPLACE_FUNCTION_ZU(m_libc_soname,memalign)(alignment, =
size); \
\
if (mem !=3D NULL) { \
*memptr =3D mem; \
@@ -419,9 +541,11 @@
return VKI_ENOMEM; \
}
=20
-POSIX_MEMALIGN(m_libc_dot_so_star, posix_memalign);
+POSIX_MEMALIGN(m_libc_soname, posix_memalign);
=20
=20
+/*---------------------- malloc_usable_size ----------------------*/
+
#define MALLOC_USABLE_SIZE(soname, fnname) \
\
int VG_REPLACE_FUNCTION_ZU(soname, fnname) ( void* p ); \
@@ -441,9 +565,11 @@
return pszB; \
}
=20
-MALLOC_USABLE_SIZE(m_libc_dot_so_star, malloc_usable_size);
+MALLOC_USABLE_SIZE(m_libc_soname, malloc_usable_size);
=20
=20
+/*---------------------- (unimplemented) ----------------------*/
+
/* Bomb out if we get any of these. */
=20
static void panic(const char *str)
@@ -461,11 +587,14 @@
panic(#fnname); \
}
=20
-PANIC(m_libc_dot_so_star, pvalloc);
-PANIC(m_libc_dot_so_star, malloc_stats);
-PANIC(m_libc_dot_so_star, malloc_get_state);
-PANIC(m_libc_dot_so_star, malloc_set_state);
+PANIC(m_libc_soname, pvalloc);
+PANIC(m_libc_soname, malloc_stats);
+PANIC(m_libc_soname, malloc_get_state);
+PANIC(m_libc_soname, malloc_set_state);
=20
+
+/*---------------------- mallinfo ----------------------*/
+
// mi must be static; if it is auto then Memcheck thinks it is
// uninitialised when used by the caller of this function, because Memch=
eck
// doesn't know that the call to mallinfo fills in mi.
@@ -481,7 +610,7 @@
return mi; \
}
=20
-MALLINFO(m_libc_dot_so_star, mallinfo);
+MALLINFO(m_libc_soname, mallinfo);
=20
=20
/* All the code in here is unused until this function is called */
|
|
From: <sv...@va...> - 2006-10-17 01:49:54
|
Author: sewardj
Date: 2006-10-17 02:49:50 +0100 (Tue, 17 Oct 2006)
New Revision: 6279
Log:
Merge r6143: Deal with ppc{32,64}-aix5.
Modified:
trunk/tests/cputest.c
Modified: trunk/tests/cputest.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
--- trunk/tests/cputest.c 2006-10-17 01:48:41 UTC (rev 6278)
+++ trunk/tests/cputest.c 2006-10-17 01:49:50 UTC (rev 6279)
@@ -23,7 +23,7 @@
NULL
};
=20
-#if defined(__powerpc__) && !defined(__powerpc64__)
+#if !defined(_AIX) && defined(__powerpc__) && !defined(__powerpc64__)
static Bool go(char* cpu)
{
if ( strcmp( cpu, "ppc32" ) =3D=3D 0 )
@@ -32,7 +32,7 @@
}
#endif // __powerpc__ (32)
=20
-#if defined(__powerpc__) && defined(__powerpc64__)
+#if !defined(_AIX) && defined(__powerpc__) && defined(__powerpc64__)
static Bool go(char* cpu)
{
if ( strcmp( cpu, "ppc64" ) =3D=3D 0 )
@@ -43,7 +43,24 @@
}
#endif // __powerpc__ (64)
=20
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(_AIX)
+static Bool go(char* cpu)
+{
+ if (sizeof(void*) =3D=3D 8) {
+ /* cpu is in 64-bit mode */
+ if ( strcmp( cpu, "ppc64" ) =3D=3D 0 )
+ return True;
+ if ( strcmp( cpu, "ppc32" ) =3D=3D 0 )
+ return True;
+ } else {
+ if ( strcmp( cpu, "ppc32" ) =3D=3D 0 )
+ return True;
+ }
+ return False;
+}
+#endif // _AIX
+
+#if !defined(_AIX) && (defined(__i386__) || defined(__x86_64__))
static void cpuid ( unsigned int n,
unsigned int* a, unsigned int* b,
unsigned int* c, unsigned int* d )
@@ -106,7 +123,7 @@
}
return False;
}
-#endif // __i386__ || __x86_64__
+#endif // !_AIX && (__i386__ || __x86_64__)
=20
=20
int main(int argc, char **argv)
|
|
From: <sv...@va...> - 2006-10-17 01:48:44
|
Author: sewardj
Date: 2006-10-17 02:48:41 +0100 (Tue, 17 Oct 2006)
New Revision: 6278
Log:
Merge r6142:
Minor enhancements, including dealing with 6-digit PIDs, dealing with
object names of the form "foo.a(bar.o)", and removing debuglog level
zero output.
Modified:
trunk/tests/filter_stderr_basic
trunk/tests/filter_test_paths
Modified: trunk/tests/filter_stderr_basic
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tests/filter_stderr_basic 2006-10-17 01:48:02 UTC (rev 6277)
+++ trunk/tests/filter_stderr_basic 2006-10-17 01:48:41 UTC (rev 6278)
@@ -6,8 +6,14 @@
dir=3D`dirname $0`
=20
# Remove =3D=3Dpid=3D=3D and --pid-- and ++pid++ and **pid** strings=20
-sed "s/\(=3D=3D\|--\|\+\+\|\*\*\)[0-9]\{1,5\}\1 //" |
+sed "s/\(=3D=3D\|--\|\+\+\|\*\*\)[0-9]\{1,6\}\1 //" |
=20
+# Remove any --pid:0: strings (debuglog level zero output)
+sed "/^--[0-9]\{1,6\}:0:*/d" |
+
+# Remove "WARNING: assuming toc 0x.." strings
+sed "/^WARNING: assuming toc 0x*/d" |
+
# Remove "Using valgrind..." line and the following
# copyright notice line. Tools have to filter their own line themselves=
.
sed "/^Using valgrind-.*, a dynamic binary instrumentation framework/ , =
/./ d" |
Modified: trunk/tests/filter_test_paths
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/tests/filter_test_paths 2006-10-17 01:48:02 UTC (rev 6277)
+++ trunk/tests/filter_test_paths 2006-10-17 01:48:41 UTC (rev 6278)
@@ -3,10 +3,11 @@
# Anonymise paths like "/local/foo/bar/tests/baz/quux" (note "tests" is =
there)
#sed "s/\/.*\/tests\//\/...\/tests\//"
=20
-# Remove these two kinds of lines, which tend to appear beneath
+# Remove these three kinds of lines, which tend to appear beneath
# the stack frame of __libc_start_main
# by 0x........: (within /.../tests/malloc2)
# by 0x........: ??? (start.S:81)
+# by 0x........: function_name (in object_name)
sed "s/by 0x........: (within [^)]*)/by 0x........: .../" | \
-sed "s/by 0x........: ??? ([^)]*)/by 0x........: .../"
-
+sed "s/by 0x........: ??? ([^)]*)/by 0x........: .../" | \
+sed "s/by 0x........: [a-zA-Z0-9_]* (in [^)]*)/by 0x........: .../"
|
|
From: <sv...@va...> - 2006-10-17 01:48:05
|
Author: sewardj Date: 2006-10-17 02:48:02 +0100 (Tue, 17 Oct 2006) New Revision: 6277 Log: Merge r6141: Update Modified: trunk/docs/internals/register-uses.txt Modified: trunk/docs/internals/register-uses.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/docs/internals/register-uses.txt 2006-10-17 01:47:30 UTC (rev 6= 276) +++ trunk/docs/internals/register-uses.txt 2006-10-17 01:48:02 UTC (rev 6= 277) @@ -89,3 +89,44 @@ xer n fpscr =20 + +ppc64-linux +~~~~~~~~~~~ +TBD + + +ppc32-aix5 +~~~~~~~~~~ + +Reg Callee Arg =20 +Name Saves? Reg? Comment Vex-uses? +------------------------------------------------------------------- +r0 n n sometimes RAZ +r1 y n stack pointer +r2 n n TOC pointer +r3 n int#1 int[31:0] retreg y +r4 n int#2 also int retreg y +r5 n int#3 y +r6 n int#4 y +r7 n int#5 y +r8 n int#6 y +r9 n int#7 y +r10 n int#8 y +r11 n "env pointer?!" y +r12 n "exn handling" y +r13 ? "reserved in 64-bit env" +r14-28 y y +r29 y reserved for dispatcher +r30 y altivec spill temporary +r31 y & guest state +f0 n +f1 n fp#1 fp retreg +f2-13 n fp#2-13 =20 +f14-31 y y (14-21) +v0-v19 ? +v20-31 y y (20-27,29) +cr0-7 +lr y return address +ctr n +xer n +fpscr |
|
From: <sv...@va...> - 2006-10-17 01:47:33
|
Author: sewardj
Date: 2006-10-17 02:47:30 +0100 (Tue, 17 Oct 2006)
New Revision: 6276
Log:
Merge r6140 (some of):
- track SysRes changes
- track VG_(am_find_nsegment) const-ness change
- increase number of client syscall args supported from 6 to 8
- simplify type SyscallStatus. Simply hold a copy of the SysRes
for the syscall rather than have this be a data structure
incorporating something very similar to the fields of a SysRes,
and more besides. Change various macros in priv_types_n_macros.h
to match.
- syswrap-main.c: instantiate the various impedance-matching
functions for AIX.
Modified:
trunk/coregrind/m_syswrap/priv_types_n_macros.h
trunk/coregrind/m_syswrap/syscall-ppc64-linux.S
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
Modified: trunk/coregrind/m_syswrap/priv_types_n_macros.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
--- trunk/coregrind/m_syswrap/priv_types_n_macros.h 2006-10-17 01:46:55 U=
TC (rev 6275)
+++ trunk/coregrind/m_syswrap/priv_types_n_macros.h 2006-10-17 01:47:30 U=
TC (rev 6276)
@@ -57,14 +57,23 @@
UWord arg4;
UWord arg5;
UWord arg6;
+ UWord arg7;
+ UWord arg8;
}
SyscallArgs;
=20
/* Current status of a syscall being done on behalf of the client. */
typedef
struct {
- enum { SsSuccess=3D1, SsFailure, SsHandToKernel, SsIdle } what;
- UWord val; /* only meaningful for .what =3D=3D Success or Failure =
*/
+ enum {=20
+ /* call is complete, result is in 'res' */
+ SsComplete=3D1,
+ /* syscall not yet completed; must be handed to the kernel */
+ SsHandToKernel,=20
+ /* not currently handling a syscall for this thread */
+ SsIdle=20
+ } what;
+ SysRes sres; /* only meaningful for .what =3D=3D SsComplete */
}
SyscallStatus;
=20
@@ -78,6 +87,8 @@
Int o_arg4;
Int o_arg5;
Int o_arg6;
+ Int o_arg8;
+ Int o_arg7;
Int o_retval;
}
SyscallArgLayout;
@@ -121,14 +132,31 @@
*/
=20
=20
-/* These are defined in the relevant platform-specific files --
- syswrap-arch-os.c */
+#if defined(VGO_linux)
+/* On Linux, finding the wrapper is easy: just look up in fixed,
+ platform-specific tables. These are defined in the relevant
+ platform-specific files -- syswrap-arch-os.c */
=20
extern const SyscallTableEntry ML_(syscall_table)[];
=20
extern const UInt ML_(syscall_table_size);
- =20
=20
+#elif defined(VGP_ppc32_aix5)
+/* On AIX5 this is more complex than the simple fixed table lookup on
+ Linux, since the syscalls don't have fixed numbers. So it's
+ simplest to use a function, which does all the required messing
+ around. */
+extern
+SyscallTableEntry* ML_(get_ppc32_aix5_syscall_entry) ( UInt sysno );
+
+#elif defined(VGP_ppc64_aix5)
+extern
+SyscallTableEntry* ML_(get_ppc64_aix5_syscall_entry) ( UInt sysno );
+
+#else
+# error Unknown OS
+#endif =20
+
/* ---------------------------------------------------------------------
Declaring and defining wrappers.
------------------------------------------------------------------ */
@@ -197,6 +225,11 @@
[sysno] =3D { vgSysWrap_##auxstr##_##name##_before, \
vgSysWrap_##auxstr##_##name##_after }
=20
+#define WRAPPER_PRE_NAME(auxstr, name) \
+ vgSysWrap_##auxstr##_##name##_before
+#define WRAPPER_POST_NAME(auxstr, name) \
+ vgSysWrap_##auxstr##_##name##_after
+
/* Add a generic wrapper to a syscall table. */
#define GENX_(sysno, name) WRAPPER_ENTRY_X_(generic, sysno, name)
#define GENXY(sysno, name) WRAPPER_ENTRY_XY(generic, sysno, name)
@@ -206,8 +239,19 @@
#define LINX_(sysno, name) WRAPPER_ENTRY_X_(linux, sysno, name)=20
#define LINXY(sysno, name) WRAPPER_ENTRY_XY(linux, sysno, name)
=20
+/* Add an AIX5-specific, arch-independent wrapper to a syscall
+ table. */
+#define AIXXY(sysno, name) \
+ { & sysno, \
+ { & WRAPPER_PRE_NAME(aix5, name), \
+ & WRAPPER_POST_NAME(aix5, name) }}=20
=20
+#define AIXX_(sysno, name) \
+ { & sysno, \
+ { & WRAPPER_PRE_NAME(aix5, name), \
+ NULL }}=20
=20
+
/* ---------------------------------------------------------------------
Macros useful for writing wrappers concisely. These refer to the
parameters declared by DEFN_{PRE,POST}_TEMPLATE and so in a way do
@@ -224,57 +268,48 @@
#define ARG4 (arrghs->arg4)
#define ARG5 (arrghs->arg5)
#define ARG6 (arrghs->arg6)
+#define ARG7 (arrghs->arg7)
+#define ARG8 (arrghs->arg8)
=20
-/* Reference to the syscall's current result status/value. Note that
- =20
- (1) status->val by itself is meaningless -- you have to consider it
- together with status->what, which is why RES uses a helper
- function (this also has the desirable effect of turning RES
- into a non-lvalue).
-
- (2) post-wrappers will not get called in case of failure (unless
- PostOnFail is set, which is rare). This is why the assertion
- in getRES is viable.
-
- If you really really want to just get hold of status->val without
- inspecting status->what, use RES_unchecked. This is dangerous and
- therefore discouraged. =20
-*/
-#define SUCCESS (status->what =3D=3D SsSuccess)
-#define FAILURE (status->what =3D=3D SsFailure)
+/* Reference to the syscall's current result status/value. General
+ paranoia all round. */
+#define SUCCESS (status->what =3D=3D SsComplete && !status->sres.i=
sError)
+#define FAILURE (status->what =3D=3D SsComplete && status->sres.i=
sError)
#define SWHAT (status->what)
-#define RES_unchecked (status->val) /* do not use! */
-#define RES (getRES(status)) /* use this instead, if possible=
*/
+#define RES (getRES(status))
+#define ERR (getERR(status))
=20
static inline UWord getRES ( SyscallStatus* st ) {
- vg_assert(st->what =3D=3D SsSuccess);
- return st->val;
+ vg_assert(st->what =3D=3D SsComplete);
+ vg_assert(!st->sres.isError);
+ return st->sres.res;
}
=20
+static inline UWord getERR ( SyscallStatus* st ) {
+ vg_assert(st->what =3D=3D SsComplete);
+ vg_assert(st->sres.isError);
+ return st->sres.err;
+}
=20
=20
/* Set the current result status/value in various ways. */
#define SET_STATUS_Success(zzz) \
- do { status->what =3D SsSuccess; \
- status->val =3D (zzz); \
+ do { status->what =3D SsComplete; \
+ status->sres =3D VG_(mk_SysRes_Success)(zzz); \
} while (0)
=20
#define SET_STATUS_Failure(zzz) \
do { Word wzz =3D (Word)(zzz); \
/* Catch out wildly bogus error values. */ \
vg_assert(wzz >=3D 0 && wzz < 10000); \
- status->what =3D SsFailure; \
- status->val =3D wzz; \
+ status->what =3D SsComplete; \
+ status->sres =3D VG_(mk_SysRes_Error)(wzz); \
} while (0)
=20
#define SET_STATUS_from_SysRes(zzz) \
do { \
- SysRes zres =3D (zzz); \
- if (zres.isError) { \
- SET_STATUS_Failure(zres.val); \
- } else { \
- SET_STATUS_Success(zres.val); \
- } \
+ status->what =3D SsComplete; \
+ status->sres =3D (zzz); \
} while (0)
=20
/* A lamentable kludge */
@@ -284,17 +319,7 @@
status->val =3D wzz; \
} while (0)
=20
-#define SET_STATUS_from_SysRes_NO_SANITY_CHECK(zzz) \
- do { \
- SysRes zres =3D (zzz); \
- if (zres.isError) { \
- SET_STATUS_Failure_NO_SANITY_CHECK(zres.val); \
- } else { \
- SET_STATUS_Success(zres.val); \
- } \
- } while (0)
=20
-
#define PRINT(format, args...) \
if (VG_(clo_trace_syscalls)) \
VG_(printf)(format, ## args)
@@ -329,6 +354,7 @@
do { \
Int here =3D layout->o_arg##n; \
vg_assert(sizeof(t) <=3D sizeof(UWord)); \
+ vg_assert(here >=3D 0); \
VG_(tdict).track_pre_reg_read( \
Vg_CoreSysCall, tid, s"("#a")", \
here, sizeof(t) \
@@ -343,8 +369,10 @@
*/
#define PRRAn_BE(n,s,t,a) \
do { \
+ Int here =3D layout->o_arg##n; \
Int next =3D layout->o_arg##n + sizeof(UWord); \
vg_assert(sizeof(t) <=3D sizeof(UWord)); \
+ vg_assert(here >=3D 0); \
VG_(tdict).track_pre_reg_read( \
Vg_CoreSysCall, tid, s"("#a")", \
next-sizeof(t), sizeof(t) \
Modified: trunk/coregrind/m_syswrap/syscall-ppc64-linux.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_syswrap/syscall-ppc64-linux.S 2006-10-17 01:46:55 U=
TC (rev 6275)
+++ trunk/coregrind/m_syswrap/syscall-ppc64-linux.S 2006-10-17 01:47:30 U=
TC (rev 6276)
@@ -7,7 +7,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
=20
- Copyright (C) 2005 Paul Mackerras <pa...@sa...>
+ Copyright (C) 2005-2006 Paul Mackerras <pa...@sa...>
=20
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Modified: trunk/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
--- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2006-10-17 01:46:55 U=
TC (rev 6275)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2006-10-17 01:47:30 U=
TC (rev 6276)
@@ -205,7 +205,7 @@
ThreadState* ptst =3D VG_(get_ThreadState)(ptid);
ThreadState* ctst =3D VG_(get_ThreadState)(ctid);
UWord* stack;
- NSegment* seg;
+ NSegment const* seg;
SysRes res;
Long rax;
vki_sigset_t blockall, savedmask;
Modified: trunk/coregrind/m_syswrap/syswrap-generic.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
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2006-10-17 01:46:55 UTC (=
rev 6275)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2006-10-17 01:47:30 UTC (=
rev 6276)
@@ -177,7 +177,7 @@
# define MIN_SIZET(_aa,_bb) (_aa) < (_bb) ? (_aa) : (_bb)
=20
Bool ok, d;
- NSegment* old_seg;
+ NSegment const* old_seg;
Addr advised;
Bool f_fixed =3D toBool(flags & VKI_MREMAP_FIXED);
Bool f_maymove =3D toBool(flags & VKI_MREMAP_MAYMOVE);
@@ -335,14 +335,14 @@
the next segment along. So make very sure that the proposed
new area really is free. This is perhaps overly
conservative, but it fixes #129866. */
- NSegment* segLo =3D VG_(am_find_nsegment)( needA );
- NSegment* segHi =3D VG_(am_find_nsegment)( needA + needL - 1 );
+ NSegment const* segLo =3D VG_(am_find_nsegment)( needA );
+ NSegment const* segHi =3D VG_(am_find_nsegment)( needA + needL - 1=
);
if (segLo =3D=3D NULL || segHi =3D=3D NULL=20
|| segLo !=3D segHi || segLo->kind !=3D SkFree)
ok =3D False;
}
if (ok && advised =3D=3D needA) {
- ok =3D VG_(am_extend_map_client)( &d, old_seg, needL );
+ ok =3D VG_(am_extend_map_client)( &d, (NSegment*)old_seg, needL );
if (ok) {
VG_TRACK( new_mem_mmap, needA, needL,=20
old_seg->hasR,=20
@@ -393,15 +393,15 @@
this-or-nothing) is too lenient, and may allow us to trash
the next segment along. So make very sure that the proposed
new area really is free. */
- NSegment* segLo =3D VG_(am_find_nsegment)( needA );
- NSegment* segHi =3D VG_(am_find_nsegment)( needA + needL - 1 );
+ NSegment const* segLo =3D VG_(am_find_nsegment)( needA );
+ NSegment const* segHi =3D VG_(am_find_nsegment)( needA + needL - 1=
);
if (segLo =3D=3D NULL || segHi =3D=3D NULL=20
|| segLo !=3D segHi || segLo->kind !=3D SkFree)
ok =3D False;
}
if (!ok || advised !=3D needA)
goto eNOMEM;
- ok =3D VG_(am_extend_map_client)( &d, old_seg, needL );
+ ok =3D VG_(am_extend_map_client)( &d, (NSegment*)old_seg, needL );
if (!ok)
goto eNOMEM;
VG_TRACK( new_mem_mmap, needA, needL,=20
@@ -703,23 +703,23 @@
return;
}
=20
- while ((ret =3D VG_(getdents)(f.val, &d, sizeof(d))) !=3D 0) {
+ while ((ret =3D VG_(getdents)(f.res, &d, sizeof(d))) !=3D 0) {
if (ret =3D=3D -1)
goto out;
=20
if (VG_(strcmp)(d.d_name, ".") && VG_(strcmp)(d.d_name, "..")) {
Int fno =3D VG_(atoll)(d.d_name);
=20
- if (fno !=3D f.val)
+ if (fno !=3D f.res)
if (VG_(clo_track_fds))
record_fd_open_named(-1, fno);
}
=20
- VG_(lseek)(f.val, d.d_off, VKI_SEEK_SET);
+ VG_(lseek)(f.res, d.d_off, VKI_SEEK_SET);
}
=20
out:
- VG_(close)(f.val);
+ VG_(close)(f.res);
}
=20
static
@@ -947,7 +947,8 @@
=20
static Addr do_brk ( Addr newbrk )
{
- NSegment *aseg, *rseg;
+ NSegment const* aseg;
+ NSegment const* rseg;
Addr newbrkP;
SizeT delta;
Bool ok;
@@ -968,7 +969,7 @@
if (newbrk >=3D VG_(brk_base) && newbrk < VG_(brk_limit)) {
/* shrinking the data segment. Be lazy and don't munmap the
excess area. */
- NSegment* seg =3D VG_(am_find_nsegment)(newbrk);
+ NSegment const * seg =3D VG_(am_find_nsegment)(newbrk);
if (seg && seg->hasT)
VG_(discard_translations)( newbrk, VG_(brk_limit) - newbrk,=20
"do_brk(shrink)" );
@@ -982,7 +983,7 @@
if (seg) {
/* pre: newbrk < VG_(brk_limit)=20
=3D> newbrk <=3D VG_(brk_limit)-1 */
- NSegment* seg2;
+ NSegment const * seg2;
vg_assert(newbrk < VG_(brk_limit));
seg2 =3D VG_(am_find_nsegment)( VG_(brk_limit)-1 );
if (seg2 && seg =3D=3D seg2 && seg->hasW)
@@ -998,7 +999,7 @@
aseg =3D VG_(am_find_nsegment)( VG_(brk_limit)-1 );
else
aseg =3D VG_(am_find_nsegment)( VG_(brk_limit) );
- rseg =3D VG_(am_next_nsegment)( aseg, True/*forwards*/ );
+ rseg =3D VG_(am_next_nsegment)( (NSegment*)aseg, True/*forwards*/ );
=20
/* These should be assured by setup_client_dataseg in m_main. */
vg_assert(aseg);
@@ -1026,7 +1027,7 @@
vg_assert(delta > 0);
vg_assert(VG_IS_PAGE_ALIGNED(delta));
=20
- ok =3D VG_(am_extend_into_adjacent_reservation_client)( aseg, delta )=
;
+ ok =3D VG_(am_extend_into_adjacent_reservation_client)( (NSegment*)as=
eg, delta );
if (!ok) goto bad;
=20
VG_(brk_limit) =3D newbrk;
@@ -1163,12 +1164,12 @@
{
SysRes r =3D res;
vg_assert(!res.isError); /* guaranteed by caller */
- if (!ML_(fd_allowed)(res.val, "socket", tid, True)) {
- VG_(close)(res.val);
+ if (!ML_(fd_allowed)(res.res, "socket", tid, True)) {
+ VG_(close)(res.res);
r =3D VG_(mk_SysRes_Error)( VKI_EMFILE );
} else {
if (VG_(clo_track_fds))
- ML_(record_fd_open_nameless)(tid, res.val);
+ ML_(record_fd_open_nameless)(tid, res.res);
}
return r;
}
@@ -1209,8 +1210,8 @@
{
SysRes r =3D res;
vg_assert(!res.isError); /* guaranteed by caller */
- if (!ML_(fd_allowed)(res.val, "accept", tid, True)) {
- VG_(close)(res.val);
+ if (!ML_(fd_allowed)(res.res, "accept", tid, True)) {
+ VG_(close)(res.res);
r =3D VG_(mk_SysRes_Error)( VKI_EMFILE );
} else {
Addr addr_p =3D arg1;
@@ -1219,7 +1220,7 @@
buf_and_len_post_check ( tid, res, addr_p, addrlen_p,
"socketcall.accept(addrlen_out)" );
if (VG_(clo_track_fds))
- ML_(record_fd_open_nameless)(tid, res.val);
+ ML_(record_fd_open_nameless)(tid, res.res);
}
return r;
}
@@ -1712,7 +1713,7 @@
void
ML_(generic_POST_sys_shmdt) ( ThreadId tid, UWord res, UWord arg0 )
{
- NSegment* s =3D VG_(am_find_nsegment)(arg0);
+ NSegment const* s =3D VG_(am_find_nsegment)(arg0);
=20
if (s !=3D NULL) {
Addr s_start =3D s->start;
@@ -1890,18 +1891,18 @@
if (!sres.isError) {
/* Notify aspacem and the tool. */
ML_(notify_aspacem_and_tool_of_mmap)(=20
- (Addr)sres.val, /* addr kernel actually assigned */
+ (Addr)sres.res, /* addr kernel actually assigned */
arg2, arg3,=20
arg4, /* the original flags value */
arg5, arg6=20
);
/* Load symbols? */
- VG_(di_notify_mmap)( (Addr)sres.val, False/*allow_SkFileV*/ );
+ VG_(di_notify_mmap)( (Addr)sres.res, False/*allow_SkFileV*/ );
}
=20
/* Stay sane */
if (!sres.isError && (arg4 & VKI_MAP_FIXED))
- vg_assert(sres.val =3D=3D arg1);
+ vg_assert(sres.res =3D=3D arg1);
=20
return sres;
}
@@ -1961,7 +1962,7 @@
tst =3D VG_(get_ThreadState)(tid);
/* Set the thread's status to be exiting, then claim that the
syscall succeeded. */
- tst->exitreason =3D VgSrc_ExitSyscall;
+ tst->exitreason =3D VgSrc_ExitThread;
tst->os_state.exitcode =3D ARG1;
SET_STATUS_Success(0);
}
@@ -2370,7 +2371,7 @@
// ok, etc.
res =3D VG_(pre_exec_check)((const Char*)ARG1, NULL);
if (res.isError) {
- SET_STATUS_Failure( res.val );
+ SET_STATUS_Failure( res.res );
return;
}
=20
@@ -2390,7 +2391,7 @@
/* Resistance is futile. Nuke all other threads. POSIX mandates
this. (Really, nuke them all, since the new process will make
its own new thread.) */
- VG_(nuke_all_threads_except)( tid, VgSrc_ExitSyscall );
+ VG_(nuke_all_threads_except)( tid, VgSrc_ExitThread );
VG_(reap_threads)(tid);
=20
// Set up the child's exe path.
@@ -2509,7 +2510,6 @@
{
vki_sigset_t allsigs;
vki_siginfo_t info;
- static const struct vki_timespec zero =3D { 0, 0 };
=20
for (i =3D 1; i < VG_(max_signal); i++) {
struct vki_sigaction sa;
@@ -2523,7 +2523,7 @@
}
=20
VG_(sigfillset)(&allsigs);
- while(VG_(sigtimedwait)(&allsigs, &info, &zero) > 0)
+ while(VG_(sigtimedwait_zero)(&allsigs, &info) > 0)
;
=20
VG_(sigprocmask)(VKI_SIG_SETMASK, &tst->sig_mask, NULL);
@@ -2548,7 +2548,7 @@
hosed:
vg_assert(FAILURE);
VG_(message)(Vg_UserMsg, "execve(%p(%s), %p, %p) failed, errno %d",
- ARG1, ARG1, ARG2, ARG3, RES_unchecked);
+ ARG1, ARG1, ARG2, ARG3, ERR);
VG_(message)(Vg_UserMsg, "EXEC FAILED: I can't recover from "
"execve() failing, so I'm dying.");
VG_(message)(Vg_UserMsg, "Add more stringent tests in PRE(sys_execve)=
, "
@@ -4743,7 +4743,7 @@
tst->os_state.fatalsig =3D VKI_SIGKILL;
=20
if (!VG_(is_running_thread)(tid))
- VG_(kill_thread)(tid);
+ VG_(get_thread_out_of_syscall)(tid);
}
=20
return True;
@@ -4833,13 +4833,13 @@
The sanity check provided by the kernel is that the vma must
have the VM_GROWSDOWN/VM_GROWSUP flag set as appropriate. */
UInt grows =3D ARG3 & (VKI_PROT_GROWSDOWN|VKI_PROT_GROWSUP);
- NSegment *aseg =3D VG_(am_find_nsegment)(ARG1);
- NSegment *rseg;
+ NSegment const *aseg =3D VG_(am_find_nsegment)(ARG1);
+ NSegment const *rseg;
=20
vg_assert(aseg);
=20
if (grows =3D=3D VKI_PROT_GROWSDOWN) {
- rseg =3D VG_(am_next_nsegment)( aseg, False/*backwards*/ );
+ rseg =3D VG_(am_next_nsegment)( (NSegment*)aseg, False/*backwar=
ds*/ );
if (rseg &&
rseg->kind =3D=3D SkResvn &&
rseg->smode =3D=3D SmUpper &&
@@ -4852,7 +4852,7 @@
SET_STATUS_Failure( VKI_EINVAL );
}
} else if (grows =3D=3D VKI_PROT_GROWSUP) {
- rseg =3D VG_(am_next_nsegment)( aseg, True/*forwards*/ );
+ rseg =3D VG_(am_next_nsegment)( (NSegment*)aseg, True/*forwards=
*/ );
if (rseg &&
rseg->kind =3D=3D SkResvn &&
rseg->smode =3D=3D SmLower &&
@@ -4940,7 +4940,7 @@
POST(sys_nanosleep)
{
vg_assert(SUCCESS || FAILURE);
- if (ARG2 !=3D 0 && FAILURE && RES_unchecked =3D=3D VKI_EINTR)
+ if (ARG2 !=3D 0 && FAILURE && ERR =3D=3D VKI_EINTR)
POST_MEM_WRITE( ARG2, sizeof(struct vki_timespec) );
}
=20
@@ -4974,7 +4974,7 @@
sres =3D VG_(dup)( VG_(cl_cmdline_fd) );
SET_STATUS_from_SysRes( sres );
if (!sres.isError) {
- OffT off =3D VG_(lseek)( sres.val, 0, VKI_SEEK_SET );
+ OffT off =3D VG_(lseek)( sres.res, 0, VKI_SEEK_SET );
if (off < 0)
SET_STATUS_Failure( VKI_EMFILE );
}
Modified: trunk/coregrind/m_syswrap/syswrap-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
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2006-10-17 01:46:55 UTC (re=
v 6275)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2006-10-17 01:47:30 UTC (re=
v 6276)
@@ -71,7 +71,7 @@
vg_assert(tst->status =3D=3D VgTs_Init);
=20
/* make sure we get the CPU lock before doing anything significant */
- VG_(set_running)(tid);
+ VG_(set_running)(tid, "thread_wrapper(starting new thread)");
=20
if (0)
VG_(printf)("thread tid %d started: stack =3D %p\n",
@@ -325,7 +325,7 @@
# error Unknown platform
#endif
=20
- if (!res.isError && res.val =3D=3D 0) {
+ if (!res.isError && res.res =3D=3D 0) {
/* child */
VG_(do_atfork_child)(tid);
=20
@@ -333,11 +333,11 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
}=20
else=20
- if (!res.isError && res.val > 0) {
+ if (!res.isError && res.res > 0) {
/* parent */
if (VG_(clo_trace_syscalls))
VG_(printf)(" clone(fork): process %d created child %d\n",=20
- VG_(getpid)(), res.val);
+ VG_(getpid)(), res.res);
=20
/* restore signal mask */
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
@@ -553,11 +553,11 @@
)
continue;
=20
- VG_(threads)[t].exitreason =3D VgSrc_ExitSyscall;
+ VG_(threads)[t].exitreason =3D VgSrc_ExitThread;
VG_(threads)[t].os_state.exitcode =3D ARG1;
=20
if (t !=3D tid)
- VG_(kill_thread)(t); /* unblock it, if blocked */
+ VG_(get_thread_out_of_syscall)(t); /* unblock it, if blocked */
}
=20
/* We have to claim the syscall already succeeded. */
@@ -1498,7 +1498,7 @@
}
POST(sys_clock_nanosleep)
{
- if (ARG4 !=3D 0 && FAILURE && RES_unchecked =3D=3D VKI_EINTR)
+ if (ARG4 !=3D 0 && FAILURE && ERR =3D=3D VKI_EINTR)
POST_MEM_WRITE( ARG4, sizeof(struct vki_timespec) );
}
=20
@@ -2368,7 +2368,7 @@
sres =3D VG_(dup)( VG_(cl_cmdline_fd) );
SET_STATUS_from_SysRes( sres );
if (!sres.isError) {
- OffT off =3D VG_(lseek)( sres.val, 0, VKI_SEEK_SET );
+ OffT off =3D VG_(lseek)( sres.res, 0, VKI_SEEK_SET );
if (off < 0)
SET_STATUS_Failure( VKI_EMFILE );
}
Modified: trunk/coregrind/m_syswrap/syswrap-main.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
--- trunk/coregrind/m_syswrap/syswrap-main.c 2006-10-17 01:46:55 UTC (rev=
6275)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2006-10-17 01:47:30 UTC (rev=
6276)
@@ -31,7 +31,7 @@
#include "libvex_guest_offsets.h"
#include "pub_core_basics.h"
#include "pub_core_vki.h"
-#include "pub_core_basics.h"
+#include "pub_core_vkiscnums.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
@@ -52,13 +52,17 @@
=20
=20
/* Useful info which needs to be recorded somewhere:
- Use of registers in syscalls (on linux) is:
+ Use of registers in syscalls is:
=20
- NUM ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 RESULT
- x86 eax ebx ecx edx esi edi ebp eax (=3D=3D NUM=
)
- amd64 rax rdi rsi rdx r10 r8 r9 rax (=3D=3D NUM=
)
- ppc32 r0 r3 r4 r5 r6 r7 r8 r3+CR0.SO (=3D=3D ARG=
1)
- ppc64 r0 r3 r4 r5 r6 r7 r8 r3+CR0.SO (=3D=3D ARG=
1)
+ NUM ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 ARG7 ARG8 RESULT
+ LINUX:
+ x86 eax ebx ecx edx esi edi ebp n/a n/a eax (=3D=3D =
NUM)
+ amd64 rax rdi rsi rdx r10 r8 r9 n/a n/a rax (=3D=3D =
NUM)
+ ppc32 r0 r3 r4 r5 r6 r7 r8 n/a n/a r3+CR0.SO (=3D=3D =
ARG1)
+ ppc64 r0 r3 r4 r5 r6 r7 r8 n/a n/a r3+CR0.SO (=3D=3D =
ARG1)
+ AIX:
+ ppc32 r2 r3 r4 r5 r6 r7 r8 r9 r10 r3(res),r4(err)
+ ppc64 r2 r3 r4 r5 r6 r7 r8 r9 r10 r3(res),r4(err)
*/
=20
/* This is the top level of the system-call handler module. All
@@ -225,11 +229,15 @@
VG_(fixup_guest_state_after_syscall_interrupted) below for details.
*/
extern
-UWord ML_(do_syscall_for_client_WRK)( Int syscallno,=20
+UWord ML_(do_syscall_for_client_WRK)( Word syscallno,=20
void* guest_state,
const vki_sigset_t *syscall_mask,
const vki_sigset_t *restore_mask,
- Int nsigwords );
+ Word nsigwords
+# if defined(VGO_aix5)
+ , Word __nr_sigprocmask
+# endif
+ );
=20
static
void do_syscall_for_client ( Int syscallno,
@@ -241,6 +249,9 @@
=3D ML_(do_syscall_for_client_WRK)(
syscallno, &tst->arch.vex,=20
syscall_mask, &saved, _VKI_NSIG_WORDS * sizeof(UWord)
+# if defined(VGO_aix5)
+ , __NR_rt_sigprocmask
+# endif
);
vg_assert2(
err =3D=3D 0,
@@ -264,38 +275,28 @@
&& a1->arg3 =3D=3D a2->arg3
&& a1->arg4 =3D=3D a2->arg4
&& a1->arg5 =3D=3D a2->arg5
- && a1->arg6 =3D=3D a2->arg6;
+ && a1->arg6 =3D=3D a2->arg6
+ && a1->arg7 =3D=3D a2->arg7
+ && a1->arg8 =3D=3D a2->arg8;
}
=20
static
Bool eq_SyscallStatus ( SyscallStatus* s1, SyscallStatus* s2 )
{
return s1->what =3D=3D s2->what=20
- && s1->val =3D=3D s2->val;
+ && s1->sres.res =3D=3D s2->sres.res
+ && s1->sres.err =3D=3D s2->sres.err;
}
=20
=20
-/* Convert between SysRet and SyscallStatus, to the extent possible. */
+/* Convert between SysRes and SyscallStatus, to the extent possible. */
=20
-/* This is unused. */
-/*
static
-SysRes convert_SyscallStatus_to_SysRes ( SyscallStatus status )
-{
- SysRes res;
- vg_assert(status.what =3D=3D SsSuccess || status.what =3D=3D SsFailur=
e);
- res.isError =3D status.what =3D=3D SsFailure;
- res.val =3D status.val;
- return res;
-}
-*/
-
-static
SyscallStatus convert_SysRes_to_SyscallStatus ( SysRes res )
{
SyscallStatus status;
- status.what =3D res.isError ? SsFailure : SsSuccess;
- status.val =3D res.val;
+ status.what =3D SsComplete;
+ status.sres =3D res;
return status;
}
=20
@@ -317,6 +318,8 @@
canonical->arg4 =3D gst->guest_ESI;
canonical->arg5 =3D gst->guest_EDI;
canonical->arg6 =3D gst->guest_EBP;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
#elif defined(VGP_amd64_linux)
VexGuestAMD64State* gst =3D (VexGuestAMD64State*)gst_vanilla;
@@ -327,7 +330,10 @@
canonical->arg4 =3D gst->guest_R10;
canonical->arg5 =3D gst->guest_R8;
canonical->arg6 =3D gst->guest_R9;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
+
#elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
canonical->sysno =3D gst->guest_GPR0;
@@ -337,7 +343,10 @@
canonical->arg4 =3D gst->guest_GPR6;
canonical->arg5 =3D gst->guest_GPR7;
canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
+
#elif defined(VGP_ppc64_linux)
VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
canonical->sysno =3D gst->guest_GPR0;
@@ -347,7 +356,34 @@
canonical->arg4 =3D gst->guest_GPR6;
canonical->arg5 =3D gst->guest_GPR7;
canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D 0;
+ canonical->arg8 =3D 0;
=20
+
+#elif defined(VGP_ppc32_aix5)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ canonical->sysno =3D gst->guest_GPR2;
+ canonical->arg1 =3D gst->guest_GPR3;
+ canonical->arg2 =3D gst->guest_GPR4;
+ canonical->arg3 =3D gst->guest_GPR5;
+ canonical->arg4 =3D gst->guest_GPR6;
+ canonical->arg5 =3D gst->guest_GPR7;
+ canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D gst->guest_GPR9;
+ canonical->arg8 =3D gst->guest_GPR10;
+
+#elif defined(VGP_ppc64_aix5)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ canonical->sysno =3D gst->guest_GPR2;
+ canonical->arg1 =3D gst->guest_GPR3;
+ canonical->arg2 =3D gst->guest_GPR4;
+ canonical->arg3 =3D gst->guest_GPR5;
+ canonical->arg4 =3D gst->guest_GPR6;
+ canonical->arg5 =3D gst->guest_GPR7;
+ canonical->arg6 =3D gst->guest_GPR8;
+ canonical->arg7 =3D gst->guest_GPR9;
+ canonical->arg8 =3D gst->guest_GPR10;
+
#else
# error "getSyscallArgsFromGuestState: unknown arch"
#endif
@@ -397,6 +433,30 @@
gst->guest_GPR7 =3D canonical->arg5;
gst->guest_GPR8 =3D canonical->arg6;
=20
+#elif defined(VGP_ppc32_aix5)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ gst->guest_GPR2 =3D canonical->sysno;
+ gst->guest_GPR3 =3D canonical->arg1;
+ gst->guest_GPR4 =3D canonical->arg2;
+ gst->guest_GPR5 =3D canonical->arg3;
+ gst->guest_GPR6 =3D canonical->arg4;
+ gst->guest_GPR7 =3D canonical->arg5;
+ gst->guest_GPR8 =3D canonical->arg6;
+ gst->guest_GPR9 =3D canonical->arg7;
+ gst->guest_GPR10 =3D canonical->arg8;
+
+#elif defined(VGP_ppc64_aix5)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ gst->guest_GPR2 =3D canonical->sysno;
+ gst->guest_GPR3 =3D canonical->arg1;
+ gst->guest_GPR4 =3D canonical->arg2;
+ gst->guest_GPR5 =3D canonical->arg3;
+ gst->guest_GPR6 =3D canonical->arg4;
+ gst->guest_GPR7 =3D canonical->arg5;
+ gst->guest_GPR8 =3D canonical->arg6;
+ gst->guest_GPR9 =3D canonical->arg7;
+ gst->guest_GPR10 =3D canonical->arg8;
+
#else
# error "putSyscallArgsIntoGuestState: unknown arch"
#endif
@@ -406,103 +466,118 @@
void getSyscallStatusFromGuestState ( /*OUT*/SyscallStatus* canonica=
l,
/*IN*/ VexGuestArchState* gst_vani=
lla )
{
-#if defined(VGP_x86_linux)
+# if defined(VGP_x86_linux)
VexGuestX86State* gst =3D (VexGuestX86State*)gst_vanilla;
- Int i =3D (Int)gst->guest_EAX;
- canonical->what =3D i >=3D -4095 && i <=3D -1 ? SsFailure : SsSucce=
ss;
- canonical->val =3D (UWord)(canonical->what=3D=3DSsFailure ? -i : i);
+ canonical->sres =3D VG_(mk_SysRes_x86_linux)( gst->guest_EAX );
+ canonical->what =3D SsComplete;
=20
-#elif defined(VGP_amd64_linux)
+# elif defined(VGP_amd64_linux)
VexGuestAMD64State* gst =3D (VexGuestAMD64State*)gst_vanilla;
- Long i =3D (Long)gst->guest_RAX;
- canonical->what =3D i >=3D -4095 && i <=3D -1 ? SsFailure : SsSucce=
ss;
- canonical->val =3D (UWord)(canonical->what=3D=3DSsFailure ? -i : i);
+ canonical->sres =3D VG_(mk_SysRes_amd64_linux)( gst->guest_RAX );
+ canonical->what =3D SsComplete;
=20
-#elif defined(VGP_ppc32_linux)
+# elif defined(VGP_ppc32_linux)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ UInt cr =3D LibVEX_GuestPPC32_get_CR( gst );
+ UInt cr0so =3D (cr >> 28) & 1;
+ canonical->sres =3D VG_(mk_SysRes_ppc32_linux)( gst->guest_GPR3, cr0s=
o );
+ canonical->what =3D SsComplete;
+
+# elif defined(VGP_ppc64_linux)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ UInt cr =3D LibVEX_GuestPPC64_get_CR( gst );
+ UInt cr0so =3D (cr >> 28) & 1;
+ canonical->sres =3D VG_(mk_SysRes_ppc64_linux)( gst->guest_GPR3, cr0s=
o );
+ canonical->what =3D SsComplete;
+
+# elif defined(VGP_ppc32_aix5)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
- UInt cr =3D LibVEX_GuestPPC32_get_CR( gst );
- UInt err =3D (cr >> 28) & 1; // CR0.SO
- canonical->what =3D (err =3D=3D 1) ? SsFailure : SsSuccess;
- canonical->val =3D (UWord)gst->guest_GPR3;
+ canonical->sres =3D VG_(mk_SysRes_ppc32_aix5)( gst->guest_GPR3,=20
+ gst->guest_GPR4 );
+ canonical->what =3D SsComplete;
=20
-#elif defined(VGP_ppc64_linux)
+# elif defined(VGP_ppc64_aix5)
VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
- UInt cr =3D LibVEX_GuestPPC64_get_CR( gst );
- UInt err =3D (cr >> 28) & 1; // CR0.SO
- canonical->what =3D (err =3D=3D 1) ? SsFailure : SsSuccess;
- canonical->val =3D (UWord)gst->guest_GPR3;
+ canonical->sres =3D VG_(mk_SysRes_ppc64_aix5)( gst->guest_GPR3,=20
+ gst->guest_GPR4 );
+ canonical->what =3D SsComplete;
=20
-#else
-# error "getSyscallStatusFromGuestState: unknown arch"
-#endif
+# else
+# error "getSyscallStatusFromGuestState: unknown arch"
+# endif
}
=20
static=20
void putSyscallStatusIntoGuestState ( /*IN*/ SyscallStatus* canonica=
l,
/*OUT*/VexGuestArchState* gst_vani=
lla )
{
-#if defined(VGP_x86_linux)
+# if defined(VGP_x86_linux)
VexGuestX86State* gst =3D (VexGuestX86State*)gst_vanilla;
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
- if (canonical->what =3D=3D SsFailure) {
+ vg_assert(canonical->what =3D=3D SsComplete);
+ if (canonical->sres.isError) {
/* This isn't exactly right, in that really a Failure with res
not in the range 1 .. 4095 is unrepresentable in the
Linux-x86 scheme. Oh well. */
- gst->guest_EAX =3D - (Int)canonical->val;
+ gst->guest_EAX =3D - (Int)canonical->sres.err;
} else {
- gst->guest_EAX =3D canonical->val;
+ gst->guest_EAX =3D canonical->sres.res;
}
-#elif defined(VGP_amd64_linux)
+
+# elif defined(VGP_amd64_linux)
VexGuestAMD64State* gst =3D (VexGuestAMD64State*)gst_vanilla;
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
- if (canonical->what =3D=3D SsFailure) {
+ vg_assert(canonical->what =3D=3D SsComplete);
+ if (canonical->sres.isError) {
/* This isn't exactly right, in that really a Failure with res
not in the range 1 .. 4095 is unrepresentable in the
Linux-x86 scheme. Oh well. */
- gst->guest_RAX =3D - (Long)canonical->val;
+ gst->guest_RAX =3D - (Long)canonical->sres.err;
} else {
- gst->guest_RAX =3D canonical->val;
+ gst->guest_RAX =3D canonical->sres.res;
}
=20
-#elif defined(VGP_ppc32_linux)
+# elif defined(VGP_ppc32_linux)
VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
UInt old_cr =3D LibVEX_GuestPPC32_get_CR(gst);
-
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
-
- gst->guest_GPR3 =3D canonical->val;
-
- if (canonical->what =3D=3D SsFailure) {
+ vg_assert(canonical->what =3D=3D SsComplete);
+ if (canonical->sres.isError) {
/* set CR0.SO */
LibVEX_GuestPPC32_put_CR( old_cr | (1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.err;
} else {
/* clear CR0.SO */
LibVEX_GuestPPC32_put_CR( old_cr & ~(1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.res;
}
=20
-#elif defined(VGP_ppc64_linux)
+# elif defined(VGP_ppc64_linux)
VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
UInt old_cr =3D LibVEX_GuestPPC64_get_CR(gst);
-
- vg_assert(canonical->what =3D=3D SsSuccess=20
- || canonical->what =3D=3D SsFailure);
-
- gst->guest_GPR3 =3D canonical->val;
-
- if (canonical->what =3D=3D SsFailure) {
+ vg_assert(canonical->what =3D=3D SsComplete);
+ if (canonical->sres.isError) {
/* set CR0.SO */
LibVEX_GuestPPC64_put_CR( old_cr | (1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.err;
} else {
/* clear CR0.SO */
LibVEX_GuestPPC64_put_CR( old_cr & ~(1<<28), gst );
+ gst->guest_GPR3 =3D canonical->sres.res;
}
=20
-#else
-# error "putSyscallStatusIntoGuestState: unknown arch"
-#endif
+# elif defined(VGP_ppc32_aix5)
+ VexGuestPPC32State* gst =3D (VexGuestPPC32State*)gst_vanilla;
+ vg_assert(canonical->what =3D=3D SsComplete);
+ gst->guest_GPR3 =3D canonical->sres.res;
+ gst->guest_GPR4 =3D canonical->sres.err;
+
+# elif defined(VGP_ppc64_aix5)
+ VexGuestPPC64State* gst =3D (VexGuestPPC64State*)gst_vanilla;
+ vg_assert(canonical->what =3D=3D SsComplete);
+ gst->guest_GPR3 =3D canonical->sres.res;
+ gst->guest_GPR4 =3D canonical->sres.err;
+
+# else
+# error "putSyscallStatusIntoGuestState: unknown arch"
+# endif
}
=20
=20
@@ -521,6 +596,8 @@
layout->o_arg4 =3D OFFSET_x86_ESI;
layout->o_arg5 =3D OFFSET_x86_EDI;
layout->o_arg6 =3D OFFSET_x86_EBP;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_x86_EAX;
=20
#elif defined(VGP_amd64_linux)
@@ -531,6 +608,8 @@
layout->o_arg4 =3D OFFSET_amd64_R10;
layout->o_arg5 =3D OFFSET_amd64_R8;
layout->o_arg6 =3D OFFSET_amd64_R9;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_amd64_RAX;
=20
#elif defined(VGP_ppc32_linux)
@@ -541,6 +620,8 @@
layout->o_arg4 =3D OFFSET_ppc32_GPR6;
layout->o_arg5 =3D OFFSET_ppc32_GPR7;
layout->o_arg6 =3D OFFSET_ppc32_GPR8;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_ppc32_GPR3;
=20
#elif defined(VGP_ppc64_linux)
@@ -551,8 +632,34 @@
layout->o_arg4 =3D OFFSET_ppc64_GPR6;
layout->o_arg5 =3D OFFSET_ppc64_GPR7;
layout->o_arg6 =3D OFFSET_ppc64_GPR8;
+ layout->o_arg7 =3D -1; /* impossible value */
+ layout->o_arg8 =3D -1; /* impossible value */
layout->o_retval =3D OFFSET_ppc64_GPR3;
=20
+#elif defined(VGP_ppc32_aix5)
+ layout->o_sysno =3D OFFSET_ppc32_GPR2;
+ layout->o_arg1 =3D OFFSET_ppc32_GPR3;
+ layout->o_arg2 =3D OFFSET_ppc32_GPR4;
+ layout->o_arg3 =3D OFFSET_ppc32_GPR5;
+ layout->o_arg4 =3D OFFSET_ppc32_GPR6;
+ layout->o_arg5 =3D OFFSET_ppc32_GPR7;
+ layout->o_arg6 =3D OFFSET_ppc32_GPR8;
+ layout->o_arg7 =3D OFFSET_ppc32_GPR9;
+ layout->o_arg8 =3D OFFSET_ppc32_GPR10;
+ layout->o_retval =3D OFFSET_ppc32_GPR3;
+
+#elif defined(VGP_ppc64_aix5)
+ layout->o_sysno =3D OFFSET_ppc64_GPR2;
+ layout->o_arg1 =3D OFFSET_ppc64_GPR3;
+ layout->o_arg2 =3D OFFSET_ppc64_GPR4;
+ layout->o_arg3 =3D OFFSET_ppc64_GPR5;
+ layout->o_arg4 =3D OFFSET_ppc64_GPR6;
+ layout->o_arg5 =3D OFFSET_ppc64_GPR7;
+ layout->o_arg6 =3D OFFSET_ppc64_GPR8;
+ layout->o_arg7 =3D OFFSET_ppc64_GPR9;
+ layout->o_arg8 =3D OFFSET_ppc64_GPR10;
+ layout->o_retval =3D OFFSET_ppc64_GPR3;
+
#else
# error "getSyscallLayout: unknown arch"
#endif
@@ -591,13 +698,24 @@
=20
static const SyscallTableEntry* get_syscall_entry ( UInt syscallno )
{
- const SyscallTableEntry* sys =3D &bad_sys;
+ const SyscallTableEntry* sys =3D NULL;
=20
+# if defined(VGO_linux)
if (syscallno < ML_(syscall_table_size) &&
ML_(syscall_table)[syscallno].before !=3D NULL)
sys =3D &ML_(syscall_table)[syscallno];
=20
- return sys;
+# elif defined(VGP_ppc32_aix5)
+ sys =3D ML_(get_ppc32_aix5_syscall_entry) ( syscallno );
+
+# elif defined(VGP_ppc64_aix5)
+ sys =3D ML_(get_ppc64_aix5_syscall_entry) ( syscallno );
+
+# else
+# error Unknown OS
+# endif
+
+ return sys =3D=3D NULL ? &bad_sys : sys;
}
=20
=20
@@ -679,9 +797,11 @@
sysno =3D sci->orig_args.sysno;
=20
/* The default what-to-do-next thing is hand the syscall to the
- kernel, so we pre-set that here. */
+ kernel, so we pre-set that here. Set .sres to something
+ harmless looking (is irrelevant because .what is not
+ SsComplete.) */
sci->status.what =3D SsHandToKernel;
- sci->status.val =3D 0;
+ sci->status.sres =3D VG_(mk_SysRes_Error)(0);
sci->flags =3D 0;
=20
/* Fetch the syscall's handlers. If no handlers exist for this
@@ -732,14 +852,13 @@
*/
/* Now we proceed according to what the pre-handler decided. */
vg_assert(sci->status.what =3D=3D SsHandToKernel
- || sci->status.what =3D=3D SsSuccess
- || sci->status.what =3D=3D SsFailure);
+ || sci->status.what =3D=3D SsComplete);
vg_assert(sci->args.sysno =3D=3D sci->orig_args.sysno);
=20
- if (sci->status.what =3D=3D SsSuccess) {
+ if (sci->status.what =3D=3D SsComplete && !sci->status.sres.isError) =
{
/* The pre-handler completed the syscall itself, declaring
success. */
- PRINT(" --> [pre-success] Success(0x%llx)\n", (Long)sci->status.va=
l );
+ PRINT(" --> [pre-success] Success(0x%llx)\n", (ULong)sci->status.s=
res.res );
=20
/* In this case the allowable flags are to ask for a signal-poll
and/or a yield after the call. Changing the args isn't
@@ -749,9 +868,9 @@
}
=20
else
- if (sci->status.what =3D=3D SsFailure) {
+ if (sci->status.what =3D=3D SsComplete && sci->status.sres.isError) {
/* The pre-handler decided to fail syscall itself. */
- PRINT(" --> [pre-fail] Failure(0x%llx)\n", (Long)sci->status.val )=
;
+ PRINT(" --> [pre-fail] Failure(0x%llx)\n", (ULong)sci->status.sres=
.err );
/* In this case, the pre-handler is also allowed to ask for the
post-handler to be run anyway. Changing the args is not
allowed. */
@@ -796,7 +915,7 @@
putSyscallArgsIntoGuestState( &sci->args, &tst->arch.vex );
=20
/* Drop the lock */
- VG_(set_sleeping)(tid, VgTs_WaitSys);
+ VG_(set_sleeping)(tid, VgTs_WaitSys, "VG_(client_syscall)[async=
]");
=20
/* Do the call, which operates directly on the guest state,
not on our abstracted copies of the args/result. */
@@ -811,16 +930,18 @@
to the scheduler. */
=20
/* Reacquire the lock */
- VG_(set_running)(tid);
+ VG_(set_running)(tid, "VG_(client_syscall)[async]");
=20
/* Even more impedance matching. Extract the syscall status
from the guest state. */
getSyscallStatusFromGuestState( &sci->status, &tst->arch.vex );
+ vg_assert(sci->status.what =3D=3D SsComplete);
=20
PRINT("SYSCALL[%d,%d](%3d) ... [async] --> %s(0x%llx)\n",
VG_(getpid)(), tid, sysno,=20
- sci->status.what=3D=3DSsSuccess ? "Success" : "Failure",
- (Long)sci->status.val );
+ sci->status.sres.isError ? "Failure" : "Success",
+ sci->status.sres.isError ? (ULong)sci->status.sres.err
+ : (ULong)sci->status.sres.res );
=20
} else {
=20
@@ -830,21 +951,21 @@
kernel, there's no point in flushing them back to the
guest state. Indeed doing so could be construed as
incorrect. */
-
SysRes sres=20
- =3D VG_(do_syscall6)(sysno, sci->args.arg1, sci->args.arg2,=20
- sci->args.arg3, sci->args.arg4,=20
- sci->args.arg5, sci->args.arg6 );
+ =3D VG_(do_syscall)(sysno, sci->args.arg1, sci->args.arg2,=20
+ sci->args.arg3, sci->args.arg4,=20
+ sci->args.arg5, sci->args.arg6,
+ sci->args.arg7, sci->args.arg8 );
sci->status =3D convert_SysRes_to_SyscallStatus(sres);
=20
PRINT("[sync] --> %s(0x%llx)\n",
- sci->status.what=3D=3DSsSuccess ? "Success" : "Failure",
- (Long)sci->status.val );
+ sci->status.sres.isError ? "Failure" : "Success",
+ sci->status.sres.isError ? (ULong)sci->status.sres.err
+ : (ULong)sci->status.sres.res );
}
}
=20
- vg_assert(sci->status.what =3D=3D SsFailure=20
- || sci->status.what =3D=3D SsSuccess);
+ vg_assert(sci->status.what =3D=3D SsComplete);
=20
vg_assert(VG_(is_running_thread)(tid));
=20
@@ -902,8 +1023,7 @@
/* Validate current syscallInfo entry. In particular we require
that the current .status matches what's actually in the guest
state. */
- vg_assert(sci->status.what =3D=3D SsFailure=20
- || sci->status.what =3D=3D SsSuccess);
+ vg_assert(sci->status.what =3D=3D SsComplete);
=20
getSyscallStatusFromGuestState( &test_status, &tst->arch.vex );
vg_assert(eq_SyscallStatus( &sci->status, &test_status ));
@@ -924,13 +1044,14 @@
VG_TRACK( post_reg_write, Vg_CoreSysCall, tid, layout.o_retval,=20
sizeof(UWord) );
=20
- /* Consider, either success or failure. Now run the post handler if:
+ /* pre: status =3D=3D Complete (asserted above) */
+ /* Consider either success or failure. Now run the post handler if:
- it exists, and
- - status=3D=3DSuccess or (status=3D=3DFail and PostOnFail is set)
+ - Success or (Failure and PostOnFail is set)
*/
if (ent->after
- && (sci->status.what =3D=3D SsSuccess
- || (sci->status.what =3D=3D SsFailure
+ && ((!sci->status.sres.isError)
+ || (sci->status.sres.isError
&& (sci->flags & SfPostOnFail) ))) {
=20
(ent->after)( tid, &sci->args, &sci->status );
@@ -943,14 +1064,11 @@
putSyscallStatusIntoGuestState( &sci->status, &tst->arch.vex );
=20
/* Do any post-syscall actions required by the tool. */
- if (VG_(needs).syscall_wrapper) {
- SysRes res;
- res.val =3D sci->status.val;
- res.isError =3D sci->status.what =3D=3D SsFailure;
- VG_TDICT_CALL(tool_post_syscall, tid, sysno, res);
- }
+ if (VG_(needs).syscall_wrapper)
+ VG_TDICT_CALL(tool_post_syscall, tid, sysno, sci->status.sres);
=20
/* The syscall is done. */
+ vg_assert(sci->status.what =3D=3D SsComplete);
sci->status.what =3D SsIdle;
=20
/* The pre/post wrappers may have concluded that pending signals
@@ -1063,6 +1181,32 @@
vg_assert(p[0] =3D=3D 0x44 && p[1] =3D=3D 0x0 && p[2] =3D=3D 0x0 &=
& p[3] =3D=3D 0x2);
}
=20
+#elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+ /* Hmm. This is problematic, because on AIX the kernel resumes
+ after a syscall at LR, not at the insn following SC. Hence
+ there is no obvious way to figure out where the SC is. Current
+ solution is to have a pseudo-register in the guest state,
+ CIA_AT_SC, which holds the address of the most recent SC
+ executed. Backing up to that syscall then simply involves
+ copying that value back into CIA (the program counter). */
+ arch->vex.guest_CIA =3D arch->vex.guest_CIA_AT_SC;
+
+ /* Make sure our caller is actually sane, and we're really backing
+ back over a syscall.
+
+ sc =3D=3D 44 00 00 02
+ */
+ {
+ UChar *p =3D (UChar *)arch->vex.guest_CIA;
+
+ if (p[0] !=3D 0x44 || p[1] !=3D 0x0 || p[2] !=3D 0x0 || p[3] !=3D =
0x02)
+ VG_(message)(Vg_DebugMsg,
+ "?! restarting over syscall at %p %02x %02x %02x %=
02x\n",
+ arch->vex.guest_CIA, p[0], p[1], p[2], p[3]);
+
+ vg_assert(p[0] =3D=3D 0x44 && p[1] =3D=3D 0x0 && p[2] =3D=3D 0x0 &=
& p[3] =3D=3D 0x2);
+ }
+
#else
# error "ML_(fixup_guest_state_to_restart_syscall): unknown plat"
#endif
@@ -1102,7 +1246,7 @@
VG_(fixup_guest_state_after_syscall_interrupted)( ThreadId tid,=20
Addr ip,=20
UWord sysnum,=20
- SysRes sysret,
+ SysRes sres,
Bool restart)
{
/* Note that the sysnum arg seems to contain not-dependable-on info
@@ -1124,8 +1268,8 @@
(Int)tid,
(ULong)ip,=20
restart ? "True" : "False",=20
- sysret.isError ? "True" : "False",
- (Long)(Word)sysret.val );
+ sres.isError ? "True" : "False",
+ (Long)(Word)(sres.isError ? sres.err : sres.res) );
=20
vg_assert(VG_(is_valid_tid)(tid));
vg_assert(tid >=3D 1 && tid < VG_N_THREADS);
@@ -1182,8 +1326,8 @@
Write the SysRes we were supplied with back to the guest
state. */
if (debug)
- VG_(printf)(" completed\n", sysret);
- canonical =3D convert_SysRes_to_SyscallStatus( sysret );
+ VG_(printf)(" completed\n");
+ canonical =3D convert_SysRes_to_SyscallStatus( sres );
putSyscallStatusIntoGuestState( &canonical, &th_regs->vex );
sci->status =3D canonical;
VG_(post_syscall)(tid);
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-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
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2006-10-17 01:46:55 U=
TC (rev 6275)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2006-10-17 01:47:30 U=
TC (rev 6276)
@@ -239,7 +239,7 @@
ThreadState* ctst =3D VG_(get_ThreadState)(ctid);
ULong word64;
UWord* stack;
- NSegment* seg;
+ NSegment const* seg;
SysRes res;
vki_sigset_t blockall, savedmask;
=20
@@ -1060,7 +1060,7 @@
It's a conceptual copy-n-paste from the x86 equivalent, but I'm=20
equally unclear as to whether it is needed there either.
*/
- SET_STATUS_from_SysRes_NO_SANITY_CHECK(
+ SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc32_linux)(=20
tst->arch.vex.guest_GPR3,
/* get CR0.SO */
@@ -1095,7 +1095,7 @@
VG_(sigframe_destroy)(tid, True);
=20
/* See comments above in PRE(sys_sigreturn) about this. */
- SET_STATUS_from_SysRes_NO_SANITY_CHECK(
+ SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc32_linux)(=20
tst->arch.vex.guest_GPR3,
/* get CR0.SO */
Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-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
--- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2006-10-17 01:46:55 U=
TC (rev 6275)
+++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2006-10-17 01:47:30 U=
TC (rev 6276)
@@ -267,7 +267,7 @@
ThreadState* ctst =3D VG_(get_ThreadState)(ctid);
ULong word64;
UWord* stack;
- NSegment* seg;
+ NSegment const* seg;
SysRes res;
vki_sigset_t blockall, savedmask;
=20
@@ -1073,7 +1073,7 @@
VG_(sigframe_destroy)(tid, True);
=20
/* See comments above in PRE(sys_sigreturn) about this. */
- SET_STATUS_from_SysRes_NO_SANITY_CHECK(
+ SET_STATUS_from_SysRes(
VG_(mk_SysRes_ppc64_linux)(=20
tst->arch.vex.guest_GPR3,
/* get CR0.SO */
Modified: trunk/coregrind/m_syswrap/syswrap-x86-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
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2006-10-17 01:46:55 UTC=
(rev 6275)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2006-10-17 01:47:30 UTC=
(rev 6276)
@@ -213,7 +213,7 @@
ThreadState* ptst =3D VG_(get_ThreadState)(ptid);
ThreadState* ctst =3D VG_(get_ThreadState)(ctid);
UWord* stack;
- NSegment* seg;
+ NSegment const* seg;
SysRes res;
Int eax;
vki_sigset_t blockall, savedmask;
|
|
From: <sv...@va...> - 2006-10-17 01:46:57
|
Author: sewardj
Date: 2006-10-17 02:46:55 +0100 (Tue, 17 Oct 2006)
New Revision: 6275
Log:
Merge r6139:
- Minor changes for mpxlc
- kludge; add option "initkludge" to cause PMPI_Init to return
&mpiwrap_walk_type_EXTERNALLY_VISIBLE
and adjust mpiwrap_type_test.c accordingly
and also add an export script so that libmpiwrap.so is built
correctly on AIX5 (r????).
Added:
trunk/auxprogs/libmpiwrap_aix5.exp
Modified:
trunk/auxprogs/libmpiwrap.c
trunk/auxprogs/mpiwrap_type_test.c
Modified: trunk/auxprogs/libmpiwrap.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
--- trunk/auxprogs/libmpiwrap.c 2006-10-17 01:44:36 UTC (rev 6274)
+++ trunk/auxprogs/libmpiwrap.c 2006-10-17 01:46:55 UTC (rev 6275)
@@ -84,11 +84,20 @@
=20
/* Where are API symbols?
Open MPI lib/libmpi.so, soname =3D libmpi.so.0
+ AIX: in /usr/lpp/ppe.poe/lib/libmpi_r.a(mpicore*_r.o)
ditto Quadrics MPI
*/
/* ifdef OpenMPI ... */
-#define I_WRAP_FNNAME_U(_name) I_WRAP_SONAME_FNNAME_ZU(libmpiZdsoZa,_nam=
e)
+#if defined(_AIX)
+# define I_WRAP_FNNAME_U(_name) \
+ I_WRAP_SONAME_FNNAME_ZU(libmpiZurZdaZLmpicoreZaZurZdoZR,_name)
+ /* Don't change this without also changing all the names in
+ libmpiwrap.exp. */
+#else
+# define I_WRAP_FNNAME_U(_name) \
+ I_WRAP_SONAME_FNNAME_ZU(libmpiZdsoZa,_name)
=20
+#endif
=20
/*------------------------------------------------------------*/
/*--- Decls ---*/
@@ -119,11 +128,12 @@
static const char* preamble =3D "valgrind MPI wrappers";
=20
/* established at startup */
-static pid_t my_pid =3D -1;
-static char* options_str =3D NULL;
-static int opt_verbosity =3D 1;
-static Bool opt_missing =3D 0; /* 0:silent; 1:warn; 2:abort */
-static Bool opt_help =3D False;
+static pid_t my_pid =3D -1;
+static char* options_str =3D NULL;
+static int opt_verbosity =3D 1;
+static Bool opt_missing =3D 0; /* 0:silent; 1:warn; 2:abort */
+static Bool opt_help =3D False;
+static Bool opt_initkludge =3D False;
=20
static void before ( char* fnname )
{
@@ -145,6 +155,8 @@
opt_verbosity--;
if (NULL !=3D strstr(options_str, "help"))
opt_help =3D True;
+ if (NULL !=3D strstr(options_str, "initkludge"))
+ opt_initkludge =3D True;
}
if (opt_verbosity > 0)
fprintf(stderr, "%s %5d: Active for pid %d\n",=20
@@ -160,13 +172,14 @@
fprintf(stderr, "Valid options for the MPIWRAP_DEBUG environmen=
t"
" variable are:\n");
fprintf(stderr, "\n");
- fprintf(stderr, " quiet be silent except for errors\n");
- fprintf(stderr, " verbose show wrapper entries/exits\n");
- fprintf(stderr, " strict abort the program if a function"
+ fprintf(stderr, " quiet be silent except for errors\n")=
;
+ fprintf(stderr, " verbose show wrapper entries/exits\n");
+ fprintf(stderr, " strict abort the program if a function=
"
" with no wrapper is used\n");
- fprintf(stderr, " warn give a warning if a function"
+ fprintf(stderr, " warn give a warning if a function"
" with no wrapper is used\n");
- fprintf(stderr, " help display this message, then exit\=
n");
+ fprintf(stderr, " help display this message, then exit=
\n");
+ fprintf(stderr, " initkludge debugging hack; do not use\n");
fprintf(stderr, "\n");
fprintf(stderr, "Multiple options are allowed, eg"
" MPIWRAP_DEBUG=3Dstrict,verbose\n");
@@ -186,7 +199,7 @@
fprintf(stderr, "%s %5d: enter PMPI_%s\n", preamble, my_pid, fnna=
me );
}
=20
-static inline void after ( char* fnname, int err )
+static __inline__ void after ( char* fnname, int err )
{
if (opt_verbosity > 1)
fprintf(stderr, "%s %5d: exit PMPI_%s (err =3D %d)\n",=20
@@ -291,21 +304,21 @@
/* Note, PMPI_Comm_rank/size are themselves wrapped. Should work
fine. */
=20
-static inline int comm_rank ( MPI_Comm comm )=20
+static __inline__ int comm_rank ( MPI_Comm comm )=20
{
int err, r;
err =3D PMPI_Comm_rank(comm, &r);
return err ? 0/*arbitrary*/ : r;
}
=20
-static inline int comm_size ( MPI_Comm comm )=20
+static __inline__ int comm_size ( MPI_Comm comm )=20
{
int err, r;
err =3D PMPI_Comm_size(comm, &r);
return err ? 0/*arbitrary*/ : r;
}
=20
-static inline Bool count_from_Status( /*OUT*/int* recv_count,=20
+static __inline__ Bool count_from_Status( /*OUT*/int* recv_count,=20
MPI_Datatype datatype,=20
MPI_Status* status)
{
@@ -326,7 +339,7 @@
types that support assignment and equality operations." Hence the
following function should compile for any compliant definition of
MPI_Request. */
-static inline=20
+static __inline__=20
Bool eq_MPI_Request ( MPI_Request r1, MPI_Request r2 )
{
return r1 =3D=3D r2;
@@ -674,7 +687,7 @@
void mpiwrap_walk_type_EXTERNALLY_VISIBLE
( void(*f)(void*,long), char* base, MPI_Datatype ty )
{
- return walk_type(f, base, ty);
+ walk_type(f, base, ty);
}
=20
=20
@@ -688,7 +701,7 @@
----------------
*/
=20
-static inline
+static __inline__
void check_mem_is_defined_untyped ( void* buffer, long nbytes )
{
if (nbytes > 0) {
@@ -696,7 +709,7 @@
}
}
=20
-static inline
+static __inline__
void check_mem_is_addressable_untyped ( void* buffer, long nbytes )
{
if (nbytes > 0) {
@@ -704,7 +717,7 @@
}
}
=20
-static inline
+static __inline__
void make_mem_defined_if_addressable_untyped ( void* buffer, long nbytes=
)
{
if (nbytes > 0) {
@@ -712,7 +725,7 @@
}
}
=20
-static inline
+static __inline__
void make_mem_defined_if_addressable_if_success_untyped ( int err,=20
void* buffer, long nbytes )
{
@@ -724,7 +737,7 @@
/* Set the specified area to 'addressible but undefined'
(safe-to-write) state. */
=20
-static inline
+static __inline__
void make_mem_undefined_untyped ( void* buffer, long nbytes )
{
if (nbytes > 0) {
@@ -874,7 +887,11 @@
int err;
VALGRIND_GET_ORIG_FN(fn);
before("Get_count");
+# if defined(_AIX)
+ check_mem_is_addressable_untyped(status, sizeof(*status));
+# else
check_mem_is_defined_untyped(status, sizeof(*status));
+# endif
CALL_FN_W_WWW(err, fn, status,ty,count);
after("Get_count", err);
return err;
@@ -1061,7 +1078,7 @@
if (count < 0)=20
count =3D 0; /* Hmm. Call Mulder and Scully. */
copy =3D malloc( count * sizeof(MPI_Request) );
- if (copy =3D=3D NULL) {
+ if (copy =3D=3D NULL && count > 0) {
UNLOCK_SREQS;
barf("clone_Request_array: malloc failed");
}
@@ -1776,7 +1793,7 @@
=20
/* --- Init --- */
/* rd: *argc, *argv[0 .. *argc-1] */
-int WRAPPER_FOR(PMPI_Init)(int *argc, char ***argv)
+long WRAPPER_FOR(PMPI_Init)(int *argc, char ***argv)
{
OrigFn fn;
int err;
@@ -1786,7 +1803,10 @@
check_mem_is_defined_untyped(*argv, *argc * sizeof(char**));
CALL_FN_W_WW(err, fn, argc,argv);
after("Init", err);
- return err;
+ if (opt_initkludge)
+ return (long)(void*)&mpiwrap_walk_type_EXTERNALLY_VISIBLE;
+ else
+ return (long)err;
}
=20
/* --- Initialized --- */
Added: trunk/auxprogs/libmpiwrap_aix5.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/auxprogs/libmpiwrap_aix5.exp (rev 0)
+++ trunk/auxprogs/libmpiwrap_aix5.exp 2006-10-17 01:46:55 UTC (rev 6275)
@@ -0,0 +1,298 @@
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Abort
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Accumulate
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Add_error_class
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Add_error_code
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Add_error_string
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Allgather
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Allgatherv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Alloc_mem
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Allreduce
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Alltoall
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Alltoallv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Alltoallw
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Attr_delete
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Attr_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Attr_put
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Barrier
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Bcast
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Bsend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Bsend_init
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Buffer_attach
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Buffer_detach
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cancel
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_coords
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_map
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_rank
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_shift
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cart_sub
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Cartdim_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Close_port
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_accept
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_call_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_compare
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_connect
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_create_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_create_keyval
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_delete_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_disconnect
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_dup
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_free_keyval
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_get_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_get_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_get_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_get_parent
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_group
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_join
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_rank
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_remote_group
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_remote_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_set_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_set_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_set_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_spawn
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_spawn_multiple
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_split
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Comm_test_inter
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Dims_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Errhandler_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Errhandler_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Errhandler_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Errhandler_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Errhandler_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Errhandler_set
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Error_class
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Error_string
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Exscan
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_call_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_close
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_create_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_delete
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_amode
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_atomicity
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_byte_offset
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_group
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_info
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_position
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_position_shared
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_type_extent
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_get_view
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_iread
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_iread_at
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_iread_shared
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_iwrite
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_iwrite_at
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_iwrite_shared
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_open
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_preallocate
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_all
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_all_begin
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_all_end
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_at
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_at_all
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_at_all_begin
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_at_all_end
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_ordered
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_ordered_begin
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_ordered_end
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_read_shared
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_seek
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_seek_shared
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_set_atomicity
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_set_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_set_info
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_set_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_set_view
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_sync
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_all
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_all_begin
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_all_end
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_at
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_at_all
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_at_all_begin
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_at_all_end
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_ordered
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_ordered_begin
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_ordered_end
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_File_write_shared
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Finalize
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Finalized
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Free_mem
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Gather
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Gatherv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Get_address
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Get_count
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Get_elements
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Get_processor_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Get_version
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Graph_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Graph_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Graph_map
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Graph_neighbors
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Graph_neighbors_count
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Graphdims_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Grequest_complete
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Grequest_start
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_compare
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_difference
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_excl
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_incl
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_intersection
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_range_excl
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_range_incl
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_rank
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_translate_ranks
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Group_union
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Ibsend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_delete
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_dup
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_get
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_get_nkeys
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_get_nthkey
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_get_valuelen
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Info_set
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Init
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Init_thread
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Initialized
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Intercomm_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Intercomm_merge
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Iprobe
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Irecv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Irsend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Is_thread_main
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Isend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Issend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Keyval_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Keyval_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Lookup_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Op_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Op_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Op_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Op_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Open_port
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Pack
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Pack_external
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Pack_external_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Pack_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Probe
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Publish_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Put
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Query_thread
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Recv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Recv_init
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Reduce
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Reduce_scatter
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Register_datarep
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Request_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Request_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Request_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Request_get_status
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Rsend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Rsend_init
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Scan
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Scatter
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Scatterv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Send
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Send_init
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Sendrecv
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Sendrecv_replace
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Ssend
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Ssend_init
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Start
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Startall
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Status_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Status_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Status_set_cancelled
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Status_set_elements
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Test
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Test_cancelled
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Testall
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Testany
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Testsome
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Topo_test
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_commit
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_contiguous
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_darray
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_f90_complex
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_f90_integer
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_f90_real
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_hindexed
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_hvector
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_indexed_block
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_keyval
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_resized
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_struct
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_create_subarray
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_delete_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_dup
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_free_keyval
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_get_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_get_extent
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_get_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_get_true_extent
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_hindexed
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_hvector
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_indexed
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_lb
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_match_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_set_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_set_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_size
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_struct
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_ub
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Type_vector
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Unpack
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Unpack_external
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Unpublish_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Wait
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Waitall
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Waitany
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Waitsome
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_c2f
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_call_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_complete
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_create
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_create_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_create_keyval
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_delete_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_f2c
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_fence
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_free
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_free_keyval
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_get_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_get_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_get_group
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_get_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_lock
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_post
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_set_attr
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_set_errhandler
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_set_name
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_start
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_test
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_unlock
+_vgwZU_libmpiZurZdaZLmpicoreZaZurZdoZR_PMPI_Win_wait
Modified: trunk/auxprogs/mpiwrap_type_test.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
--- trunk/auxprogs/mpiwrap_type_test.c 2006-10-17 01:44:36 UTC (rev 6274)
+++ trunk/auxprogs/mpiwrap_type_test.c 2006-10-17 01:46:55 UTC (rev 6275)
@@ -9,7 +9,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-#include <dlfcn.h>
#include "mpi.h"
#include "../memcheck/memcheck.h"
=20
@@ -19,6 +18,8 @@
#define False ((Bool)0)
#define True ((Bool)1)
=20
+void* walk_type_fn =3D NULL;
+
static Ty tycon_Contiguous ( int count, Ty t )
{
Ty t2; =20
@@ -96,7 +97,7 @@
return tres;
}
=20
-//////////////////////////////////////
+/* ------------------------------ */
=20
char characterise ( unsigned char b )
{
@@ -125,23 +126,14 @@
char* rbuf_walk;
int r;
=20
- void* dl_handle =3D NULL;
-
/* C: what a fabulous functional programming language :-) */
- void(*dl_walk_type)(void(*)(void*,long),char*,MPI_Datatype) =3D NULL;
-
- /* NULL: gives a handle which is RTLD_GLOBAL syms in current
- process image */
- dl_handle =3D dlopen(NULL, RTLD_LAZY);
- if (!dl_handle) {
- printf("sendToMyself: can't dlopen current process image\n");
- return;
- }
- dl_walk_type =3D dlsym(dl_handle, "mpiwrap_walk_type_EXTERNALLY_VISIB=
LE");
+ void(*dl_walk_type)(void(*)(void*,long),char*,MPI_Datatype)=20
+ =3D (void(*)(void(*)(void*,long),char*,MPI_Datatype))
+ walk_type_fn;
+ =20
if (!dl_walk_type) {
printf("sendToMyself: can't find mpiwrap_walk_type_EXTERNALLY_VISI=
BLE"
" in current process image\n");
- dlclose(dl_handle);
return;
}
=20
@@ -192,7 +184,6 @@
=20
dl_walk_type( sendToMyself_callback, rbuf_walk, *tyP );
=20
- dlclose(dl_handle);
if (commit_free) {
r =3D MPI_Type_free( tyP );
assert(r =3D=3D MPI_SUCCESS);
@@ -225,13 +216,22 @@
int main ( int argc, char** argv )
{
int rank, size;
+ char* opts;
=20
if (!RUNNING_ON_VALGRIND) {
printf("error: this program must be run on valgrind\n");
return 1;
}
+ opts =3D getenv("MPIWRAP_DEBUG");
+ if ((!opts) || NULL=3D=3Dstrstr(opts, "initkludge")) {
+ printf("error: program requires MPIWRAP_DEBUG=3Dinitkludge\n");
+ return 1;
+ }
=20
- MPI_Init( &argc, &argv );
+ walk_type_fn =3D (void*)(long) MPI_Init( &argc, &argv );
+ printf("mpiwrap_type_test: walk_type_fn =3D %p\n", walk_type_fn);
+ assert(walk_type_fn);
+
MPI_Comm_size( MPI_COMM_WORLD, &size );
MPI_Comm_rank( MPI_COMM_WORLD, &rank );
=20
|
|
From: <sv...@va...> - 2006-10-17 01:44:39
|
Author: sewardj
Date: 2006-10-17 02:44:36 +0100 (Tue, 17 Oct 2006)
New Revision: 6274
Log:
Merge r6138:
Convert some VG_ names (global visibility) into ML_s (module scope).
and also handle Z-encoded 'ZL' =3D=3D ( and 'ZR' =3D=3D )
for intercept/wrapper fn names
Modified:
trunk/coregrind/m_demangle/cp-demangle.c
trunk/coregrind/m_demangle/cplus-dem.c
trunk/coregrind/m_demangle/demangle.c
trunk/coregrind/m_demangle/demangle.h
Modified: trunk/coregrind/m_demangle/cp-demangle.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
--- trunk/coregrind/m_demangle/cp-demangle.c 2006-10-17 01:42:40 UTC (rev=
6273)
+++ trunk/coregrind/m_demangle/cp-demangle.c 2006-10-17 01:44:36 UTC (rev=
6274)
@@ -3749,7 +3749,7 @@
If the demangling failes, returns NULL. */
=20
char *
-VG_(cplus_demangle_v3) (mangled)
+ML_(cplus_demangle_v3) (mangled)
const char* mangled;
{
dyn_string_t demangled;
@@ -3797,7 +3797,7 @@
of JArray<TYPE> with TYPE[]. */
=20
char *
-VG_(java_demangle_v3) (mangled)
+ML_(java_demangle_v3) (mangled)
const char* mangled;
{
dyn_string_t demangled;
Modified: trunk/coregrind/m_demangle/cplus-dem.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
--- trunk/coregrind/m_demangle/cplus-dem.c 2006-10-17 01:42:40 UTC (rev 6=
273)
+++ trunk/coregrind/m_demangle/cplus-dem.c 2006-10-17 01:44:36 UTC (rev 6=
274)
@@ -940,7 +940,7 @@
MANGLED. */
=20
char *
-VG_(cplus_demangle) (mangled, options)
+ML_(cplus_demangle) (mangled, options)
const char *mangled;
int options;
{
@@ -958,14 +958,14 @@
/* The V3 ABI demangling is implemented elsewhere. */
if (GNU_V3_DEMANGLING || AUTO_DEMANGLING)
{
- ret =3D VG_(cplus_demangle_v3) (mangled/*, work->options*/);
+ ret =3D ML_(cplus_demangle_v3) (mangled/*, work->options*/);
if (ret || GNU_V3_DEMANGLING)
return ret;
}
=20
if (JAVA_DEMANGLING)
{
- ret =3D VG_(java_demangle_v3) (mangled);
+ ret =3D ML_(java_demangle_v3) (mangled);
if (ret)
return ret;
}
@@ -2026,7 +2026,7 @@
mangled here does not make use of any of the squangling
or type-code information we have built up thus far; it is
mangled independently. */
- q =3D VG_(cplus_demangle) (p, work->options);
+ q =3D ML_(cplus_demangle) (p, work->options);
if (tk =3D=3D tk_pointer)
string_appendn (s, "&", 1);
/* FIXME: Pointer-to-member constants should get a
@@ -3135,7 +3135,7 @@
memcpy (recurse, *mangled, namelength);
recurse[namelength] =3D '\000';
=20
- recurse_dem =3D VG_(cplus_demangle) (recurse, work->options);
+ recurse_dem =3D ML_(cplus_demangle) (recurse, work->options);
=20
if (recurse_dem)
{
@@ -4134,7 +4134,7 @@
memcpy (recurse, *mangled, literal_len);
recurse[literal_len] =3D '\000';
=20
- recurse_dem =3D VG_(cplus_demangle) (recurse, work->options);
+ recurse_dem =3D ML_(cplus_demangle) (recurse, work->options);
=20
if (recurse_dem)
{
Modified: trunk/coregrind/m_demangle/demangle.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
--- trunk/coregrind/m_demangle/demangle.c 2006-10-17 01:42:40 UTC (rev 62=
73)
+++ trunk/coregrind/m_demangle/demangle.c 2006-10-17 01:44:36 UTC (rev 62=
74)
@@ -94,7 +94,7 @@
=20
/* Possibly undo (1) */
if (do_cxx_demangle)
- demangled =3D VG_(cplus_demangle) ( orig, DMGL_ANSI | DMGL_PARAMS =
);
+ demangled =3D ML_(cplus_demangle) ( orig, DMGL_ANSI | DMGL_PARAMS =
);
else
demangled =3D NULL;
=20
@@ -116,7 +116,8 @@
// for "the frame below main()" screwing up the testsuite, change all
// known incarnations of said into a single name, "(below main)".
if (0=3D=3DVG_(strcmp)("__libc_start_main", result)
- || 0=3D=3DVG_(strcmp)("generic_start_main", result))
+ || 0=3D=3DVG_(strcmp)("generic_start_main", result)
+ || 0=3D=3DVG_(strcmp)("__start", result)) /* on AIX */
VG_(strncpy_safely)(result, "(below main)", 13);
=20
# undef N_ZBUF
@@ -219,6 +220,8 @@
case 's': EMITSO(' '); break;
case 'Z': EMITSO('Z'); break;
case 'A': EMITSO('@'); break;
+ case 'L': EMITSO('('); break;
+ case 'R': EMITSO(')'); break;
default: error =3D True; goto out;
}
i++;
@@ -265,6 +268,8 @@
case 's': EMITFN(' '); break;
case 'Z': EMITFN('Z'); break;
case 'A': EMITFN('@'); break;
+ case 'L': EMITSO('('); break;
+ case 'R': EMITSO(')'); break;
default: error =3D True; goto out;
}
i++;
Modified: trunk/coregrind/m_demangle/demangle.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
--- trunk/coregrind/m_demangle/demangle.h 2006-10-17 01:42:40 UTC (rev 62=
73)
+++ trunk/coregrind/m_demangle/demangle.h 2006-10-17 01:44:36 UTC (rev 62=
74)
@@ -23,7 +23,7 @@
=20
#include "ansidecl.h"
=20
-#define current_demangling_style VG_(current_demangling_style)
+#define current_demangling_style ML_(current_demangling_style)
=20
/* Options passed to cplus_demangle (in 2nd parameter). */
=20
@@ -106,7 +106,7 @@
} libiberty_demanglers[];
=20
extern char *
-VG_(cplus_demangle) PARAMS ((const char *mangled, int options));
+ML_(cplus_demangle) PARAMS ((const char *mangled, int options));
=20
/*
extern int
@@ -137,10 +137,10 @@
=20
/* V3 ABI demangling entry points, defined in cp-demangle.c. */
extern char*
-VG_(cplus_demangle_v3) PARAMS ((const char* mangled));
+ML_(cplus_demangle_v3) PARAMS ((const char* mangled));
=20
extern char*
-VG_(java_demangle_v3) PARAMS ((const char* mangled));
+ML_(java_demangle_v3) PARAMS ((const char* mangled));
=20
=20
enum gnu_v3_ctor_kinds {
|
|
From: <sv...@va...> - 2006-10-17 01:42:45
|
Author: sewardj
Date: 2006-10-17 02:42:40 +0100 (Tue, 17 Oct 2006)
New Revision: 6273
Log:
Merge r6136:
Track SysRes change; support bigpage allocation on AIX; make the
client-arena superblocks much bigger on AIX.
Modified:
trunk/coregrind/m_mallocfree.c
Modified: trunk/coregrind/m_mallocfree.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
--- trunk/coregrind/m_mallocfree.c 2006-10-17 01:42:00 UTC (rev 6272)
+++ trunk/coregrind/m_mallocfree.c 2006-10-17 01:42:40 UTC (rev 6273)
@@ -454,6 +454,7 @@
larger prev/next ptr.
*/
if (VG_AR_CLIENT =3D=3D aid) {
+ Int ar_client_sbszB;
if (client_inited) {
// This assertion ensures that a tool cannot try to change the =
client
// redzone size with VG_(needs_malloc_replacement)() after this=
module
@@ -474,8 +475,17 @@
VG_(exit)(1);
}
}
- // Initialise the client arena
- arena_init ( VG_AR_CLIENT, "client", client_rz_szB, 1048576 )=
;
+ // Initialise the client arena. On AIX it's important to have
+ // relatively large client blocks so as not to cause excessively
+ // fine-grained interleaving of V and C address space. On Linux
+ // this is irrelevant since aspacem can keep the two spaces
+ // well apart, but not so on AIX.
+# if defined(VGO_aix5)
+ ar_client_sbszB =3D 16777216;
+# else
+ ar_client_sbszB =3D 1048576;
+# endif
+ arena_init ( VG_AR_CLIENT, "client", client_rz_szB, ar_client=
_sbszB );
client_inited =3D True;
=20
} else {
@@ -548,7 +558,6 @@
{
Superblock* sb;
SysRes sres;
- NSegment* seg;
=20
// Take into account admin bytes in the Superblock.
cszB +=3D sizeof(Superblock);
@@ -558,26 +567,26 @@
=20
if (a->clientmem) {
// client allocation -- return 0 to client if it fails
- sres =3D VG_(am_mmap_anon_float_client)
+ sres =3D VG_(am_sbrk_anon_float_client)
( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC );
if (sres.isError)
return 0;
- sb =3D (Superblock*)sres.val;
+ sb =3D (Superblock*)sres.res;
// Mark this segment as containing client heap. The leak
// checker needs to be able to identify such segments so as not
// to use them as sources of roots during leak checks.
- seg =3D VG_(am_find_nsegment)( (Addr)sb );
- vg_assert(seg && seg->kind =3D=3D SkAnonC);
- seg->isCH =3D True;
+ VG_(am_set_segment_isCH_if_SkAnonC)(=20
+ (NSegment*) VG_(am_find_nsegment)( (Addr)sb )
+ );
} else {
// non-client allocation -- abort if it fails
- sres =3D VG_(am_mmap_anon_float_valgrind)( cszB );
+ sres =3D VG_(am_sbrk_anon_float_valgrind)( cszB );
if (sres.isError) {
VG_(out_of_memory_NORETURN)("newSuperblock", cszB);
/* NOTREACHED */
sb =3D NULL; /* keep gcc happy */
} else {
- sb =3D (Superblock*)sres.val;
+ sb =3D (Superblock*)sres.res;
}
}
vg_assert(NULL !=3D sb);
|
|
From: <sv...@va...> - 2006-10-17 01:42:04
|
Author: sewardj Date: 2006-10-17 02:42:00 +0100 (Tue, 17 Oct 2006) New Revision: 6272 Log: This should have been part of r6271. Modified: trunk/coregrind/pub_core_errormgr.h Modified: trunk/coregrind/pub_core_errormgr.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 --- trunk/coregrind/pub_core_errormgr.h 2006-10-17 01:41:17 UTC (rev 6271= ) +++ trunk/coregrind/pub_core_errormgr.h 2006-10-17 01:42:00 UTC (rev 6272= ) @@ -60,6 +60,8 @@ =20 extern UInt VG_(get_n_errs_found) ( void ); =20 +extern void VG_(print_errormgr_stats) ( void ); + #endif // __PUB_CORE_ERRORMGR_H =20 /*--------------------------------------------------------------------*/ |