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
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(13) |
2
(33) |
3
(25) |
4
(22) |
5
(22) |
6
(21) |
7
(19) |
|
8
(29) |
9
(34) |
10
(29) |
11
(37) |
12
(36) |
13
(28) |
14
(25) |
|
15
(28) |
16
(23) |
17
(36) |
18
(21) |
19
(12) |
20
(14) |
21
(10) |
|
22
(7) |
23
(15) |
24
(41) |
25
(15) |
26
(9) |
27
(7) |
28
(6) |
|
29
(16) |
30
(24) |
31
(22) |
|
|
|
|
|
From: Nicholas N. <nj...@cs...> - 2005-05-30 22:10:55
|
On Mon, 30 May 2005, Robert Walsh wrote:
>> Another comment: you've introduced new VG_USERREQ__* constants. These
>> could be avoided by using the VG_USERREQ__CLIENT_CALL* constants to call
>> VG_(handle_stack_new)() and the other functions.
>
> That would be nice. How does one use these, exactly? I can't find
> anything that currently uses them to use as an example. It looks like
> it should be something like this:
>
> #define VALGRIND_STACK_REGISTER(start, end) \
> VALGRIND_NON_SIMD_CALL2(VG_(handle_stack_new), start, end)
>
> But wouldn't that mean having to expose the VG_(...) stuff into user
> land, or something? I'm a little confused by these, I guess.
Oh, yes, you'd have to expose VG_(handle_stack_new) to the client.
Scratch that, then.
>> The functions would have
>> to take a ThreadId as their first arg, but that's not difficult.
>
> Really? I don't see that in the code anywhere:
>
> case VG_USERREQ__CLIENT_CALL2: {
> UWord (*f)(UWord, UWord) = (void*)arg[1];
> if (f == NULL)
> VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL2: func=%p\n", f);
> else
> SET_CLCALL_RETVAL(tid, f ( arg[2], arg[3] ), (Addr)f );
> break;
> }
>
> The function is invoked only with the args passed into the client
> request.
It's a 2.4 --> 3.0 change.
Nick
|
|
From: Josef W. <Jos...@gm...> - 2005-05-30 22:03:01
|
Hi, I have a question on Valgrind scheduling (I have a bug here in my tool): as callgrind has "shadow" call stacks for each thread, it always needs to know which thread currently is running. Usually, this is no problem with VG_(track_thread_run). I also track signal handlers. And these can switch the running thread. VG_(track_thread_run) is not called directly after a signal handlers return. So the question is, what thread is resumed when a signal handler returns? Do I have to track this myself? And if, how to do this? Can there be a thread switch while a signal handler is running? Thanks for any answer; I somehow can see the solution from Valgrinds source. Josef |
|
From: <sv...@va...> - 2005-05-30 21:44:13
|
Author: sewardj
Date: 2005-05-30 22:44:08 +0100 (Mon, 30 May 2005)
New Revision: 3816
Modified:
trunk/coregrind/core.h
trunk/coregrind/linux/core_os.c
trunk/coregrind/m_syscalls/syscalls-x86-linux.c
trunk/coregrind/m_syscalls/syscalls.c
trunk/coregrind/vg_main.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/vg_signals.c
trunk/include/vki-linux.h
Log:
Change the way thread termination is handled. Until now, there has
been a concept of a 'master thread'. This is the first thread in the
process. There was special logic which kept the master thread alive
artificially should it attempt to exit before its children. So the
master would wait for all children to exit and then exit itself, in
the process emitting the final summary of errors, leaks, etc.
This has the advantage that any process waiting on this one will see
the final summaries appearing before its sys_wait call returns. In
other words, the final summary output is synchronous with the
master-thread exiting.
Unfortunately the master-thread idea has a serious drawback, namely
that it can and sometimes does cause threaded programs to deadlock at
exit. It introduces an artificial dependency which is that the master
thread cannot really exit until all its children have exited. If --
by any means at all -- the children are waiting for the master to exit
before exiting themselves, deadlock results. There are now two known
examples of such deadlocks.
This commit removes the master thread concept and lets threads exit in
the order which they would have exited without Valgrind's involvement.
The last thread to exit prints the final summaries. This has the
disadvantage that final output may appear arbitrarily later relative
to the exit of the initial thread. Whether this is a problem in
practice remains to be seen.
As a minor side effect of this change, some functions have had
_NORETURN added to their names. Such functions do not return. The
thread in which they execute is guaranteed to exit before they return.
This makes the logic somewhat easier to follow.
amd64 compilation is now broken. I will fix it shortly.
Modified: trunk/coregrind/core.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/core.h 2005-05-30 03:12:09 UTC (rev 3815)
+++ trunk/coregrind/core.h 2005-05-30 21:44:08 UTC (rev 3816)
@@ -345,7 +345,10 @@
=20
// Do everything which needs doing before the process finally ends,
// like printing reports, etc
-extern void VG_(shutdown_actions)(ThreadId tid);
+extern void VG_(shutdown_actions_NORETURN) (
+ ThreadId tid,=20
+ VgSchedReturnCode tids_schedretcode=20
+ );
=20
extern void VG_(scheduler_init) ( void );
=20
@@ -524,12 +527,6 @@
Char* VG_(build_child_VALGRINDCLO) ( Char* exename );
Char* VG_(build_child_exename) ( void );
=20
-/* The master thread the one which will be responsible for mopping
- everything up at exit. Normally it is tid 1, since that's the
- first thread created, but it may be something else after a
- fork(). */
-extern ThreadId VG_(master_tid);
-
/* Called when some unhandleable client behaviour is detected.
Prints a msg and aborts. */
extern void VG_(unimplemented) ( Char* msg )
@@ -608,21 +605,23 @@
/*MOD*/ ThreadArchState* arch );
=20
// OS/Platform-specific thread clear (after thread exit)
-extern void VGA_(os_state_clear)(ThreadState *);
+extern void VGO_(os_state_clear)(ThreadState *);
=20
// OS/Platform-specific thread init (at scheduler init time)
-extern void VGA_(os_state_init)(ThreadState *);
+extern void VGO_(os_state_init)(ThreadState *);
=20
-// Run a thread from beginning to end. Does not return if tid =3D=3D VG=
_(master_tid).
-void VGA_(thread_wrapper)(Word /*ThreadId*/ tid);
+// Run a thread from beginning to end.=20
+extern VgSchedReturnCode VGO_(thread_wrapper)(Word /*ThreadId*/ tid);
=20
-// Like VGA_(thread_wrapper), but it allocates a stack before calling
-// to VGA_(thread_wrapper) on that stack, as if it had been set up by
-// clone()
-void VGA_(main_thread_wrapper)(ThreadId tid) __attribute__ ((__noreturn_=
_));
+// Call here to exit the entire Valgrind system.
+extern void VGO_(terminate_NORETURN)(ThreadId tid, VgSchedReturnCode src=
);
=20
+// Allocates a stack for the first thread, then runs it,
+// as if the thread had been set up by clone()
+extern void VGP_(main_thread_wrapper_NORETURN)(ThreadId tid);
+
// Return how many bytes of a thread's Valgrind stack are unused
-SSizeT VGA_(stack_unused)(ThreadId tid);
+extern SSizeT VGA_(stack_unused)(ThreadId tid);
=20
// wait until all other threads are dead
extern void VGA_(reap_threads)(ThreadId self);
Modified: trunk/coregrind/linux/core_os.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/linux/core_os.c 2005-05-30 03:12:09 UTC (rev 3815)
+++ trunk/coregrind/linux/core_os.c 2005-05-30 21:44:08 UTC (rev 3816)
@@ -29,26 +29,37 @@
*/
=20
#include "core.h"
+#include "pub_core_debuglog.h"
#include "pub_core_options.h"
#include "pub_core_tooliface.h"
=20
-void VGA_(os_state_clear)(ThreadState *tst)
+void VGO_(os_state_clear)(ThreadState *tst)
{
tst->os_state.lwpid =3D 0;
tst->os_state.threadgroup =3D 0;
}
=20
-void VGA_(os_state_init)(ThreadState *tst)
+void VGO_(os_state_init)(ThreadState *tst)
{
tst->os_state.valgrind_stack_base =3D 0;
tst->os_state.valgrind_stack_szB =3D 0;
=20
- VGA_(os_state_clear)(tst);
+ VGO_(os_state_clear)(tst);
}
=20
-static void terminate(ThreadId tid, VgSchedReturnCode src)
+static Bool i_am_the_only_thread ( void )
{
- vg_assert(tid =3D=3D VG_(master_tid));
+ Int c =3D VG_(count_living_threads)();
+ vg_assert(c >=3D 1); /* stay sane */
+ return c =3D=3D 1;
+}
+
+
+void VGO_(terminate_NORETURN)(ThreadId tid, VgSchedReturnCode src)
+{
+ VG_(debugLog)(1, "core_os",=20
+ "VGO_(terminate_NORETURN)(tid=3D%lld)\n", (ULong)tid=
);
+
vg_assert(VG_(count_living_threads)() =3D=3D 0);
=20
//--------------------------------------------------------------
@@ -56,15 +67,15 @@
//--------------------------------------------------------------
switch (src) {
case VgSrc_ExitSyscall: /* the normal way out */
- VG_(exit)( VG_(threads)[VG_(master_tid)].os_state.exitcode );
+ VG_(exit)( VG_(threads)[tid].os_state.exitcode );
/* NOT ALIVE HERE! */
VG_(core_panic)("entered the afterlife in main() -- ExitSyscall");
break; /* what the hell :) */
=20
case VgSrc_FatalSig:
/* We were killed by a fatal signal, so replicate the effect */
- vg_assert(VG_(threads)[VG_(master_tid)].os_state.fatalsig !=3D 0);
- VG_(kill_self)(VG_(threads)[VG_(master_tid)].os_state.fatalsig);
+ vg_assert(VG_(threads)[tid].os_state.fatalsig !=3D 0);
+ VG_(kill_self)(VG_(threads)[tid].os_state.fatalsig);
VG_(core_panic)("main(): signal was supposed to be fatal");
break;
=20
@@ -73,9 +84,16 @@
}
}
=20
-/* Run a thread from beginning to end. Does not return. */
-void VGA_(thread_wrapper)(Word /*ThreadId*/ tidW)
+
+/* Run a thread from beginning to end and return the thread's
+ scheduler-return-code. */
+
+VgSchedReturnCode VGO_(thread_wrapper)(Word /*ThreadId*/ tidW)
{
+ VG_(debugLog)(1, "core_os",=20
+ "VGO_(thread_wrapper)(tid=3D%lld): entry\n",=20
+ (ULong)tidW);
+
VgSchedReturnCode ret;
ThreadId tid =3D (ThreadId)tidW;
ThreadState* tst =3D VG_(get_ThreadState)(tid);
@@ -103,81 +121,26 @@
=20
vg_assert(tst->status =3D=3D VgTs_Runnable);
vg_assert(VG_(is_running_thread)(tid));
- =20
- if (tid =3D=3D VG_(master_tid)) {
- VG_(shutdown_actions)(tid);
- terminate(tid, ret);
- }
-}
=20
-/* wait until all other threads are dead */
-static Bool alldead(void *v)
-{
- /* master_tid must be alive... */
- Int c =3D VG_(count_living_threads)();
- //VG_(printf)("alldead: count=3D%d\n", c);
- return c <=3D 1;
-}
+ VG_(debugLog)(1, "core_os",=20
+ "VGO_(thread_wrapper)(tid=3D%lld): done\n",=20
+ (ULong)tidW);
=20
-static void sigvgchld_handler(Int sig)
-{
- VG_(printf)("got a sigvgchld?\n");
+ /* Return to caller, still holding the lock. */
+ return ret;
}
=20
-/*=20
- Wait until some predicate about threadstates is satisfied.
=20
- This uses SIGVGCHLD as a notification that it is now worth
- re-evaluating the predicate.
- */
-static void wait_for_threadstate(Bool (*pred)(void *), void *arg)
+/* Wait until all other threads disappear. */
+void VGA_(reap_threads)(ThreadId self)
{
- vki_sigset_t set, saved;
- struct vki_sigaction sa, old_sa;
-
- /*=20
- SIGVGCHLD is set to be ignored, and is unblocked by default.
- This means all such signals are simply discarded.
-
- In this loop, we actually block it, and then poll for it with
- sigtimedwait.
- */
- VG_(sigemptyset)(&set);
- VG_(sigaddset)(&set, VKI_SIGVGCHLD);
-
- VG_(set_sleeping)(VG_(master_tid), VgTs_Yielding);
- VG_(sigprocmask)(VKI_SIG_BLOCK, &set, &saved);
-
- /* It shouldn't be necessary to set a handler, since the signal is
- always blocked, but it seems to be necessary to convice the
- kernel not to just toss the signal... */
- sa.ksa_handler =3D sigvgchld_handler;
- sa.sa_flags =3D 0;
- VG_(sigfillset)(&sa.sa_mask);
- VG_(sigaction)(VKI_SIGVGCHLD, &sa, &old_sa);
-
- vg_assert(old_sa.ksa_handler =3D=3D VKI_SIG_IGN);
-
- while(!(*pred)(arg)) {
- struct vki_siginfo si;
- Int ret =3D VG_(sigtimedwait)(&set, &si, NULL);
-
- if (ret > 0 && VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Got %d (code=3D%d) from tid lwp %d",
- ret, si.si_code, si._sifields._kill._pid);
+ while (!i_am_the_only_thread()) {
+ /* Let other thread(s) run */
+ VG_(vg_yield)();
}
-
- VG_(sigaction)(VKI_SIGVGCHLD, &old_sa, NULL);
- VG_(sigprocmask)(VKI_SIG_SETMASK, &saved, NULL);
- VG_(set_running)(VG_(master_tid));
+ vg_assert(i_am_the_only_thread());
}
=20
-void VGA_(reap_threads)(ThreadId self)
-{
- vg_assert(self =3D=3D VG_(master_tid));
- wait_for_threadstate(alldead, NULL);
-}
-
/* The we need to know the address of it so it can be
called at program exit. */
static Addr __libc_freeres_wrapper;
Modified: trunk/coregrind/m_syscalls/syscalls-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_syscalls/syscalls-x86-linux.c 2005-05-30 03:12:09 U=
TC (rev 3815)
+++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-05-30 21:44:08 U=
TC (rev 3816)
@@ -35,6 +35,7 @@
=20
#include "core.h"
#include "ume.h" /* for jmp_with_stack */
+#include "pub_core_debuglog.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_sigframe.h"
#include "pub_core_syscalls.h"
@@ -244,64 +245,116 @@
return ((Addr)p) - tst->os_state.valgrind_stack_base;
}
=20
-/*
- Allocate a stack for the main thread, and call VGA_(thread_wrapper)
- on that stack.
- */
-void VGA_(main_thread_wrapper)(ThreadId tid)
+
+/* Run a thread all the way to the end, then do appropriate exit actions
+ (this is the last-one-out-turn-off-the-lights bit).=20
+*/
+static void run_a_thread_NORETURN ( Word tidW )
{
- UWord* esp =3D allocstack(tid);
+ ThreadId tid =3D (ThreadId)tidW;
=20
- vg_assert(tid =3D=3D VG_(master_tid));
+ VG_(debugLog)(1, "syscalls-x86-linux",=20
+ "run_a_thread_NORETURN(tid=3D%lld): "
+ "VGO_(thread_wrapper) called\n",
+ (ULong)tidW);
=20
- call_on_new_stack_0_1(=20
- (Addr)esp, /* stack */
- 0, /*bogus return address*/
- VGA_(thread_wrapper), /* fn to call */
- (Word)tid /* arg to give it */
- );
+ /* Run the thread all the way through. */
+ VgSchedReturnCode src =3D VGO_(thread_wrapper)(tid); =20
=20
+ VG_(debugLog)(1, "syscalls-x86-linux",=20
+ "run_a_thread_NORETURN(tid=3D%lld): "
+ "VGO_(thread_wrapper) done\n",
+ (ULong)tidW);
+
+ Int c =3D VG_(count_living_threads)();
+ vg_assert(c >=3D 1); /* stay sane */
+
+ if (c =3D=3D 1) {
+
+ VG_(debugLog)(1, "syscalls-x86-linux",=20
+ "run_a_thread_NORETURN(tid=3D%lld): "
+ "last one standing\n",
+ (ULong)tidW);
+
+ /* We are the last one standing. Keep hold of the lock and
+ carry on to show final tool results, then exit the entire syste=
m. */
+ VG_(shutdown_actions_NORETURN)(tid, src);
+
+ } else {
+
+ VG_(debugLog)(1, "syscalls-x86-linux",=20
+ "run_a_thread_NORETURN(tid=3D%lld): "
+ "not last one standing\n",
+ (ULong)tidW);
+
+ /* OK, thread is dead, but others still exist. Just exit. */
+ ThreadState *tst =3D VG_(get_ThreadState)(tid);
+
+ /* This releases the run lock */
+ VG_(exit_thread)(tid);
+ vg_assert(tst->status =3D=3D VgTs_Zombie);
+
+ /* We have to use this sequence to terminate the thread to
+ prevent a subtle race. If VG_(exit_thread)() had left the
+ ThreadState as Empty, then it could have been reallocated,
+ reusing the stack while we're doing these last cleanups.
+ Instead, VG_(exit_thread) leaves it as Zombie to prevent
+ reallocation. We need to make sure we don't touch the stack
+ between marking it Empty and exiting. Hence the
+ assembler. */
+ asm volatile (
+ "movl %1, %0\n" /* set tst->status =3D VgTs_Empty */
+ "movl %2, %%eax\n" /* set %eax =3D __NR_exit */
+ "movl %3, %%ebx\n" /* set %ebx =3D tst->os_state.exitcode */
+ "int $0x80\n" /* exit(tst->os_state.exitcode) */
+ : "=3Dm" (tst->status)
+ : "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcod=
e));
+
+ VG_(core_panic)("Thread exit failed?\n");
+ }
+
/*NOTREACHED*/
vg_assert(0);
}
=20
-static Int start_thread(void *arg)
+
+/*
+ Allocate a stack for the main thread, and run it all the way to the
+ end. =20
+*/
+void VGP_(main_thread_wrapper_NORETURN)(ThreadId tid)
{
- ThreadState *tst =3D (ThreadState *)arg;
- ThreadId tid =3D tst->tid;
+ VG_(debugLog)(1, "syscalls-x86-linux",=20
+ "entering VGP_(main_thread_wrapper_NORETURN)\n");
=20
- VGA_(thread_wrapper)(tid);
+ UWord* esp =3D allocstack(tid);
=20
- /* OK, thread is dead; this releases the run lock */
- VG_(exit_thread)(tid);
+ /* shouldn't be any other threads around yet */
+ vg_assert( VG_(count_living_threads)() =3D=3D 1 );
=20
- vg_assert(tst->status =3D=3D VgTs_Zombie);
+ call_on_new_stack_0_1(=20
+ (Addr)esp, /* stack */
+ 0, /*bogus return address*/
+ run_a_thread_NORETURN, /* fn to call */
+ (Word)tid /* arg to give it */
+ );
=20
- /* Poke the reaper */
- if (VG_(clo_trace_signals))
- VG_(message)(Vg_DebugMsg, "Sending SIGVGCHLD to master tid=3D%d lw=
p=3D%d",=20
- VG_(master_tid), VG_(threads)[VG_(master_tid)].os_state.lwpid);
+ /*NOTREACHED*/
+ vg_assert(0);
+}
=20
- VG_(tkill)(VG_(threads)[VG_(master_tid)].os_state.lwpid, VKI_SIGVGCHL=
D);
=20
- /* We have to use this sequence to terminate the thread to prevent
- a subtle race. If VG_(exit_thread)() had left the ThreadState
- as Empty, then it could have been reallocated, reusing the stack
- while we're doing these last cleanups. Instead,
- VG_(exit_thread) leaves it as Zombie to prevent reallocation.
- We need to make sure we don't touch the stack between marking it
- Empty and exiting. Hence the assembler. */
- asm volatile (
- "movl %1, %0\n" /* set tst->status =3D VgTs_Empty */
- "movl %2, %%eax\n" /* set %eax =3D __NR_exit */
- "movl %3, %%ebx\n" /* set %ebx =3D tst->os_state.exitcode */
- "int $0x80\n" /* exit(tst->os_state.exitcode) */
- : "=3Dm" (tst->status)
- : "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode))=
;
+static Int start_thread_NORETURN ( void* arg )
+{
+ ThreadState* tst =3D (ThreadState*)arg;
+ ThreadId tid =3D tst->tid;
=20
- VG_(core_panic)("Thread exit failed?\n");
+ run_a_thread_NORETURN ( (Word)tid );
+ /*NOTREACHED*/
+ vg_assert(0);
}
=20
+
/* ---------------------------------------------------------------------
clone() handling
------------------------------------------------------------------ */
@@ -404,7 +457,7 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &blockall, &savedmask);
=20
/* Create the new thread */
- ret =3D VG_(clone)(start_thread, stack, flags, &VG_(threads)[ctid],
+ ret =3D VG_(clone)(start_thread_NORETURN, stack, flags, &VG_(threads)=
[ctid],
child_tidptr, parent_tidptr, NULL);
=20
VG_(sigprocmask)(VKI_SIG_SETMASK, &savedmask, NULL);
@@ -1470,7 +1523,7 @@
GENX_(__NR_chroot, sys_chroot), // 61
// (__NR_ustat, sys_ustat) // 62 SVr4 -- depr=
ecated
GENXY(__NR_dup2, sys_dup2), // 63
- GENXY(__NR_getppid, sys_getppid), // 64
+ GENX_(__NR_getppid, sys_getppid), // 64
=20
GENX_(__NR_getpgrp, sys_getpgrp), // 65
GENX_(__NR_setsid, sys_setsid), // 66
Modified: trunk/coregrind/m_syscalls/syscalls.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_syscalls/syscalls.c 2005-05-30 03:12:09 UTC (rev 38=
15)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-05-30 21:44:08 UTC (rev 38=
16)
@@ -2345,29 +2345,19 @@
/* 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_(master_tid) =3D tid; /* become the master */
VG_(nuke_all_threads_except)( tid, VgSrc_ExitSyscall );
VGA_(reap_threads)(tid);
=20
- if (0) {
- /* Shut down cleanly and report final state
- XXX Is this reasonable? */
- tst->exitreason =3D VgSrc_ExitSyscall;
- VG_(shutdown_actions)(tid);
+ { // Remove the valgrind-specific stuff from the environment so the
+ // child doesn't get vg_inject.so, vgpreload.so, etc. This is
+ // done unconditionally, since if we are tracing the child,
+ // stage1/2 will set up the appropriate client environment.
+ Char** envp =3D (Char**)ARG3;
+ if (envp !=3D NULL) {
+ VG_(env_remove_valgrind_env_stuff)( envp );
+ }
}
=20
- {
- // Remove the valgrind-specific stuff from the environment so the
- // child doesn't get vg_inject.so, vgpreload.so, etc. This is
- // done unconditionally, since if we are tracing the child,
- // stage1/2 will set up the appropriate client environment.
- Char** envp =3D (Char**)ARG3;
-
- if (envp !=3D NULL) {
- VG_(env_remove_valgrind_env_stuff)( envp );
- }
- }
-
if (VG_(clo_trace_children)) {
Char* optvar =3D VG_(build_child_VALGRINDCLO)( (Char*)ARG1 );
=20
@@ -2952,16 +2942,6 @@
PRE_REG_READ0(long, "getppid");
}
=20
-POST(sys_getppid)
-{
- /* If the master thread has already exited, and it is this thread's
- parent, then force getppid to return 1 (init) rather than the
- real ppid, so that it thinks its parent has exited. */
- if (VG_(threads)[VG_(master_tid)].os_state.lwpid =3D=3D RES &&
- VG_(is_exiting)(VG_(master_tid)))
- RES =3D 1;
-}
-
static void common_post_getrlimit(ThreadId tid, UWord a1, UWord a2)
{
POST_MEM_WRITE( a2, sizeof(struct vki_rlimit) );
@@ -6068,15 +6048,6 @@
VG_(sigdelset)(mask, VKI_SIGSTOP);
=20
VG_(sigdelset)(mask, VKI_SIGVGKILL); /* never block */
-
- /* SIGVGCHLD is used by threads to indicate their state changes to
- the master thread. Mostly it doesn't care, so it leaves the
- signal ignored and unblocked. Everyone else should have it
- blocked, so there's at most 1 thread with it unblocked. */
- if (tid =3D=3D VG_(master_tid))
- VG_(sigdelset)(mask, VKI_SIGVGCHLD);
- else
- VG_(sigaddset)(mask, VKI_SIGVGCHLD);
}
=20
void VG_(client_syscall) ( ThreadId tid )
Modified: trunk/coregrind/vg_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/vg_main.c 2005-05-30 03:12:09 UTC (rev 3815)
+++ trunk/coregrind/vg_main.c 2005-05-30 21:44:08 UTC (rev 3816)
@@ -137,12 +137,6 @@
static Int vg_argc;
static Char **vg_argv;
=20
-/* The master thread the one which will be responsible for mopping
- everything up at exit. Normally it is tid 1, since that's the
- first thread created, but it may be something else after a
- fork(). */
-ThreadId VG_(master_tid) =3D VG_INVALID_THREADID;
-
/* Application-visible file descriptor limits */
Int VG_(fd_soft_limit) =3D -1;
Int VG_(fd_hard_limit) =3D -1;
@@ -2817,24 +2811,29 @@
//--------------------------------------------------------------
VGP_POPCC(VgpStartup);
=20
- vg_assert(VG_(master_tid) =3D=3D 1);
-
if (VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, "<status>RUNNING</status>");
VG_(message)(Vg_UserMsg, "");
}
=20
VG_(debugLog)(1, "main", "Running thread 1\n");
- VGA_(main_thread_wrapper)(1);
+ /* As a result of the following call, the last thread standing
+ eventually winds up running VG_(shutdown_actions_NORETURN) just
+ below. */
+ VGP_(main_thread_wrapper_NORETURN)(1);
=20
- abort();
+ /*NOTREACHED*/
+ vg_assert(0);
}
=20
=20
/* Do everything which needs doing when the last thread exits */
-void VG_(shutdown_actions)(ThreadId tid)
+void VG_(shutdown_actions_NORETURN) ( ThreadId tid,=20
+ VgSchedReturnCode tids_schedretcod=
e )
{
- vg_assert(tid =3D=3D VG_(master_tid));
+ VG_(debugLog)(1, "main", "entering VG_(shutdown_actions_NORETURN)\n")=
;
+
+ vg_assert( VG_(count_living_threads)() =3D=3D 1 );
vg_assert(VG_(is_running_thread)(tid));
=20
// Wait for all other threads to exit.
@@ -2896,6 +2895,12 @@
/* Print Vex storage stats */
if (0)
LibVEX_ShowAllocStats();
+
+ /* Ok, finally exit in the os-specific way. In short, if the
+ (last) thread exited by calling sys_exit, do likewise; if the
+ (last) thread stopped due to a fatal signal, terminate the
+ entire system with that same fatal signal. */
+ VGO_(terminate_NORETURN)( tid, tids_schedretcode );
}
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/vg_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/vg_scheduler.c 2005-05-30 03:12:09 UTC (rev 3815)
+++ trunk/coregrind/vg_scheduler.c 2005-05-30 21:44:08 UTC (rev 3816)
@@ -439,10 +439,6 @@
VG_(sigdelset)(&mask, VKI_SIGSTOP);
VG_(sigdelset)(&mask, VKI_SIGKILL);
=20
- /* Master doesn't block this */
- if (tid =3D=3D VG_(master_tid))
- VG_(sigdelset)(&mask, VKI_SIGVGCHLD);
-
VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, NULL);
}
=20
@@ -566,7 +562,7 @@
VG_(sigemptyset)(&VG_(threads)[tid].sig_mask);
VG_(sigemptyset)(&VG_(threads)[tid].tmp_sig_mask);
=20
- VGA_(os_state_clear)(&VG_(threads)[tid]);
+ VGO_(os_state_clear)(&VG_(threads)[tid]);
=20
/* start with no altstack */
VG_(threads)[tid].altstack.ss_sp =3D (void *)0xdeadbeef;
@@ -600,8 +596,6 @@
ThreadId tid;
vg_assert(running_tid =3D=3D me);
=20
- VG_(master_tid) =3D me;
-
VG_(threads)[me].os_state.lwpid =3D VG_(gettid)();
VG_(threads)[me].os_state.threadgroup =3D VG_(getpid)();
=20
@@ -635,7 +629,7 @@
for (i =3D 0 /* NB; not 1 */; i < VG_N_THREADS; i++) {
VG_(threads)[i].sig_queue =3D NULL;
=20
- VGA_(os_state_init)(&VG_(threads)[i]);
+ VGO_(os_state_init)(&VG_(threads)[i]);
mostly_clear_thread_record(i);
=20
VG_(threads)[i].status =3D VgTs_Empty;
@@ -645,8 +639,6 @@
=20
tid_main =3D VG_(alloc_ThreadState)();
=20
- VG_(master_tid) =3D tid_main;
-
/* Initial thread's stack is the original process stack */
VG_(threads)[tid_main].client_stack_highest_word=20
=3D VG_(clstk_end) - sizeof(=
UWord);
Modified: trunk/coregrind/vg_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/vg_signals.c 2005-05-30 03:12:09 UTC (rev 3815)
+++ trunk/coregrind/vg_signals.c 2005-05-30 21:44:08 UTC (rev 3816)
@@ -303,8 +303,6 @@
// cases in the switch, so we handle them in the 'default' case=
.
if (sig =3D=3D VKI_SIGVGKILL)
skss_handler =3D sigvgkill_handler;
- else if (sig =3D=3D VKI_SIGVGCHLD)
- skss_handler =3D VKI_SIG_IGN; /* we only poll for it */
else {
if (scss_handler =3D=3D VKI_SIG_IGN)
skss_handler =3D VKI_SIG_IGN;
@@ -1358,7 +1356,8 @@
#endif
=20
/* stash fatal signal in main thread */
- VG_(threads)[VG_(master_tid)].os_state.fatalsig =3D sigNo;
+ // what's this for?
+ //VG_(threads)[VG_(master_tid)].os_state.fatalsig =3D sigNo;
=20
/* everyone dies */
VG_(nuke_all_threads_except)(tid, VgSrc_FatalSig);
@@ -1884,8 +1883,10 @@
if (0)
VG_(kill_self)(sigNo); /* generate a core dump */
=20
- if (tid =3D=3D 0) /* could happen after everyone has ex=
ited */
- tid =3D VG_(master_tid);
+ //if (tid =3D=3D 0) /* could happen after everyone has =
exited */
+ // tid =3D VG_(master_tid);
+ vg_assert(tid !=3D 0);
+
tst =3D VG_(get_ThreadState)(tid);
VG_(get_StackTrace2)(ips, VG_(clo_backtrace_size),=20
VGP_UCONTEXT_INSTR_PTR(uc),
@@ -1967,8 +1968,6 @@
for(i =3D 0; i < _VKI_NSIG_WORDS; i++)
pollset.sig[i] =3D ~tst->sig_mask.sig[i];
=20
- VG_(sigdelset)(&pollset, VKI_SIGVGCHLD); /* already dealt with */
-
//VG_(printf)("tid %d pollset=3D%08x%08x\n", tid, pollset.sig[1], pol=
lset.sig[0]);
=20
block_all_host_signals(&saved_mask); // protect signal queue
@@ -2063,19 +2062,18 @@
VG_(message)(Vg_DebugMsg, "Max kernel-supported signal is %d", VG_=
(max_signal));
=20
/* Our private internal signals are treated as ignored */
- scss.scss_per_sig[VKI_SIGVGCHLD].scss_handler =3D VKI_SIG_IGN;
- scss.scss_per_sig[VKI_SIGVGCHLD].scss_flags =3D VKI_SA_SIGINFO;
- VG_(sigfillset)(&scss.scss_per_sig[VKI_SIGVGCHLD].scss_mask);
-
scss.scss_per_sig[VKI_SIGVGKILL].scss_handler =3D VKI_SIG_IGN;
scss.scss_per_sig[VKI_SIGVGKILL].scss_flags =3D VKI_SA_SIGINFO;
VG_(sigfillset)(&scss.scss_per_sig[VKI_SIGVGKILL].scss_mask);
=20
/* Copy the process' signal mask into the root thread. */
- vg_assert(VG_(threads)[VG_(master_tid)].status =3D=3D VgTs_Init);
- VG_(threads)[VG_(master_tid)].sig_mask =3D saved_procmask;
- VG_(threads)[VG_(master_tid)].tmp_sig_mask =3D saved_procmask;
+ vg_assert(VG_(threads)[1].status =3D=3D VgTs_Init);
+ for (i =3D 2; i < VG_N_THREADS; i++)
+ vg_assert(VG_(threads)[i].status =3D=3D VgTs_Empty);
=20
+ VG_(threads)[1].sig_mask =3D saved_procmask;
+ VG_(threads)[1].tmp_sig_mask =3D saved_procmask;
+
/* Calculate SKSS and apply it. This also sets the initial kernel
mask we need to run with. */
handle_SCSS_change( True /* forced update */ );
Modified: trunk/include/vki-linux.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/vki-linux.h 2005-05-30 03:12:09 UTC (rev 3815)
+++ trunk/include/vki-linux.h 2005-05-30 21:44:08 UTC (rev 3816)
@@ -351,8 +351,7 @@
=20
/* Use high signals because native pthreads wants to use low */
#define VKI_SIGVGKILL (VG_(max_signal)-0) // [[internal: kill]]
-#define VKI_SIGVGCHLD (VG_(max_signal)-1) // [[internal: thread de=
ath]]
-#define VKI_SIGVGRTUSERMAX (VG_(max_signal)-2) // [[internal: last user=
-usable RT signal]]
+#define VKI_SIGVGRTUSERMAX (VG_(max_signal)-1) // [[internal: last user=
-usable RT signal]]
=20
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/asm-generic/siginfo.h
|
|
From: Robert W. <rj...@du...> - 2005-05-30 21:42:00
|
> Another comment: you've introduced new VG_USERREQ__* constants. These=20
> could be avoided by using the VG_USERREQ__CLIENT_CALL* constants to call=20
> VG_(handle_stack_new)() and the other functions.
That would be nice. How does one use these, exactly? I can't find
anything that currently uses them to use as an example. It looks like
it should be something like this:
#define VALGRIND_STACK_REGISTER(start, end) \
VALGRIND_NON_SIMD_CALL2(VG_(handle_stack_new), start, end)
But wouldn't that mean having to expose the VG_(...) stuff into user
land, or something? I'm a little confused by these, I guess.
> The functions would have=20
> to take a ThreadId as their first arg, but that's not difficult.
Really? I don't see that in the code anywhere:
case VG_USERREQ__CLIENT_CALL2: {
UWord (*f)(UWord, UWord) =3D (void*)arg[1];
if (f =3D=3D NULL)
VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL2: func=3D%p\=
n", f);
else
SET_CLCALL_RETVAL(tid, f ( arg[2], arg[3] ), (Addr)f );
break;
}
The function is invoked only with the args passed into the client
request.
Regards,
Robert.
--=20
Robert Walsh
Amalgamated Durables, Inc. - "We don't make the things you buy."
Email: rj...@du...
|
|
From: Robert W. <rj...@du...> - 2005-05-30 21:30:46
|
On Mon, 2005-05-30 at 14:41 -0500, Nicholas Nethercote wrote: > On Mon, 30 May 2005, Robert Walsh wrote: >=20 > > * id =3D VALGRIND_STACK_NEW(start, end) registers the memory betwe= en > > start and end as a new stack and returns an id you can use for > > the other client requests described below. This doesn't > > allocate memory or anything - it just records that a particular > > memory range is a stack. > > > > * VALGRIND_STACK_DELETE(id) removes the stack association for > > stack "id". This doesn't free memory or anything - it just > > tells Valgrind that the piece of memory register earlier is no > > longer a stack. >=20 > Perhaps VALGRIND_STACK_REGISTER and VALGRIND_STACK_DEREGISTER would be=20 > better names? You'd avoid the confusion with memory allocation. Yes. I'll do that. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: Nicholas N. <nj...@cs...> - 2005-05-30 19:46:42
|
On Mon, 30 May 2005, Robert Walsh wrote: > Hi all, > > I've put a new patch on my web site against the 2.4 tree: > > http://www.durables.org/~rjwalsh/software/valgrind Another comment: you've introduced new VG_USERREQ__* constants. These could be avoided by using the VG_USERREQ__CLIENT_CALL* constants to call VG_(handle_stack_new)() and the other functions. The functions would have to take a ThreadId as their first arg, but that's not difficult. N |
|
From: Nicholas N. <nj...@cs...> - 2005-05-30 19:41:50
|
On Mon, 30 May 2005, Robert Walsh wrote: > * id = VALGRIND_STACK_NEW(start, end) registers the memory between > start and end as a new stack and returns an id you can use for > the other client requests described below. This doesn't > allocate memory or anything - it just records that a particular > memory range is a stack. > > * VALGRIND_STACK_DELETE(id) removes the stack association for > stack "id". This doesn't free memory or anything - it just > tells Valgrind that the piece of memory register earlier is no > longer a stack. Perhaps VALGRIND_STACK_REGISTER and VALGRIND_STACK_DEREGISTER would be better names? You'd avoid the confusion with memory allocation. N |
|
From: Mark A. <ma...@al...> - 2005-05-30 19:23:46
|
On May 30, 2005, at 12:26 AM, Julian Seward wrote:
> Mark, could you explain how the use of uninitialised values from memory
> is made safe here? I'm looking at this
>
> do {
> } while (*++scan == *++match && *++scan == *++match &&
> *++scan == *++match && *++scan == *++match &&
> *++scan == *++match && *++scan == *++match &&
> *++scan == *++match && *++scan == *++match &&
> scan < strend);
>
> and it's not clear how scan can be moved forward some indeterminate
> amount based on garbage in memory and yet the deflate result is
> well-defined.
The output of the loop is where the first mismatch is (scan). If
uninitialized data is accessed in the process, then all of the
initialized data matched, and maybe some of the uninitialized data as
well. Later the length of the match is truncated to the length of the
initialized data, so it doesn't matter how far into the uninitialized
data the loop progressed.
This line limits nice_match to be no longer than the uninitialized data:
if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
This line exits the longest match search loop if a match that long is
found (or longer if some uninitialized data matched):
if (len >= nice_match) break;
And these lines return a match length limited to the length of the
initialized data:
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
return s->lookahead;
> An ideal outcome is that Mark explains how this behaviour
> is safe in zlib. I can then look at Memcheck's instrumentation
> phase to determine if/how it is possible to avoid these
> reports.
valgrind would have to be pretty smart to figure out what s->lookahead
means, trace the values of nice_match, len, and best_len, and figure
out from all that that the uninitialized data didn't affect the return
value. The only semi-reasonable automatic process I could imagine
would be for valgrind to set the first unintialized byte to all 256
values, run the code each time, and see that the returned value is not
affected (as well as all the side effects of the routine on the state
structure). Then if another uninitialized byte is accessed, which it
will be for one of the previous uninitialized byte values, do that all
over again, and so on. Good luck.
mark
|
|
From: Robert W. <rj...@du...> - 2005-05-30 17:37:59
|
> I was wondering if you can simply use the --max-stackframe flag in > the 3 line to get the same result .. >=20 > > if delta %esp > some value, then assume a thread change >=20 > This allows you to set 'some value' on the command line. =20 > Furthermore if you don't do that it will tell you plausible > values to try anyway. >=20 > Could you try out --max-stackframe to see if it is good enough? I haven't tried this, but I'm fairly certain that it won't work in the case of the coroutine library we're using at work. We use lots of coroutines (thousands) each with a relatively small stack (1K, and maybe less when we get around to tuning it) that's allocated using malloc. They end up essentially being right next to each other in memory. The main CPU stack still needs to be able to handle big stack allocations, as it does all of the nasty GUI work, etc. when the coroutines are done. I like the idea of being able to have the client program explain where stacks are. For programs that don't do that, --max-stackframe is a good idea, but for programs that do, it means you don't have to have magic numbers on the command line or worry about different classes of stack (big v. small like we have.) Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: <sv...@va...> - 2005-05-30 11:20:00
|
Author: sewardj
Date: 2005-05-30 12:19:54 +0100 (Mon, 30 May 2005)
New Revision: 1204
Modified:
trunk/priv/guest-x86/toIR.c
Log:
Apparently someone somewhere in some obscure library deep in the
basement of mozilla requires 'lods'.
Modified: trunk/priv/guest-x86/toIR.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/priv/guest-x86/toIR.c 2005-05-25 00:44:13 UTC (rev 1203)
+++ trunk/priv/guest-x86/toIR.c 2005-05-30 11:19:54 UTC (rev 1204)
@@ -3039,42 +3039,31 @@
void dis_MOVS ( Int sz, IRTemp t_inc )
{
IRType ty =3D szToITy(sz);
- //IRTemp tv =3D newTemp(ty); /* value being copied */
IRTemp td =3D newTemp(Ity_I32); /* EDI */
IRTemp ts =3D newTemp(Ity_I32); /* ESI */
=20
- //uInstr2(cb, GET, 4, ArchReg, R_EDI, TempReg, td);
- //uInstr2(cb, GET, 4, ArchReg, R_ESI, TempReg, ts);
assign( td, getIReg(4, R_EDI) );
assign( ts, getIReg(4, R_ESI) );
=20
- //uInstr2(cb, LOAD, sz, TempReg, ts, TempReg, tv);
- //uInstr2(cb, STORE,sz, TempReg, tv, TempReg, td);
storeLE( mkexpr(td), loadLE(ty,mkexpr(ts)) );
=20
- //uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, td);
- //uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, ts);
-
- //uInstr2(cb, PUT, 4, TempReg, td, ArchReg, R_EDI);
- //uInstr2(cb, PUT, 4, TempReg, ts, ArchReg, R_ESI);
putIReg( 4, R_EDI, binop(Iop_Add32, mkexpr(td), mkexpr(t_inc)) );
putIReg( 4, R_ESI, binop(Iop_Add32, mkexpr(ts), mkexpr(t_inc)) );
}
=20
-//-- static=20
-//-- void dis_LODS ( UCodeBlock* cb, Int sz, Int t_inc )
-//-- {
-//-- Int ta =3D newTemp(cb); /* EAX */
-//-- Int ts =3D newTemp(cb); /* ESI */
-//--=20
-//-- uInstr2(cb, GET, 4, ArchReg, R_ESI, TempReg, ts);
-//-- uInstr2(cb, LOAD, sz, TempReg, ts, TempReg, ta);
-//-- uInstr2(cb, PUT, sz, TempReg, ta, ArchReg, R_EAX);
-//--=20
-//-- uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, ts);
-//-- uInstr2(cb, PUT, 4, TempReg, ts, ArchReg, R_ESI);
-//-- }
+static=20
+void dis_LODS ( Int sz, IRTemp t_inc )
+{
+ IRType ty =3D szToITy(sz);
+ IRTemp ts =3D newTemp(Ity_I32); /* ESI */
=20
+ assign( ts, getIReg(4, R_ESI) );
+
+ putIReg( sz, R_EAX, loadLE(ty, mkexpr(ts)) );
+
+ putIReg( 4, R_ESI, binop(Iop_Add32, mkexpr(ts), mkexpr(t_inc)) );
+}
+
static=20
void dis_STOS ( Int sz, IRTemp t_inc )
{
@@ -3082,17 +3071,11 @@
IRTemp ta =3D newTemp(ty); /* EAX */
IRTemp td =3D newTemp(Ity_I32); /* EDI */
=20
- //uInstr2(cb, GET, sz, ArchReg, R_EAX, TempReg, ta);
assign( ta, getIReg(sz, R_EAX) );
-
- //uInstr2(cb, GET, 4, ArchReg, R_EDI, TempReg, td);
assign( td, getIReg(4, R_EDI) );
=20
- //uInstr2(cb, STORE, sz, TempReg, ta, TempReg, td);
storeLE( mkexpr(td), mkexpr(ta) );
=20
- //uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, td);
- //uInstr2(cb, PUT, 4, TempReg, td, ArchReg, R_EDI);
putIReg( 4, R_EDI, binop(Iop_Add32, mkexpr(td), mkexpr(t_inc)) );
}
=20
@@ -3102,34 +3085,18 @@
IRType ty =3D szToITy(sz);
IRTemp tdv =3D newTemp(ty); /* (EDI) */
IRTemp tsv =3D newTemp(ty); /* (ESI) */
- //IRTemp res =3D newTemp(ty);
IRTemp td =3D newTemp(Ity_I32); /* EDI */
IRTemp ts =3D newTemp(Ity_I32); /* ESI */
=20
- //uInstr2(cb, GET, 4, ArchReg, R_EDI, TempReg, td);
assign( td, getIReg(4, R_EDI) );
-
- //uInstr2(cb, GET, 4, ArchReg, R_ESI, TempReg, ts);
assign( ts, getIReg(4, R_ESI) );
=20
- //uInstr2(cb, LOAD, sz, TempReg, td, TempReg, tdv);
assign( tdv, loadLE(ty,mkexpr(td)) );
-
- //uInstr2(cb, LOAD, sz, TempReg, ts, TempReg, tsv);
assign( tsv, loadLE(ty,mkexpr(ts)) );
=20
- //uInstr2(cb, SUB, sz, TempReg, tdv, TempReg, tsv);=20
- //setFlagsFromUOpcode(cb, SUB);
- //assign( res, binop(mkSizedOp(ty, Iop_Sub8), mkexpr(tsv), mkexpr(tdv=
)) );
setFlags_DEP1_DEP2 ( Iop_Sub8, tsv, tdv, ty );
=20
- //uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, td);
- //uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, ts);
-
- //uInstr2(cb, PUT, 4, TempReg, td, ArchReg, R_EDI);
putIReg(4, R_EDI, binop(Iop_Add32, mkexpr(td), mkexpr(t_inc)) );
-
- //uInstr2(cb, PUT, 4, TempReg, ts, ArchReg, R_ESI);
putIReg(4, R_ESI, binop(Iop_Add32, mkexpr(ts), mkexpr(t_inc)) );
}
=20
@@ -3140,24 +3107,13 @@
IRTemp ta =3D newTemp(ty); /* EAX */
IRTemp td =3D newTemp(Ity_I32); /* EDI */
IRTemp tdv =3D newTemp(ty); /* (EDI) */
- //IRTemp res =3D newTemp(ty);
=20
- //uInstr2(cb, GET, sz, ArchReg, R_EAX, TempReg, ta);
assign( ta, getIReg(sz, R_EAX) );
-
- //uInstr2(cb, GET, 4, ArchReg, R_EDI, TempReg, td);
assign( td, getIReg(4, R_EDI) );
=20
- //uInstr2(cb, LOAD, sz, TempReg, td, TempReg, tdv);
assign( tdv, loadLE(ty,mkexpr(td)) );
-
- //uInstr2(cb, SUB, sz, TempReg, tdv, TempReg, ta);
- //setFlagsFromUOpcode(cb, SUB);
- //assign( res, binop(mkSizedOp(ty, Iop_Sub8), mkexpr(ta), mkexpr(tdv)=
) );
setFlags_DEP1_DEP2 ( Iop_Sub8, ta, tdv, ty );
=20
- //uInstr2(cb, ADD, 4, TempReg, t_inc, TempReg, td);
- //uInstr2(cb, PUT, 4, TempReg, td, ArchReg, R_EDI);
putIReg(4, R_EDI, binop(Iop_Add32, mkexpr(td), mkexpr(t_inc)) );
}
=20
@@ -3173,17 +3129,12 @@
IRTemp t_inc =3D newTemp(Ity_I32);
IRTemp tc =3D newTemp(Ity_I32); /* ECX */
=20
- //uInstr2 (cb, GET, 4, ArchReg, R_ECX, TempReg, tc);
assign( tc, getIReg(4,R_ECX) );
=20
- //uInstr2 (cb, JIFZ, 4, TempReg, tc, Literal, 0);
- //uLiteral(cb, eip_next);
stmt( IRStmt_Exit( binop(Iop_CmpEQ32,mkexpr(tc),mkU32(0)),
Ijk_Boring,
IRConst_U32(eip_next) ) );
=20
- //uInstr1 (cb, DEC, 4, TempReg, tc);
- //uInstr2 (cb, PUT, 4, TempReg, tc, ArchReg, R_ECX);
putIReg(4, R_ECX, binop(Iop_Sub32, mkexpr(tc), mkU32(1)) );
=20
dis_string_op_increment(sz, t_inc);
@@ -11325,10 +11276,10 @@
dis_string_op( dis_STOS, ( opc =3D=3D 0xAA ? 1 : sz ), "stos", sor=
b );
break;
=20
-//-- case 0xAC: /* LODS, no REP prefix */
-//-- case 0xAD:
-//-- dis_string_op( cb, dis_LODS, ( opc =3D=3D 0xAC ? 1 : sz ), "l=
ods", sorb );
-//-- break;
+ case 0xAC: /* LODS, no REP prefix */
+ case 0xAD:
+ dis_string_op( dis_LODS, ( opc =3D=3D 0xAC ? 1 : sz ), "lods", sor=
b );
+ break;
=20
case 0xAE: /* SCAS, no REP prefix */
case 0xAF:
|
|
From: Julian S. <js...@ac...> - 2005-05-30 08:09:54
|
Robert Interesting patch. I was wondering if you can simply use the --max-stackframe flag in the 3 line to get the same result .. > if delta %esp > some value, then assume a thread change This allows you to set 'some value' on the command line. Furthermore if you don't do that it will tell you plausible values to try anyway. Could you try out --max-stackframe to see if it is good enough? J |
|
From: Julian S. <js...@ac...> - 2005-05-30 07:26:34
|
Hi. This is an interesting one. First off, I can reproduce this using zlib-1.2.2 and the test program posted at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270070, using current Valgrind 3 sources, on x86. I'm reluctant to add these suppressions without understanding what's going in on detail. A lot of thought and effort went into making Valgrind (Memcheck) have a low false-positive rate, and if this shows up a flaw in Memcheck's instrumentation scheme I want to know what it is. In http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270070 Mark writes: > I went through that in detail about a year or two ago and concluded > that it was not a problem, and furthermore could not even cause > indeterminism in the result of deflating. It was intentional in the > design to improve speed. Mark, could you explain how the use of uninitialised values from memory is made safe here? I'm looking at this do { } while (*++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && scan < strend); and it's not clear how scan can be moved forward some indeterminate amount based on garbage in memory and yet the deflate result is well-defined. As background: Memcheck does occasionally generate false errors. These have been looked into quite extensively, and as far as I know always revolve around getting the x86 %eflags register into a partially defined state at high levels of optimisation. This one seems different -- removing -O3/2/1 from the compile flags does not make the report go away. An ideal outcome is that Mark explains how this behaviour is safe in zlib. I can then look at Memcheck's instrumentation phase to determine if/how it is possible to avoid these reports. J On Thursday 26 May 2005 14:07, Tilman Sauerbeck wrote: > Hi, > I suggest to add the following two suppressions to the default set: > > { > bogus warning in zlib > Memcheck:Cond > obj:/usr/lib/libz.so.1.2.2 > obj:/usr/lib/libz.so.1.2.2 > fun:deflate > fun:compress2 > } > { > bogus warning in zlib > Memcheck:Cond > obj:/usr/lib/libz.so.1.2.2 > obj:/usr/lib/libz.so.1.2.2 > fun:deflate > fun:compress2 > } > > According to Mark Adler, that bug is safe and it probably won't be > fixed: > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=270070 > > Regards, > Tilman |
|
From: Robert W. <rj...@du...> - 2005-05-30 07:08:18
|
Hi all, I've put a new patch on my web site against the 2.4 tree: http://www.durables.org/~rjwalsh/software/valgrind The patch allows user-land thread packages (e.g. coroutines) to deal with stack changes gracefully. Currently, Valgrind notices when %esp changes and uses a heuristic to figure out if that possibly means a thread change, or just that something large was pushed onto the stack. It often gets it wrong, since the heuristic is basically: if delta %esp > some value, then assume a thread change The problem is, it's hard to know what a good "some value" is since it depends a lot of how your program is written. The change I've made allows you to register a memory range as a stack with Valgrind. Valgrind spots when %esp changes and checks if it's changed to a different registered stack. If it has, then it assumes a thread change. Usage: * id =3D VALGRIND_STACK_NEW(start, end) registers the memory between start and end as a new stack and returns an id you can use for the other client requests described below. This doesn't allocate memory or anything - it just records that a particular memory range is a stack. * VALGRIND_STACK_DELETE(id) removes the stack association for stack "id". This doesn't free memory or anything - it just tells Valgrind that the piece of memory register earlier is no longer a stack. * VALGRIND_STACK_CHANGE(id, start, end) changes the stack "id" to a new start-end range. Useful if you're implementing stack growth in user-land, too. See the stack_changes.c file in corecheck/tests for an example. Some points: * This is currently only against the 2.4 tree. I'll port it to 3.0 in the next day or so. * I haven't measured this for performance impact yet. * I haven't tested VALGRIND_STACK_DELETE at all. * I've only tested VALGRIND_STACK_CHANGE for the default process stack, not for anything registered by the user. * Right now, it falls back to the old algorithm if the new one doesn't indicate a stack change. Probably this should just go away. * It could probably be made a bit more efficient by using an interval skip-list to store the registered stack data instead of a simple linked-list. After I see the performance impact, I'll decide about this. If you have any thoughts, let me know. If there's going to be another 2.4 release, this might be useful to include. Regards, Robert. --=20 Robert Walsh Amalgamated Durables, Inc. - "We don't make the things you buy." Email: rj...@du... |
|
From: <sv...@va...> - 2005-05-30 03:12:16
|
Author: njn
Date: 2005-05-30 04:12:09 +0100 (Mon, 30 May 2005)
New Revision: 3815
Modified:
trunk/coregrind/m_syscalls/syscalls.c
Log:
Unbreak AMD64 compilation.
Modified: trunk/coregrind/m_syscalls/syscalls.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_syscalls/syscalls.c 2005-05-29 23:30:48 UTC (rev 38=
14)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-05-30 03:12:09 UTC (rev 38=
15)
@@ -4483,7 +4483,7 @@
#if defined(VGP_x86_linux)
// do nothing
#else
- vg_assert(0, "old_mmap should only be called on x86/Linux");
+ vg_assert2(0, "old_mmap should only be called on x86/Linux");
#endif
=20
UWord a1, a2, a3, a4, a5, a6;
|
|
From: <js...@ac...> - 2005-05-30 02:50:07
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-05-30 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow Nightly build on phoenix ( SuSE 9.1 ) started at 2005-05-30 03:50:00 BST |
|
From: Tom H. <to...@co...> - 2005-05-30 02:36:20
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-05-30 03:30:03 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 176 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/execve (stderr) memcheck/tests/execve2 (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-30 02:30:43
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-05-30 03:25:03 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 175 tests, 4 stderr failures, 0 stdout failures ================= memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-05-30 02:20:44
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-05-30 03:15:03 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 174 tests, 13 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-05-30 02:11:22
|
Nightly build on dellow ( x86_64, Fedora Core 3 ) started at 2005-05-30 03:10:03 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... failed Last 20 lines of log.verbose follow ranlib libsigframe.a make[3]: Leaving directory `/tmp/valgrind.27050/valgrind/coregrind/m_sigframe' Making all in m_syscalls make[3]: Entering directory `/tmp/valgrind.27050/valgrind/coregrind/m_syscalls' gcc -I../../coregrind -I../.. -I../../coregrind/amd64 -I../../coregrind/linux -I../../coregrind/amd64-linux -I../../include -I/tmp/valgrind.27050/vex/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -m64 -Wa,-gstabs -Wno-long-long -c syscall-amd64-linux.S if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../coregrind -I../.. -I../../coregrind/amd64 -I../../coregrind/linux -I../../coregrind/amd64-linux -I../../include -I/tmp/valgrind.27050/vex/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -fpie -m64 -fomit-frame-pointer -DELFSZ=64 -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -Wno-long-long -MT syscalls.o -MD -MP -MF ".deps/syscalls.Tpo" -c -o syscalls.o syscalls.c; \ then mv -f ".deps/syscalls.Tpo" ".deps/syscalls.Po"; else rm -f ".deps/syscalls.Tpo"; exit 1; fi syscalls.c:4486:62: macro "vg_assert" passed 2 arguments, but takes just 1 syscalls.c: In function `vgArch_gen_old_mmap_before': syscalls.c:4486: error: `vg_assert' undeclared (first use in this function) syscalls.c:4486: error: (Each undeclared identifier is reported only once syscalls.c:4486: error: for each function it appears in.) syscalls.c:4536: warning: cast from pointer to integer of different size make[3]: *** [syscalls.o] Error 1 make[3]: Leaving directory `/tmp/valgrind.27050/valgrind/coregrind/m_syscalls' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.27050/valgrind/coregrind' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.27050/valgrind' make: *** [all] Error 2 |
|
From: Robert W. <rj...@du...> - 2005-05-30 02:03:54
|
SVN commit 419608 by rjwalsh: Update the ignore stuff so svn status doesn't complain so much. _M trunk/valgrind (directory) =20 _M addrcheck (directory) =20 _M auxprogs (directory) =20 _M cachegrind (directory) =20 _M cachegrind/tests (directory) =20 _M cachegrind/x86 (directory) =20 _M corecheck (directory) =20 _M corecheck/tests (directory) =20 _M coregrind (directory) =20 _M coregrind/demangle (directory) =20 _M coregrind/linux (directory) =20 _M coregrind/x86 (directory) =20 _M coregrind/x86-linux (directory) =20 _M helgrind (directory) =20 _M helgrind/tests (directory) =20 _M include (directory) =20 _M lackey (directory) =20 _M massif (directory) =20 _M massif/hp2ps (directory) =20 _M memcheck (directory) =20 _M memcheck/tests (directory) =20 _M memcheck/tests/x86 (directory) =20 _M none (directory) =20 _M none/tests (directory) =20 _M none/tests/x86 (directory) =20 _M tests (directory) =20 |
|
From: Tom H. <th...@cy...> - 2005-05-30 02:01:42
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-05-30 03:00:03 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... failed Last 20 lines of log.verbose follow ranlib libsigframe.a make[3]: Leaving directory `/tmp/valgrind.24082/valgrind/coregrind/m_sigframe' Making all in m_syscalls make[3]: Entering directory `/tmp/valgrind.24082/valgrind/coregrind/m_syscalls' gcc -I../../coregrind -I../.. -I../../coregrind/amd64 -I../../coregrind/linux -I../../coregrind/amd64-linux -I../../include -I/tmp/valgrind.24082/vex/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -m64 -Wa,-gstabs -Wno-long-long -c syscall-amd64-linux.S if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../coregrind -I../.. -I../../coregrind/amd64 -I../../coregrind/linux -I../../coregrind/amd64-linux -I../../include -I/tmp/valgrind.24082/vex/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -fpie -m64 -fomit-frame-pointer -DELFSZ=64 -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -Wno-long-long -MT syscalls.o -MD -MP -MF ".deps/syscalls.Tpo" -c -o syscalls.o syscalls.c; \ then mv -f ".deps/syscalls.Tpo" ".deps/syscalls.Po"; else rm -f ".deps/syscalls.Tpo"; exit 1; fi syscalls.c:4486:62: macro "vg_assert" passed 2 arguments, but takes just 1 syscalls.c: In function `vgArch_gen_old_mmap_before': syscalls.c:4486: error: `vg_assert' undeclared (first use in this function) syscalls.c:4486: error: (Each undeclared identifier is reported only once syscalls.c:4486: error: for each function it appears in.) syscalls.c:4536: warning: cast from pointer to integer of different size make[3]: *** [syscalls.o] Error 1 make[3]: Leaving directory `/tmp/valgrind.24082/valgrind/coregrind/m_syscalls' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.24082/valgrind/coregrind' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.24082/valgrind' make: *** [all] Error 2 |
|
From: <sv...@va...> - 2005-05-29 23:30:53
|
Author: njn
Date: 2005-05-30 00:30:48 +0100 (Mon, 30 May 2005)
New Revision: 3814
Added:
trunk/coregrind/vki_unistd-amd64-linux.h
trunk/coregrind/vki_unistd-arm-linux.h
trunk/coregrind/vki_unistd-x86-linux.h
trunk/coregrind/vki_unistd.h
Removed:
trunk/coregrind/amd64-linux/
trunk/coregrind/arm-linux/
trunk/coregrind/x86-linux/
Modified:
trunk/configure.in
trunk/coregrind/Makefile.am
trunk/memcheck/tests/x86/scalar.h
Log:
Renamed the $PLATFORM/vki_unistd.h files as vki_unistd-$PLATFORM.h, to
match the headers files in include/.
As a consequence, coregrind/$PLATFORM directories are no longer needed,
hooray!
Modified: trunk/configure.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/configure.in 2005-05-29 18:46:38 UTC (rev 3813)
+++ trunk/configure.in 2005-05-29 23:30:48 UTC (rev 3814)
@@ -397,9 +397,6 @@
coregrind/arm/Makefile
coregrind/x86/Makefile
coregrind/linux/Makefile
- coregrind/amd64-linux/Makefile
- coregrind/arm-linux/Makefile
- coregrind/x86-linux/Makefile
addrcheck/Makefile
addrcheck/tests/Makefile
addrcheck/docs/Makefile
Modified: trunk/coregrind/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/Makefile.am 2005-05-29 18:46:38 UTC (rev 3813)
+++ trunk/coregrind/Makefile.am 2005-05-29 23:30:48 UTC (rev 3814)
@@ -13,11 +13,11 @@
## But when doing 'make dist', we are interested in every arch/OS/platfo=
rm.
## That's what DIST_SUBDIRS specifies.
SUBDIRS =3D \
- $(VG_ARCH) $(VG_OS) $(VG_PLATFORM) \
+ $(VG_ARCH) $(VG_OS) \
$(MODULES) .
=20
DIST_SUBDIRS =3D \
- $(VG_ARCH_ALL) $(VG_OS_ALL) $(VG_PLATFORM_ALL) \
+ $(VG_ARCH_ALL) $(VG_OS_ALL) \
$(MODULES) .
=20
AM_CPPFLAGS +=3D -DVG_LIBDIR=3D"\"$(valdir)"\" \
@@ -57,7 +57,11 @@
pub_core_transtab_asm.h \
ume.h \
vg_symtab2.h \
- vg_symtypes.h
+ vg_symtypes.h \
+ vki_unistd.h \
+ vki_unistd-amd64-linux.h\
+ vki_unistd-arm-linux.h \
+ vki_unistd-x86-linux.h
=20
EXTRA_DIST =3D \
valgrind.vs \
Copied: trunk/coregrind/vki_unistd-amd64-linux.h (from rev 3807, trunk/co=
regrind/amd64-linux/vki_unistd.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/amd64-linux/vki_unistd.h 2005-05-29 16:23:17 UTC (rev=
3807)
+++ trunk/coregrind/vki_unistd-amd64-linux.h 2005-05-29 23:30:48 UTC (rev=
3814)
@@ -0,0 +1,329 @@
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __VKI_UNISTD_AMD64_LINUX_H
+#define __VKI_UNISTD_AMD64_LINUX_H
+
+// From linux-2.6.9/include/asm-x86_64/unistd.h
+
+#define __NR_read 0
+#define __NR_write 1
+#define __NR_open 2
+#define __NR_close 3
+#define __NR_stat 4
+#define __NR_fstat 5
+#define __NR_lstat 6
+#define __NR_poll 7
+
+#define __NR_lseek 8
+#define __NR_mmap 9
+#define __NR_mprotect 10
+#define __NR_munmap 11
+#define __NR_brk 12
+#define __NR_rt_sigaction 13
+#define __NR_rt_sigprocmask 14
+#define __NR_rt_sigreturn 15
+
+#define __NR_ioctl 16
+#define __NR_pread64 17
+#define __NR_pwrite64 18
+#define __NR_readv 19
+#define __NR_writev 20
+#define __NR_access 21
+#define __NR_pipe 22
+#define __NR_select 23
+
+#define __NR_sched_yield 24
+#define __NR_mremap 25
+#define __NR_msync 26
+#define __NR_mincore 27
+#define __NR_madvise 28
+#define __NR_shmget 29
+#define __NR_shmat 30
+#define __NR_shmctl 31
+
+#define __NR_dup 32
+#define __NR_dup2 33
+#define __NR_pause 34
+#define __NR_nanosleep 35
+#define __NR_getitimer 36
+#define __NR_alarm 37
+#define __NR_setitimer 38
+#define __NR_getpid 39
+
+#define __NR_sendfile 40
+#define __NR_socket 41
+#define __NR_connect 42
+#define __NR_accept 43
+#define __NR_sendto 44
+#define __NR_recvfrom 45
+#define __NR_sendmsg 46
+#define __NR_recvmsg 47
+
+#define __NR_shutdown 48
+#define __NR_bind 49
+#define __NR_listen 50
+#define __NR_getsockname 51
+#define __NR_getpeername 52
+#define __NR_socketpair 53
+#define __NR_setsockopt 54
+#define __NR_getsockopt 55
+
+#define __NR_clone 56
+#define __NR_fork 57
+#define __NR_vfork 58
+#define __NR_execve 59
+#define __NR_exit 60
+#define __NR_wait4 61
+#define __NR_kill 62
+#define __NR_uname 63
+
+#define __NR_semget 64
+#define __NR_semop 65
+#define __NR_semctl 66
+#define __NR_shmdt 67
+#define __NR_msgget 68
+#define __NR_msgsnd 69
+#define __NR_msgrcv 70
+#define __NR_msgctl 71
+
+#define __NR_fcntl 72
+#define __NR_flock 73
+#define __NR_fsync 74
+#define __NR_fdatasync 75
+#define __NR_truncate 76
+#define __NR_ftruncate 77
+#define __NR_getdents 78
+#define __NR_getcwd 79
+
+#define __NR_chdir 80
+#define __NR_fchdir 81
+#define __NR_rename 82
+#define __NR_mkdir 83
+#define __NR_rmdir 84
+#define __NR_creat 85
+#define __NR_link 86
+#define __NR_unlink 87
+
+#define __NR_symlink 88
+#define __NR_readlink 89
+#define __NR_chmod 90
+#define __NR_fchmod 91
+#define __NR_chown 92
+#define __NR_fchown 93
+#define __NR_lchown 94
+#define __NR_umask 95
+
+#define __NR_gettimeofday 96
+#define __NR_getrlimit 97
+#define __NR_getrusage 98
+#define __NR_sysinfo 99
+#define __NR_times 100
+#define __NR_ptrace 101
+#define __NR_getuid 102
+#define __NR_syslog 103
+
+/* at the very end the stuff that never runs during the benchmarks */
+#define __NR_getgid 104
+#define __NR_setuid 105
+#define __NR_setgid 106
+#define __NR_geteuid 107
+#define __NR_getegid 108
+#define __NR_setpgid 109
+#define __NR_getppid 110
+#define __NR_getpgrp 111
+
+#define __NR_setsid 112
+#define __NR_setreuid 113
+#define __NR_setregid 114
+#define __NR_getgroups 115
+#define __NR_setgroups 116
+#define __NR_setresuid 117
+#define __NR_getresuid 118
+#define __NR_setresgid 119
+
+#define __NR_getresgid 120
+#define __NR_getpgid 121
+#define __NR_setfsuid 122
+#define __NR_setfsgid 123
+#define __NR_getsid 124
+#define __NR_capget 125
+#define __NR_capset 126
+
+#define __NR_rt_sigpending 127
+#define __NR_rt_sigtimedwait 128
+#define __NR_rt_sigqueueinfo 129
+#define __NR_rt_sigsuspend 130
+#define __NR_sigaltstack 131
+#define __NR_utime 132
+#define __NR_mknod 133
+
+#define __NR_uselib 134
+#define __NR_personality 135
+
+#define __NR_ustat 136
+#define __NR_statfs 137
+#define __NR_fstatfs 138
+#define __NR_sysfs 139
+
+#define __NR_getpriority 140
+#define __NR_setpriority 141
+#define __NR_sched_setparam 142
+#define __NR_sched_getparam 143
+#define __NR_sched_setscheduler 144
+#define __NR_sched_getscheduler 145
+#define __NR_sched_get_priority_max 146
+#define __NR_sched_get_priority_min 147
+#define __NR_sched_rr_get_interval 148
+
+#define __NR_mlock 149
+#define __NR_munlock 150
+#define __NR_mlockall 151
+#define __NR_munlockall 152
+
+#define __NR_vhangup 153
+
+#define __NR_modify_ldt 154
+
+#define __NR_pivot_root 155
+
+#define __NR__sysctl 156
+
+#define __NR_prctl 157
+#define __NR_arch_prctl 158
+
+#define __NR_adjtimex 159
+
+#define __NR_setrlimit 160
+
+#define __NR_chroot 161
+
+#define __NR_sync 162
+
+#define __NR_acct 163
+
+#define __NR_settimeofday 164
+
+#define __NR_mount 165
+#define __NR_umount2 166
+
+#define __NR_swapon 167
+#define __NR_swapoff 168
+
+#define __NR_reboot 169
+
+#define __NR_sethostname 170
+#define __NR_setdomainname 171
+
+#define __NR_iopl 172
+#define __NR_ioperm 173
+
+#define __NR_create_module 174
+#define __NR_init_module 175
+#define __NR_delete_module 176
+#define __NR_get_kernel_syms 177
+#define __NR_query_module 178
+
+#define __NR_quotactl 179
+
+#define __NR_nfsservctl 180
+
+#define __NR_getpmsg 181 /* reserved for LiS/S=
TREAMS */
+#define __NR_putpmsg 182 /* reserved for LiS/S=
TREAMS */
+
+#define __NR_afs_syscall 183 /* reserved for AFS *=
/=20
+
+#define __NR_tuxcall 184 /* reserved for tux */
+
+#define __NR_security 185
+
+#define __NR_gettid 186
+
+#define __NR_readahead 187
+#define __NR_setxattr 188
+#define __NR_lsetxattr 189
+#define __NR_fsetxattr 190
+#define __NR_getxattr 191
+#define __NR_lgetxattr 192
+#define __NR_fgetxattr 193
+#define __NR_listxattr 194
+#define __NR_llistxattr 195
+#define __NR_flistxattr 196
+#define __NR_removexattr 197
+#define __NR_lremovexattr 198
+#define __NR_fremovexattr 199
+#define __NR_tkill 200
+#define __NR_time 201
+#define __NR_futex 202
+#define __NR_sched_setaffinity 203
+#define __NR_sched_getaffinity 204
+#define __NR_set_thread_area 205
+#define __NR_io_setup 206
+#define __NR_io_destroy 207
+#define __NR_io_getevents 208
+#define __NR_io_submit 209
+#define __NR_io_cancel 210
+#define __NR_get_thread_area 211
+#define __NR_lookup_dcookie 212
+#define __NR_epoll_create 213
+#define __NR_epoll_ctl_old 214
+#define __NR_epoll_wait_old 215
+#define __NR_remap_file_pages 216
+#define __NR_getdents64 217
+#define __NR_set_tid_address 218
+#define __NR_restart_syscall 219
+#define __NR_semtimedop 220
+#define __NR_fadvise64 221
+#define __NR_timer_create 222
+#define __NR_timer_settime 223
+#define __NR_timer_gettime 224
+#define __NR_timer_getoverrun 225
+#define __NR_timer_delete 226
+#define __NR_clock_settime 227
+#define __NR_clock_gettime 228
+#define __NR_clock_getres 229
+#define __NR_clock_nanosleep 230
+#define __NR_exit_group 231
+#define __NR_epoll_wait 232
+#define __NR_epoll_ctl 233
+#define __NR_tgkill 234
+#define __NR_utimes 235
+#define __NR_vserver 236
+#define __NR_vserver 236
+#define __NR_mbind 237
+#define __NR_set_mempolicy 238
+#define __NR_get_mempolicy 239
+#define __NR_mq_open 240
+#define __NR_mq_unlink 241
+#define __NR_mq_timedsend 242
+#define __NR_mq_timedreceive 243
+#define __NR_mq_notify 244
+#define __NR_mq_getsetattr 245
+#define __NR_kexec_load 246
+#define __NR_waitid 247
+
+
+#endif /* __VKI_UNISTD_AMD64_LINUX_H */
Copied: trunk/coregrind/vki_unistd-arm-linux.h (from rev 3807, trunk/core=
grind/arm-linux/vki_unistd.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/arm-linux/vki_unistd.h 2005-05-29 16:23:17 UTC (rev 3=
807)
+++ trunk/coregrind/vki_unistd-arm-linux.h 2005-05-29 23:30:48 UTC (rev 3=
814)
@@ -0,0 +1,311 @@
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __VKI_UNISTD_ARM_LINUX_H
+#define __VKI_UNISTD_ARM_LINUX_H
+
+// From linux-2.6.8.1/include/asm-arm/unistd.h
+
+// Nb: ARM Thumb has a different __NR_SYSCALL_BASE, but we don't care ab=
out
+// that architecture.
+#define __NR_SYSCALL_BASE 0x900000
+
+#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
+#define __NR_exit (__NR_SYSCALL_BASE+ 1)
+#define __NR_fork (__NR_SYSCALL_BASE+ 2)
+#define __NR_read (__NR_SYSCALL_BASE+ 3)
+#define __NR_write (__NR_SYSCALL_BASE+ 4)
+#define __NR_open (__NR_SYSCALL_BASE+ 5)
+#define __NR_close (__NR_SYSCALL_BASE+ 6)
+ /* 7 was sys_waitpid */
+#define __NR_creat (__NR_SYSCALL_BASE+ 8)
+#define __NR_link (__NR_SYSCALL_BASE+ 9)
+#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
+#define __NR_execve (__NR_SYSCALL_BASE+ 11)
+#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
+#define __NR_time (__NR_SYSCALL_BASE+ 13)
+#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
+#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
+#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
+ /* 17 was sys_break */
+ /* 18 was sys_stat */
+#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
+#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
+#define __NR_mount (__NR_SYSCALL_BASE+ 21)
+#define __NR_umount (__NR_SYSCALL_BASE+ 22)
+#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
+#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
+#define __NR_stime (__NR_SYSCALL_BASE+ 25)
+#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
+#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
+ /* 28 was sys_fstat */
+#define __NR_pause (__NR_SYSCALL_BASE+ 29)
+#define __NR_utime (__NR_SYSCALL_BASE+ 30)
+ /* 31 was sys_stty */
+ /* 32 was sys_gtty */
+#define __NR_access (__NR_SYSCALL_BASE+ 33)
+#define __NR_nice (__NR_SYSCALL_BASE+ 34)
+ /* 35 was sys_ftime */
+#define __NR_sync (__NR_SYSCALL_BASE+ 36)
+#define __NR_kill (__NR_SYSCALL_BASE+ 37)
+#define __NR_rename (__NR_SYSCALL_BASE+ 38)
+#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
+#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
+#define __NR_dup (__NR_SYSCALL_BASE+ 41)
+#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
+#define __NR_times (__NR_SYSCALL_BASE+ 43)
+ /* 44 was sys_prof */
+#define __NR_brk (__NR_SYSCALL_BASE+ 45)
+#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
+#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
+ /* 48 was sys_signal */
+#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
+#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
+#define __NR_acct (__NR_SYSCALL_BASE+ 51)
+#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
+ /* 53 was sys_lock */
+#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
+#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
+ /* 56 was sys_mpx */
+#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
+ /* 58 was sys_ulimit */
+ /* 59 was sys_olduname */
+#define __NR_umask (__NR_SYSCALL_BASE+ 60)
+#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
+#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
+#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
+#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
+#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
+#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
+#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
+ /* 68 was sys_sgetmask */
+ /* 69 was sys_ssetmask */
+#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
+#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
+#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
+#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
+#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
+#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
+#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76) /* Back compat 2GB limi=
ted rlimit */
+#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
+#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
+#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
+#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
+#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
+#define __NR_select (__NR_SYSCALL_BASE+ 82)
+#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
+ /* 84 was sys_lstat */
+#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
+#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
+#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
+#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
+#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
+#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
+#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
+#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
+#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
+#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
+#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
+#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
+#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
+ /* 98 was sys_profil */
+#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
+#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
+ /* 101 was sys_ioperm */
+#define __NR_socketcall (__NR_SYSCALL_BASE+102)
+#define __NR_syslog (__NR_SYSCALL_BASE+103)
+#define __NR_setitimer (__NR_SYSCALL_BASE+104)
+#define __NR_getitimer (__NR_SYSCALL_BASE+105)
+#define __NR_stat (__NR_SYSCALL_BASE+106)
+#define __NR_lstat (__NR_SYSCALL_BASE+107)
+#define __NR_fstat (__NR_SYSCALL_BASE+108)
+ /* 109 was sys_uname */
+ /* 110 was sys_iopl */
+#define __NR_vhangup (__NR_SYSCALL_BASE+111)
+ /* 112 was sys_idle */
+#define __NR_syscall (__NR_SYSCALL_BASE+113) /* syscall to call a sysc=
all! */
+#define __NR_wait4 (__NR_SYSCALL_BASE+114)
+#define __NR_swapoff (__NR_SYSCALL_BASE+115)
+#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
+#define __NR_ipc (__NR_SYSCALL_BASE+117)
+#define __NR_fsync (__NR_SYSCALL_BASE+118)
+#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
+#define __NR_clone (__NR_SYSCALL_BASE+120)
+#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
+#define __NR_uname (__NR_SYSCALL_BASE+122)
+ /* 123 was sys_modify_ldt */
+#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
+#define __NR_mprotect (__NR_SYSCALL_BASE+125)
+#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
+ /* 127 was sys_create_module */
+#define __NR_init_module (__NR_SYSCALL_BASE+128)
+#define __NR_delete_module (__NR_SYSCALL_BASE+129)
+ /* 130 was sys_get_kernel_syms */
+#define __NR_quotactl (__NR_SYSCALL_BASE+131)
+#define __NR_getpgid (__NR_SYSCALL_BASE+132)
+#define __NR_fchdir (__NR_SYSCALL_BASE+133)
+#define __NR_bdflush (__NR_SYSCALL_BASE+134)
+#define __NR_sysfs (__NR_SYSCALL_BASE+135)
+#define __NR_personality (__NR_SYSCALL_BASE+136)
+ /* 137 was sys_afs_syscall */
+#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
+#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
+#define __NR__llseek (__NR_SYSCALL_BASE+140)
+#define __NR_getdents (__NR_SYSCALL_BASE+141)
+#define __NR__newselect (__NR_SYSCALL_BASE+142)
+#define __NR_flock (__NR_SYSCALL_BASE+143)
+#define __NR_msync (__NR_SYSCALL_BASE+144)
+#define __NR_readv (__NR_SYSCALL_BASE+145)
+#define __NR_writev (__NR_SYSCALL_BASE+146)
+#define __NR_getsid (__NR_SYSCALL_BASE+147)
+#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
+#define __NR__sysctl (__NR_SYSCALL_BASE+149)
+#define __NR_mlock (__NR_SYSCALL_BASE+150)
+#define __NR_munlock (__NR_SYSCALL_BASE+151)
+#define __NR_mlockall (__NR_SYSCALL_BASE+152)
+#define __NR_munlockall (__NR_SYSCALL_BASE+153)
+#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
+#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
+#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
+#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
+#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
+#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
+#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
+#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
+#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
+#define __NR_mremap (__NR_SYSCALL_BASE+163)
+#define __NR_setresuid (__NR_SYSCALL_BASE+164)
+#define __NR_getresuid (__NR_SYSCALL_BASE+165)
+ /* 166 was sys_vm86 */
+ /* 167 was sys_query_module */
+#define __NR_poll (__NR_SYSCALL_BASE+168)
+#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
+#define __NR_setresgid (__NR_SYSCALL_BASE+170)
+#define __NR_getresgid (__NR_SYSCALL_BASE+171)
+#define __NR_prctl (__NR_SYSCALL_BASE+172)
+#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
+#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
+#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
+#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
+#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
+#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
+#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
+#define __NR_pread64 (__NR_SYSCALL_BASE+180)
+#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
+#define __NR_chown (__NR_SYSCALL_BASE+182)
+#define __NR_getcwd (__NR_SYSCALL_BASE+183)
+#define __NR_capget (__NR_SYSCALL_BASE+184)
+#define __NR_capset (__NR_SYSCALL_BASE+185)
+#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
+#define __NR_sendfile (__NR_SYSCALL_BASE+187)
+ /* 188 reserved */
+ /* 189 reserved */
+#define __NR_vfork (__NR_SYSCALL_BASE+190)
+#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191) /* SuS compliant getrl=
imit */
+#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
+#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
+#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
+#define __NR_stat64 (__NR_SYSCALL_BASE+195)
+#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
+#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
+#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
+#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
+#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
+#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
+#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
+#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
+#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
+#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
+#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
+#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
+#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
+#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
+#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
+#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
+#define __NR_chown32 (__NR_SYSCALL_BASE+212)
+#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
+#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
+#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
+#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
+#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
+#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
+#define __NR_mincore (__NR_SYSCALL_BASE+219)
+#define __NR_madvise (__NR_SYSCALL_BASE+220)
+#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
+ /* 222 for tux */
+ /* 223 is unused */
+#define __NR_gettid (__NR_SYSCALL_BASE+224)
+#define __NR_readahead (__NR_SYSCALL_BASE+225)
+#define __NR_setxattr (__NR_SYSCALL_BASE+226)
+#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
+#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
+#define __NR_getxattr (__NR_SYSCALL_BASE+229)
+#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
+#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
+#define __NR_listxattr (__NR_SYSCALL_BASE+232)
+#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
+#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
+#define __NR_removexattr (__NR_SYSCALL_BASE+235)
+#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
+#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
+#define __NR_tkill (__NR_SYSCALL_BASE+238)
+#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
+#define __NR_futex (__NR_SYSCALL_BASE+240)
+#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
+#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
+#define __NR_io_setup (__NR_SYSCALL_BASE+243)
+#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
+#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
+#define __NR_io_submit (__NR_SYSCALL_BASE+246)
+#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
+#define __NR_exit_group (__NR_SYSCALL_BASE+248)
+#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
+#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
+#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
+#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
+#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
+ /* 254 for set_thread_area */
+ /* 255 for get_thread_area */
+ /* 256 for set_tid_address */
+#define __NR_timer_create (__NR_SYSCALL_BASE+257)
+#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
+#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
+#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
+#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
+#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
+#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
+#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
+#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
+#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
+#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
+#define __NR_tgkill (__NR_SYSCALL_BASE+268)
+#define __NR_utimes (__NR_SYSCALL_BASE+269)
+#define __NR_fadvise64_64 (__NR_SYSCALL_BASE+270)
+#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
+#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
+#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
+
+#endif /* __VKI_UNISTD_ARM_LINUX_H */
Copied: trunk/coregrind/vki_unistd-x86-linux.h (from rev 3807, trunk/core=
grind/x86-linux/vki_unistd.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/x86-linux/vki_unistd.h 2005-05-29 16:23:17 UTC (rev 3=
807)
+++ trunk/coregrind/vki_unistd-x86-linux.h 2005-05-29 23:30:48 UTC (rev 3=
814)
@@ -0,0 +1,318 @@
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __VKI_UNISTD_X86_LINUX_H
+#define __VKI_UNISTD_X86_LINUX_H
+
+// From linux-2.6.9/include/asm-i386/unistd.h
+
+#define __NR_restart_syscall 0
+#define __NR_exit 1
+#define __NR_fork 2
+#define __NR_read 3
+#define __NR_write 4
+#define __NR_open 5
+#define __NR_close 6
+#define __NR_waitpid 7
+#define __NR_creat 8
+#define __NR_link 9
+#define __NR_unlink 10
+#define __NR_execve 11
+#define __NR_chdir 12
+#define __NR_time 13
+#define __NR_mknod 14
+#define __NR_chmod 15
+#define __NR_lchown 16
+#define __NR_break 17
+#define __NR_oldstat 18
+#define __NR_lseek 19
+#define __NR_getpid 20
+#define __NR_mount 21
+#define __NR_umount 22
+#define __NR_setuid 23
+#define __NR_getuid 24
+#define __NR_stime 25
+#define __NR_ptrace 26
+#define __NR_alarm 27
+#define __NR_oldfstat 28
+#define __NR_pause 29
+#define __NR_utime 30
+#define __NR_stty 31
+#define __NR_gtty 32
+#define __NR_access 33
+#define __NR_nice 34
+#define __NR_ftime 35
+#define __NR_sync 36
+#define __NR_kill 37
+#define __NR_rename 38
+#define __NR_mkdir 39
+#define __NR_rmdir 40
+#define __NR_dup 41
+#define __NR_pipe 42
+#define __NR_times 43
+#define __NR_prof 44
+#define __NR_brk 45
+#define __NR_setgid 46
+#define __NR_getgid 47
+#define __NR_signal 48
+#define __NR_geteuid 49
+#define __NR_getegid 50
+#define __NR_acct 51
+#define __NR_umount2 52
+#define __NR_lock 53
+#define __NR_ioctl 54
+#define __NR_fcntl 55
+#define __NR_mpx 56
+#define __NR_setpgid 57
+#define __NR_ulimit 58
+#define __NR_oldolduname 59
+#define __NR_umask 60
+#define __NR_chroot 61
+#define __NR_ustat 62
+#define __NR_dup2 63
+#define __NR_getppid 64
+#define __NR_getpgrp 65
+#define __NR_setsid 66
+#define __NR_sigaction 67
+#define __NR_sgetmask 68
+#define __NR_ssetmask 69
+#define __NR_setreuid 70
+#define __NR_setregid 71
+#define __NR_sigsuspend 72
+#define __NR_sigpending 73
+#define __NR_sethostname 74
+#define __NR_setrlimit 75
+#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
+#define __NR_getrusage 77
+#define __NR_gettimeofday 78
+#define __NR_settimeofday 79
+#define __NR_getgroups 80
+#define __NR_setgroups 81
+#define __NR_select 82
+#define __NR_symlink 83
+#define __NR_oldlstat 84
+#define __NR_readlink 85
+#define __NR_uselib 86
+#define __NR_swapon 87
+#define __NR_reboot 88
+#define __NR_readdir 89
+#define __NR_mmap 90
+#define __NR_munmap 91
+#define __NR_truncate 92
+#define __NR_ftruncate 93
+#define __NR_fchmod 94
+#define __NR_fchown 95
+#define __NR_getpriority 96
+#define __NR_setpriority 97
+#define __NR_profil 98
+#define __NR_statfs 99
+#define __NR_fstatfs 100
+#define __NR_ioperm 101
+#define __NR_socketcall 102
+#define __NR_syslog 103
+#define __NR_setitimer 104
+#define __NR_getitimer 105
+#define __NR_stat 106
+#define __NR_lstat 107
+#define __NR_fstat 108
+#define __NR_olduname 109
+#define __NR_iopl 110
+#define __NR_vhangup 111
+#define __NR_idle 112
+#define __NR_vm86old 113
+#define __NR_wait4 114
+#define __NR_swapoff 115
+#define __NR_sysinfo 116
+#define __NR_ipc 117
+#define __NR_fsync 118
+#define __NR_sigreturn 119
+#define __NR_clone 120
+#define __NR_setdomainname 121
+#define __NR_uname 122
+#define __NR_modify_ldt 123
+#define __NR_adjtimex 124
+#define __NR_mprotect 125
+#define __NR_sigprocmask 126
+#define __NR_create_module 127
+#define __NR_init_module 128
+#define __NR_delete_module 129
+#define __NR_get_kernel_syms 130
+#define __NR_quotactl 131
+#define __NR_getpgid 132
+#define __NR_fchdir 133
+#define __NR_bdflush 134
+#define __NR_sysfs 135
+#define __NR_personality 136
+#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
+#define __NR_setfsuid 138
+#define __NR_setfsgid 139
+#define __NR__llseek 140
+#define __NR_getdents 141
+#define __NR__newselect 142
+#define __NR_flock 143
+#define __NR_msync 144
+#define __NR_readv 145
+#define __NR_writev 146
+#define __NR_getsid 147
+#define __NR_fdatasync 148
+#define __NR__sysctl 149
+#define __NR_mlock 150
+#define __NR_munlock 151
+#define __NR_mlockall 152
+#define __NR_munlockall 153
+#define __NR_sched_setparam 154
+#define __NR_sched_getparam 155
+#define __NR_sched_setscheduler 156
+#define __NR_sched_getscheduler 157
+#define __NR_sched_yield 158
+#define __NR_sched_get_priority_max 159
+#define __NR_sched_get_priority_min 160
+#define __NR_sched_rr_get_interval 161
+#define __NR_nanosleep 162
+#define __NR_mremap 163
+#define __NR_setresuid 164
+#define __NR_getresuid 165
+#define __NR_vm86 166
+#define __NR_query_module 167
+#define __NR_poll 168
+#define __NR_nfsservctl 169
+#define __NR_setresgid 170
+#define __NR_getresgid 171
+#define __NR_prctl 172
+#define __NR_rt_sigreturn 173
+#define __NR_rt_sigaction 174
+#define __NR_rt_sigprocmask 175
+#define __NR_rt_sigpending 176
+#define __NR_rt_sigtimedwait 177
+#define __NR_rt_sigqueueinfo 178
+#define __NR_rt_sigsuspend 179
+#define __NR_pread64 180
+#define __NR_pwrite64 181
+#define __NR_chown 182
+#define __NR_getcwd 183
+#define __NR_capget 184
+#define __NR_capset 185
+#define __NR_sigaltstack 186
+#define __NR_sendfile 187
+#define __NR_getpmsg 188 /* some people actually want streams */
+#define __NR_putpmsg 189 /* some people actually want streams */
+#define __NR_vfork 190
+#define __NR_ugetrlimit 191 /* SuS compliant getrlimit */
+#define __NR_mmap2 192
+#define __NR_truncate64 193
+#define __NR_ftruncate64 194
+#define __NR_stat64 195
+#define __NR_lstat64 196
+#define __NR_fstat64 197
+#define __NR_lchown32 198
+#define __NR_getuid32 199
+#define __NR_getgid32 200
+#define __NR_geteuid32 201
+#define __NR_getegid32 202
+#define __NR_setreuid32 203
+#define __NR_setregid32 204
+#define __NR_getgroups32 205
+#define __NR_setgroups32 206
+#define __NR_fchown32 207
+#define __NR_setresuid32 208
+#define __NR_getresuid32 209
+#define __NR_setresgid32 210
+#define __NR_getresgid32 211
+#define __NR_chown32 212
+#define __NR_setuid32 213
+#define __NR_setgid32 214
+#define __NR_setfsuid32 215
+#define __NR_setfsgid32 216
+#define __NR_pivot_root 217
+#define __NR_mincore 218
+#define __NR_madvise 219
+#define __NR_madvise1 219 /* delete when C lib stub is removed */
+#define __NR_getdents64 220
+#define __NR_fcntl64 221
+/* 223 is unused */
+#define __NR_gettid 224
+#define __NR_readahead 225
+#define __NR_setxattr 226
+#define __NR_lsetxattr 227
+#define __NR_fsetxattr 228
+#define __NR_getxattr 229
+#define __NR_lgetxattr 230
+#define __NR_fgetxattr 231
+#define __NR_listxattr 232
+#define __NR_llistxattr 233
+#define __NR_flistxattr 234
+#define __NR_removexattr 235
+#define __NR_lremovexattr 236
+#define __NR_fremovexattr 237
+#define __NR_tkill 238
+#define __NR_sendfile64 239
+#define __NR_futex 240
+#define __NR_sched_setaffinity 241
+#define __NR_sched_getaffinity 242
+#define __NR_set_thread_area 243
+#define __NR_get_thread_area 244
+#define __NR_io_setup 245
+#define __NR_io_destroy 246
+#define __NR_io_getevents 247
+#define __NR_io_submit 248
+#define __NR_io_cancel 249
+#define __NR_fadvise64 250
+
+#define __NR_exit_group 252
+#define __NR_lookup_dcookie 253
+#define __NR_epoll_create 254
+#define __NR_epoll_ctl 255
+#define __NR_epoll_wait 256
+#define __NR_remap_file_pages 257
+#define __NR_set_tid_address 258
+#define __NR_timer_create 259
+#define __NR_timer_settime (__NR_timer_create+1)
+#define __NR_timer_gettime (__NR_timer_create+2)
+#define __NR_timer_getoverrun (__NR_timer_create+3)
+#define __NR_timer_delete (__NR_timer_create+4)
+#define __NR_clock_settime (__NR_timer_create+5)
+#define __NR_clock_gettime (__NR_timer_create+6)
+#define __NR_clock_getres (__NR_timer_create+7)
+#define __NR_clock_nanosleep (__NR_timer_create+8)
+#define __NR_statfs64 268
+#define __NR_fstatfs64 269
+#define __NR_tgkill 270
+#define __NR_utimes 271
+#define __NR_fadvise64_64 272
+#define __NR_vserver 273
+#define __NR_mbind 274
+#define __NR_get_mempolicy 275
+#define __NR_set_mempolicy 276
+#define __NR_mq_open 277
+#define __NR_mq_unlink (__NR_mq_open+1)
+#define __NR_mq_timedsend (__NR_mq_open+2)
+#define __NR_mq_timedreceive (__NR_mq_open+3)
+#define __NR_mq_notify (__NR_mq_open+4)
+#define __NR_mq_getsetattr (__NR_mq_open+5)
+#define __NR_sys_kexec_load 283
+#define __NR_wait 284
+
+#endif /* __VKI_UNISTD_X86_LINUX_H */
Added: trunk/coregrind/vki_unistd.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/vki_unistd.h 2005-05-29 18:46:38 UTC (rev 3813)
+++ trunk/coregrind/vki_unistd.h 2005-05-29 23:30:48 UTC (rev 3814)
@@ -0,0 +1,49 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Generic header for Valgrind's kernel interface. ---*/
+/*--- vki_unistd.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2005 Nicholas Nethercote
+ nj...@va...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __VKI_UNISTD_H
+#define __VKI_UNISTD_H
+
+#if defined(VGP_x86_linux)
+# include "vki_unistd-x86-linux.h" =20
+#elif defined(VGP_amd64_linux)
+# include "vki_unistd-amd64-linux.h"=20
+#elif defined(VGP_arm_linux)
+# include "vki_unistd-arm-linux.h"=20
+#else
+# error Unknown platform
+#endif
+
+#endif // __VKI_UNISTD_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/memcheck/tests/x86/scalar.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/memcheck/tests/x86/scalar.h 2005-05-29 18:46:38 UTC (rev 3813)
+++ trunk/memcheck/tests/x86/scalar.h 2005-05-29 23:30:48 UTC (rev 3814)
@@ -1,4 +1,4 @@
-#include "../../../coregrind/x86-linux/vki_unistd.h"
+#include "../../../coregrind/vki_unistd-x86-linux.h"
=20
#include <assert.h>
#include <errno.h>
|
Author: njn
Date: 2005-05-29 19:46:38 +0100 (Sun, 29 May 2005)
New Revision: 3813
Removed:
trunk/coregrind/amd64-linux/core_platform.h
trunk/coregrind/arm-linux/core_platform.h
trunk/coregrind/x86-linux/core_platform.h
Modified:
trunk/coregrind/amd64-linux/Makefile.am
trunk/coregrind/arm-linux/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/m_syscalls/syscalls.c
trunk/coregrind/vg_mylibc.c
trunk/coregrind/x86-linux/Makefile.am
trunk/docs/porting-HOWTO
Log:
Eliminated VGP_DO_MMAP. Replaced it with VG_(mmap_native)(), which was
derived from mmap_inner().
As a consequence, $PLATFORM/core_platform.h files are no longer necessary=
,
hooray!
Modified: trunk/coregrind/amd64-linux/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/amd64-linux/Makefile.am 2005-05-29 17:50:40 UTC (rev =
3812)
+++ trunk/coregrind/amd64-linux/Makefile.am 2005-05-29 18:46:38 UTC (rev =
3813)
@@ -2,5 +2,4 @@
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
noinst_HEADERS =3D \
- core_platform.h \
vki_unistd.h
Deleted: trunk/coregrind/amd64-linux/core_platform.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/amd64-linux/core_platform.h 2005-05-29 17:50:40 UTC (=
rev 3812)
+++ trunk/coregrind/amd64-linux/core_platform.h 2005-05-29 18:46:38 UTC (=
rev 3813)
@@ -1,48 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Platform-specific stuff for the core. ---*/
-/*--- amd64-linux/core_platform.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __AMD64_LINUX_CORE_PLATFORM_H
-#define __AMD64_LINUX_CORE_PLATFORM_H
-
-/* ---------------------------------------------------------------------
- mmap() stuff
- ------------------------------------------------------------------ */
-
-#define VGP_DO_MMAP(ret, start, length, prot, flags, fd, offset) { \
- ret =3D VG_(do_syscall6)(__NR_mmap, (UWord)(start), (length), =
\
- (prot), (flags), (fd), (offset)); =
\
-} while (0)
-
-#endif // __AMD64_LINUX_CORE_PLATFORM_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/arm-linux/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/arm-linux/Makefile.am 2005-05-29 17:50:40 UTC (rev 38=
12)
+++ trunk/coregrind/arm-linux/Makefile.am 2005-05-29 18:46:38 UTC (rev 38=
13)
@@ -2,5 +2,4 @@
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
noinst_HEADERS =3D \
- core_platform.h \
vki_unistd.h
Deleted: trunk/coregrind/arm-linux/core_platform.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/arm-linux/core_platform.h 2005-05-29 17:50:40 UTC (re=
v 3812)
+++ trunk/coregrind/arm-linux/core_platform.h 2005-05-29 18:46:38 UTC (re=
v 3813)
@@ -1,47 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Platform-specific stuff for the core. ---*/
-/*--- arm-linux/core_platform.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __ARM_LINUX_CORE_PLATFORM_H
-#define __ARM_LINUX_CORE_PLATFORM_H
-
-/* ---------------------------------------------------------------------
- mmap() stuff
- ------------------------------------------------------------------ */
-
-#define VGP_DO_MMAP(ret, start, length, prot, flags, fd, offset) { \
- I_die_here; \
-} while (0)
-
-#endif // __ARM_LINUX_CORE_PLATFORM_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/core.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/core.h 2005-05-29 17:50:40 UTC (rev 3812)
+++ trunk/coregrind/core.h 2005-05-29 18:46:38 UTC (rev 3813)
@@ -35,8 +35,6 @@
#include "tool.h" // tool stuff
#include "core_arch.h" // arch-specific stuff, eg. x86/core_arch.h
=20
-#include "core_platform.h" // platform-specific stuff,
- // eg. x86-linux/core_platform.h
#include "core_os.h" // OS-specific stuff, eg. linux/core_os.h
=20
#include "pub_core_mallocfree.h" // for type 'ArenaId'
@@ -442,10 +440,12 @@
extern Int VG_(poll)( struct vki_pollfd *, UInt nfds, Int timeout);
=20
/* system/mman.h */
-extern void* VG_(mmap)( void* start, SizeT length, UInt prot, UInt flags=
,
- UInt sf_flags, UInt fd, OffT offset );
-extern Int VG_(munmap)( void* start, SizeT length );
-extern Int VG_(mprotect)( void *start, SizeT length, UInt prot );
+extern void* VG_(mmap) ( void* start, SizeT length, UInt prot, UIn=
t flags,
+ UInt sf_flags, UInt fd, OffT offset );
+extern void* VG_(mmap_native)( void* start, SizeT length, UInt prot, UIn=
t flags,
+ UInt fd, OffT offset );
+extern Int VG_(munmap) ( void* start, SizeT length );
+extern Int VG_(mprotect) ( void *start, SizeT length, UInt prot );
extern Int VG_(mprotect_native)( void *start, SizeT length, UInt prot );
=20
=20
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.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_aspacemgr/aspacemgr.c 2005-05-29 17:50:40 UTC (rev =
3812)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-05-29 18:46:38 UTC (rev =
3813)
@@ -953,14 +953,14 @@
void VG_(pad_address_space)(Addr start)
{
Addr addr =3D (start =3D=3D 0) ? VG_(client_base) : start;
- Addr ret;
+ void* ret;
=20
Int i =3D 0;
Segment* s =3D i >=3D segments_used ? NULL : &segments[i];
=20
while (s && addr <=3D VG_(valgrind_last)) {
if (addr < s->addr) {
- VGP_DO_MMAP(ret, addr, s->addr - addr, 0,
+ ret =3D VG_(mmap_native)((void*)addr, s->addr - addr, 0,
VKI_MAP_FIXED | VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS=
,
-1, 0);
}
@@ -970,7 +970,7 @@
}
=20
if (addr <=3D VG_(valgrind_last)) {
- VGP_DO_MMAP(ret, addr, VG_(valgrind_last) - addr + 1, 0,
+ ret =3D VG_(mmap_native)((void*)addr, VG_(valgrind_last) - addr + =
1, 0,
VKI_MAP_FIXED | VKI_MAP_PRIVATE | VKI_MAP_ANONYMOUS,
-1, 0);
}
Modified: trunk/coregrind/m_syscalls/syscalls.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_syscalls/syscalls.c 2005-05-29 17:50:40 UTC (rev 38=
12)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-05-29 18:46:38 UTC (rev 38=
13)
@@ -4533,8 +4533,7 @@
}
=20
if (RES !=3D -VKI_ENOMEM) {
- int res;
- VGP_DO_MMAP(res, a1, a2, a3, a4, a5, a6);
+ Int res =3D (Int)VG_(mmap_native)((void*)a1, a2, a3, a4, a5, a6);
SET_RESULT(res);
=20
if (!VG_(is_kerror)(RES)) {
Modified: trunk/coregrind/vg_mylibc.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_mylibc.c 2005-05-29 17:50:40 UTC (rev 3812)
+++ trunk/coregrind/vg_mylibc.c 2005-05-29 18:46:38 UTC (rev 3813)
@@ -288,19 +288,28 @@
mmap/munmap, exit, fcntl
------------------------------------------------------------------ */
=20
-static Int munmap_inner(void *start, SizeT length)
-{
- return VG_(do_syscall2)(__NR_munmap, (UWord)start, length );
-}
-
-static Addr mmap_inner(void *start, SizeT length, UInt prot, UInt flags,
+void* VG_(mmap_native)(void *start, SizeT length, UInt prot, UInt flags,
UInt fd, OffT offset)
{
- Word ret;
- =20
- VGP_DO_MMAP(ret, start, length, prot,
- flags & ~(VKI_MAP_NOSYMS|VKI_MAP_CLIENT), fd, offset);
- return ret;
+ UWord ret;
+#if defined(VGP_x86_linux)
+ {=20
+ UWord args[6];
+ args[0] =3D (UWord)start;
+ args[1] =3D length;
+ args[2] =3D prot;
+ args[3] =3D flags;
+ args[4] =3D fd;
+ args[5] =3D offset;
+ ret =3D VG_(do_syscall1)(__NR_mmap, (UWord)args );
+ }
+#elif defined(VGP_amd64_linux)
+ ret =3D VG_(do_syscall6)(__NR_mmap, (UWord)start, length,=20
+ prot, flags, fd, offset);
+#else
+# error Unknown platform
+#endif
+ return VG_(is_kerror)(ret) ? (void*)-1 : (void*)ret;
}
=20
/* Returns -1 on failure. */
@@ -317,10 +326,12 @@
if (start =3D=3D 0)
return (void *)-1;
=20
- res =3D mmap_inner(start, length, prot, flags, fd, offset);
+ res =3D (Addr)VG_(mmap_native)(start, length, prot,=20
+ flags & ~(VKI_MAP_NOSYMS | VKI_MAP_CLIEN=
T),
+ fd, offset);
=20
// Check it ended up in the right place.
- if (!VG_(is_kerror)(res)) {
+ if (res !=3D (Addr)-1) {
if (flags & VKI_MAP_CLIENT) {
vg_assert(VG_(client_base) <=3D res && res+length <=3D VG_(clie=
nt_end));
} else {
@@ -337,29 +348,36 @@
VG_(map_fd_segment)(res, length, prot, sf_flags, fd, offset, NULL)=
;
}
=20
- return VG_(is_kerror)(res) ? ((void*)(-1)) : (void*)res;
+ return (void*)res;
}
=20
+static Int munmap_native(void *start, SizeT length)
+{
+ Int res =3D VG_(do_syscall2)(__NR_munmap, (UWord)start, length );
+ return VG_(is_kerror)(res) ? -1 : 0;
+}
+
/* Returns -1 on failure. */
Int VG_(munmap)( void* start, SizeT length )
{
- Int res =3D munmap_inner(start, length);
- if (!VG_(is_kerror)(res))
+ Int res =3D munmap_native(start, length);
+ if (0 =3D=3D res)
VG_(unmap_range)((Addr)start, length);
- return VG_(is_kerror)(res) ? -1 : 0;
+ return res;
}
=20
-Int VG_(mprotect)( void *start, SizeT length, UInt prot )
+Int VG_(mprotect_native)( void *start, SizeT length, UInt prot )
{
Int res =3D VG_(do_syscall3)(__NR_mprotect, (UWord)start, length, pro=
t );
- if (!VG_(is_kerror)(res))
- VG_(mprotect_range)((Addr)start, length, prot);
return VG_(is_kerror)(res) ? -1 : 0;
}
-Int VG_(mprotect_native)( void *start, SizeT length, UInt prot )
+
+Int VG_(mprotect)( void *start, SizeT length, UInt prot )
{
- Int res =3D VG_(do_syscall3)(__NR_mprotect, (UWord)start, length, pro=
t );
- return VG_(is_kerror)(res) ? -1 : 0;
+ Int res =3D VG_(mprotect_native)(start, length, prot);
+ if (0 =3D=3D res)
+ VG_(mprotect_range)((Addr)start, length, prot);
+ return res;
}
=20
/* Pull down the entire world */
Modified: trunk/coregrind/x86-linux/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/x86-linux/Makefile.am 2005-05-29 17:50:40 UTC (rev 38=
12)
+++ trunk/coregrind/x86-linux/Makefile.am 2005-05-29 18:46:38 UTC (rev 38=
13)
@@ -2,5 +2,4 @@
include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
=20
noinst_HEADERS =3D \
- core_platform.h \
vki_unistd.h
Deleted: trunk/coregrind/x86-linux/core_platform.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/x86-linux/core_platform.h 2005-05-29 17:50:40 UTC (re=
v 3812)
+++ trunk/coregrind/x86-linux/core_platform.h 2005-05-29 18:46:38 UTC (re=
v 3813)
@@ -1,56 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Platform-specific stuff for the core. ---*/
-/*--- x86-linux/core_platform.h ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Nicholas Nethercote
- nj...@va...
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __X86_LINUX_CORE_PLATFORM_H
-#define __X86_LINUX_CORE_PLATFORM_H
-
-/* ---------------------------------------------------------------------
- mmap() stuff
- ------------------------------------------------------------------ */
-
-#define VGP_DO_MMAP(ret, start, length, prot, flags, fd, offset) { =
\
- UWord __args[6]; =
\
- =
\
- __args[0] =3D (UWord)(start); =
\
- __args[1] =3D (length); =
\
- __args[2] =3D (prot); =
\
- __args[3] =3D (flags); =
\
- __args[4] =3D (fd); =
\
- __args[5] =3D (offset); =
\
- =
\
- ret =3D VG_(do_syscall1)(__NR_mmap, (UWord)(&(__args[0])) ); =
\
-} while (0)
-
-#endif // __X86_LINUX_CORE_PLATFORM_H
-
-/*--------------------------------------------------------------------*/
-/*--- end ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/docs/porting-HOWTO
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/porting-HOWTO 2005-05-29 17:50:40 UTC (rev 3812)
+++ trunk/docs/porting-HOWTO 2005-05-29 18:46:38 UTC (rev 3813)
@@ -1,6 +1,9 @@
This is a rough guide to porting Valgrind to a new architecture, or a ne=
w
operating system. It's quite preliminary, but should get you started.
=20
+[29-May-2005: the stuff about the locations of files is now badly out of
+date. --njn]
+
------------------------------------------------------------------------=
-----
Porting Valgrind to a new architecture
------------------------------------------------------------------------=
-----
|
|
From: <sv...@va...> - 2005-05-29 17:50:45
|
Author: njn
Date: 2005-05-29 18:50:40 +0100 (Sun, 29 May 2005)
New Revision: 3812
Modified:
trunk/coregrind/amd64-linux/core_platform.h
trunk/coregrind/arm-linux/core_platform.h
trunk/coregrind/m_syscalls/syscalls-amd64-linux.c
trunk/coregrind/m_syscalls/syscalls-x86-linux.c
trunk/coregrind/pub_core_syscalls.h
trunk/coregrind/vg_signals.c
trunk/coregrind/x86-linux/core_platform.h
Log:
Localized use of VGP_UCONTEXT_* to vg_signals.c, which meant they could
be moved out of $PLATFORM/core_platform.h.
Modified: trunk/coregrind/amd64-linux/core_platform.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/amd64-linux/core_platform.h 2005-05-29 17:27:18 UTC (=
rev 3811)
+++ trunk/coregrind/amd64-linux/core_platform.h 2005-05-29 17:50:40 UTC (=
rev 3812)
@@ -32,20 +32,7 @@
#ifndef __AMD64_LINUX_CORE_PLATFORM_H
#define __AMD64_LINUX_CORE_PLATFORM_H
=20
-//#include "core_platform_asm.h" // platform-specific asm stuff
-//#include "platform_arch.h" // platform-specific tool stuff
-
/* ---------------------------------------------------------------------
- ucontext stuff
- ------------------------------------------------------------------ */
-
-#define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.rip)
-#define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.rsp)
-#define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.rbp)
-#define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.rax)
-#define VGP_UCONTEXT_SYSCALL_RET(uc) ((uc)->uc_mcontext.rax)
-
-/* ---------------------------------------------------------------------
mmap() stuff
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/arm-linux/core_platform.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/arm-linux/core_platform.h 2005-05-29 17:27:18 UTC (re=
v 3811)
+++ trunk/coregrind/arm-linux/core_platform.h 2005-05-29 17:50:40 UTC (re=
v 3812)
@@ -32,19 +32,7 @@
#ifndef __ARM_LINUX_CORE_PLATFORM_H
#define __ARM_LINUX_CORE_PLATFORM_H
=20
-//#include "core_platform_asm.h" // platform-specific asm stuff
-//#include "platform_arch.h" // platform-specific tool stuff
-
/* ---------------------------------------------------------------------
- ucontext stuff
- ------------------------------------------------------------------ */
-
-#define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.arm_pc)
-#define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.arm_sp)
-#define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.arm_fp)
-#define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.arm_r0)
-
-/* ---------------------------------------------------------------------
mmap() stuff
------------------------------------------------------------------ */
=20
Modified: trunk/coregrind/m_syscalls/syscalls-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_syscalls/syscalls-amd64-linux.c 2005-05-29 17:27:18=
UTC (rev 3811)
+++ trunk/coregrind/m_syscalls/syscalls-amd64-linux.c 2005-05-29 17:50:40=
UTC (rev 3812)
@@ -108,18 +108,17 @@
*/
/* NB: this is identical to the x86 version */
void VGP_(interrupted_syscall)(ThreadId tid,=20
- struct vki_ucontext *uc,
+ Word ip, UWord sysnum, UWord sysret,
Bool restart)
{
static const Bool debug =3D 0;
=20
ThreadState *tst =3D VG_(get_ThreadState)(tid);
ThreadArchState *th_regs =3D &tst->arch;
- Word ip =3D VGP_UCONTEXT_INSTR_PTR(uc);
=20
if (debug)
VG_(printf)("interrupted_syscall: ip=3D%p; restart=3D%d eax=3D%d\n=
",=20
- ip, restart, VGP_UCONTEXT_SYSCALL_NUM(uc));
+ ip, restart, sysnum);
=20
if (ip < VGA_(blksys_setup) || ip >=3D VGA_(blksys_finished)) {
VG_(printf)(" not in syscall (%p - %p)\n", VGA_(blksys_setup), VG=
A_(blksys_finished));
@@ -149,8 +148,8 @@
The saved real CPU %rax has the result, which we need to move
to RAX. */
if (debug)
- VG_(printf)(" completed: ret=3D%d\n", VGP_UCONTEXT_SYSCALL_RET(uc));
- th_regs->vex.VGP_SYSCALL_RET =3D VGP_UCONTEXT_SYSCALL_RET(uc);
+ VG_(printf)(" completed: ret=3D%d\n", sysret);
+ th_regs->vex.VGP_SYSCALL_RET =3D sysret;
VG_(post_syscall)(tid);
} else if (ip >=3D VGA_(blksys_committed) && ip < VGA_(blksys_finishe=
d)) {
/* Result committed, but the signal mask has not been restored;
Modified: trunk/coregrind/m_syscalls/syscalls-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_syscalls/syscalls-x86-linux.c 2005-05-29 17:27:18 U=
TC (rev 3811)
+++ trunk/coregrind/m_syscalls/syscalls-x86-linux.c 2005-05-29 17:50:40 U=
TC (rev 3812)
@@ -107,18 +107,17 @@
*/
/* NB: this is identical to the amd64 version */
void VGP_(interrupted_syscall)(ThreadId tid,=20
- struct vki_ucontext *uc,
+ Word eip, UWord sysnum, UWord sysret,
Bool restart)
{
static const Bool debug =3D 0;
=20
ThreadState *tst =3D VG_(get_ThreadState)(tid);
ThreadArchState *th_regs =3D &tst->arch;
- Word eip =3D VGP_UCONTEXT_INSTR_PTR(uc);
=20
if (debug)
VG_(printf)("interrupted_syscall: eip=3D%p; restart=3D%d eax=3D%d\=
n",=20
- eip, restart, VGP_UCONTEXT_SYSCALL_NUM(uc));
+ eip, restart, sysnum);
=20
if (eip < VGA_(blksys_setup) || eip >=3D VGA_(blksys_finished)) {
VG_(printf)(" not in syscall (%p - %p)\n", VGA_(blksys_setup), VG=
A_(blksys_finished));
@@ -148,8 +147,8 @@
The saved real CPU %eax has the result, which we need to move
to EAX. */
if (debug)
- VG_(printf)(" completed: ret=3D%d\n", VGP_UCONTEXT_SYSCALL_RET(uc));
- th_regs->vex.VGP_SYSCALL_RET =3D VGP_UCONTEXT_SYSCALL_RET(uc);
+ VG_(printf)(" completed: ret=3D%d\n", sysret);
+ th_regs->vex.VGP_SYSCALL_RET =3D sysret;
VG_(post_syscall)(tid);
} else if (eip >=3D VGA_(blksys_committed) && eip < VGA_(blksys_finis=
hed)) {
/* Result committed, but the signal mask has not been restored;
Modified: trunk/coregrind/pub_core_syscalls.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_syscalls.h 2005-05-29 17:27:18 UTC (rev 3811=
)
+++ trunk/coregrind/pub_core_syscalls.h 2005-05-29 17:50:40 UTC (rev 3812=
)
@@ -48,7 +48,7 @@
// (either interrupted or finished normally), or False if it was
// restarted (or the signal didn't actually interrupt a syscall).
extern void VGP_(interrupted_syscall)(ThreadId tid,
- struct vki_ucontext *uc,
+ Word eip, UWord sysnum, UWord sysr=
et,
Bool restart);
=20
// Release resources held by this thread
Modified: trunk/coregrind/vg_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/vg_signals.c 2005-05-29 17:27:18 UTC (rev 3811)
+++ trunk/coregrind/vg_signals.c 2005-05-29 17:50:40 UTC (rev 3812)
@@ -113,6 +113,28 @@
vki_siginfo_t sigs[N_QUEUED_SIGNALS];
} SigQueue;
=20
+#if defined(VGP_x86_linux)
+# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
+# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
+# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.ebp)
+# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.eax)
+# define VGP_UCONTEXT_SYSCALL_RET(uc) ((uc)->uc_mcontext.eax)
+#elif defined(VGP_amd64_linux)
+# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.rip)
+# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.rsp)
+# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.rbp)
+# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.rax)
+# define VGP_UCONTEXT_SYSCALL_RET(uc) ((uc)->uc_mcontext.rax)
+#elif defined(VGP_arm_linux)
+# define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.arm_pc)
+# define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.arm_sp)
+# define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.arm_fp)
+# define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.arm_r0)
+# error VGP_UCONTEXT_SYSCALL_RET undefined for ARM/Linux
+#else
+# error Unknown platform
+#endif
+
/* ---------------------------------------------------------------------
HIGH LEVEL STUFF TO DO WITH SIGNALS: POLICY (MOSTLY)
------------------------------------------------------------------ */
@@ -1584,7 +1606,10 @@
sigNo, tid, info->si_code);
=20
/* Update thread state properly */
- VGP_(interrupted_syscall)(tid, uc,=20
+ VGP_(interrupted_syscall)(tid,=20
+ VGP_UCONTEXT_INSTR_PTR(uc),=20
+ VGP_UCONTEXT_SYSCALL_NUM(uc),=20
+ VGP_UCONTEXT_SYSCALL_RET(uc),=20
!!(scss.scss_per_sig[sigNo].scss_flags & VKI_SA_RESTART));
=20
/* Set up the thread's state to deliver a signal */
Modified: trunk/coregrind/x86-linux/core_platform.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/x86-linux/core_platform.h 2005-05-29 17:27:18 UTC (re=
v 3811)
+++ trunk/coregrind/x86-linux/core_platform.h 2005-05-29 17:50:40 UTC (re=
v 3812)
@@ -32,20 +32,7 @@
#ifndef __X86_LINUX_CORE_PLATFORM_H
#define __X86_LINUX_CORE_PLATFORM_H
=20
-//#include "core_platform_asm.h" // platform-specific asm stuff
-//#include "platform_arch.h" // platform-specific tool stuff
-
/* ---------------------------------------------------------------------
- ucontext stuff
- ------------------------------------------------------------------ */
-
-#define VGP_UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
-#define VGP_UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
-#define VGP_UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.ebp)
-#define VGP_UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.eax)
-#define VGP_UCONTEXT_SYSCALL_RET(uc) ((uc)->uc_mcontext.eax)
-
-/* ---------------------------------------------------------------------
mmap() stuff
------------------------------------------------------------------ */
=20
|
|
From: <sv...@va...> - 2005-05-29 17:27:22
|
Author: njn
Date: 2005-05-29 18:27:18 +0100 (Sun, 29 May 2005)
New Revision: 3811
Modified:
trunk/coregrind/amd64-linux/core_platform.h
trunk/coregrind/arm-linux/core_platform.h
trunk/coregrind/m_syscalls/syscalls.c
trunk/coregrind/x86-linux/core_platform.h
Log:
Eliminate VGP_GET_MMAP_ARGS.
Modified: trunk/coregrind/amd64-linux/core_platform.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/amd64-linux/core_platform.h 2005-05-29 17:05:49 UTC (=
rev 3810)
+++ trunk/coregrind/amd64-linux/core_platform.h 2005-05-29 17:27:18 UTC (=
rev 3811)
@@ -54,11 +54,6 @@
(prot), (flags), (fd), (offset)); =
\
} while (0)
=20
-#define VGP_GET_MMAP_ARGS(tst, a1, a2, a3, a4, a5, a6) do {\
- I_die_here; \
-} while (0)
-
-
#endif // __AMD64_LINUX_CORE_PLATFORM_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/arm-linux/core_platform.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/arm-linux/core_platform.h 2005-05-29 17:05:49 UTC (re=
v 3810)
+++ trunk/coregrind/arm-linux/core_platform.h 2005-05-29 17:27:18 UTC (re=
v 3811)
@@ -52,10 +52,6 @@
I_die_here; \
} while (0)
=20
-#define VGP_GET_MMAP_ARGS(tst, a1, a2, a3, a4, a5, a6) do { \
- I_die_here; \
-} while (0)
-
#endif // __ARM_LINUX_CORE_PLATFORM_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_syscalls/syscalls.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_syscalls/syscalls.c 2005-05-29 17:05:49 UTC (rev 38=
10)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-05-29 17:27:18 UTC (rev 38=
11)
@@ -4467,6 +4467,9 @@
PRE_MEM_RASCIIZ( "mkdir(pathname)", ARG1 );
}
=20
+// Nb: this should probably be in m_syscalls/syscalls-x86-linux.c, but i=
t
+// might be required for ARM, and I was too lazy to move it (which would
+// have required making mmap_segment() public).
PRE(old_mmap, Special)
{
/* struct mmap_arg_struct { =20
@@ -4477,10 +4480,24 @@
unsigned long fd;
unsigned long offset;
}; */
- UInt a1, a2, a3, a4, a5, a6;
+#if defined(VGP_x86_linux)
+ // do nothing
+#else
+ vg_assert(0, "old_mmap should only be called on x86/Linux");
+#endif
+ =20
+ UWord a1, a2, a3, a4, a5, a6;
+ UWord *arg_block =3D (UWord*)(tst->arch.vex.VGP_SYSCALL_ARG1);
=20
PRE_REG_READ1(long, "old_mmap", struct mmap_arg_struct *, args);
- VGP_GET_MMAP_ARGS(tst, a1, a2, a3, a4, a5, a6);
+ arg_block =3D (UWord*)(tst->arch.vex.VGP_SYSCALL_ARG1);
+ PRE_MEM_READ( "old_mmap(args)", (Addr)arg_block, 6*sizeof(UWord) );\
+ a1 =3D arg_block[0];
+ a2 =3D arg_block[1];
+ a3 =3D arg_block[2];
+ a4 =3D arg_block[3];
+ a5 =3D arg_block[4];
+ a6 =3D arg_block[5];
=20
PRINT("old_mmap ( %p, %llu, %d, %d, %d, %d )",
a1, (ULong)a2, a3, a4, a5, a6 );
Modified: trunk/coregrind/x86-linux/core_platform.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/x86-linux/core_platform.h 2005-05-29 17:05:49 UTC (re=
v 3810)
+++ trunk/coregrind/x86-linux/core_platform.h 2005-05-29 17:27:18 UTC (re=
v 3811)
@@ -62,17 +62,6 @@
ret =3D VG_(do_syscall1)(__NR_mmap, (UWord)(&(__args[0])) ); =
\
} while (0)
=20
-#define VGP_GET_MMAP_ARGS(tst, a1, a2, a3, a4, a5, a6) do { \
- UInt *arg_block =3D (UInt*)(tst->arch.vex.VGP_SYSCALL_ARG1); \
- PRE_MEM_READ( "old_mmap(args)", (Addr)arg_block, 6*sizeof(UWord) );\
- a1 =3D arg_block[0]; \
- a2 =3D arg_block[1]; \
- a3 =3D arg_block[2]; \
- a4 =3D arg_block[3]; \
- a5 =3D arg_block[4]; \
- a6 =3D arg_block[5]; \
-} while (0)
-
#endif // __X86_LINUX_CORE_PLATFORM_H
=20
/*--------------------------------------------------------------------*/
|