|
From: <sv...@va...> - 2005-05-10 03:01:43
|
Author: njn
Date: 2005-05-10 04:01:23 +0100 (Tue, 10 May 2005)
New Revision: 3651
Modified:
trunk/coregrind/vg_scheduler.c
trunk/include/valgrind.h.in
Log:
Add a comment explaining the recently changed behaviour of
RUNNING_ON_VALGRIND.
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-10 02:56:08 UTC (rev 3650)
+++ trunk/coregrind/vg_scheduler.c 2005-05-10 03:01:23 UTC (rev 3651)
@@ -989,6 +989,8 @@
break;
}
=20
+ // Nb: this looks like a circular definition, because it kind of i=
s.
+ // See comment in valgrind.h to understand what's going on.
case VG_USERREQ__RUNNING_ON_VALGRIND:
SET_CLREQ_RETVAL(tid, RUNNING_ON_VALGRIND+1);
break;
Modified: trunk/include/valgrind.h.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/include/valgrind.h.in 2005-05-10 02:56:08 UTC (rev 3650)
+++ trunk/include/valgrind.h.in 2005-05-10 03:01:23 UTC (rev 3651)
@@ -244,8 +244,9 @@
#define __extension__
#endif
=20
-/* Returns 1 if running on Valgrind, 0 if running on the real CPU.=20
- Currently implemented but untested. */
+/* Returns the number of Valgrinds this code is running under. That is,
+ 0 if running natively, 1 if running under Valgrind, 2 if running unde=
r
+ Valgrind which is running under another Valgrind, etc. */
#define RUNNING_ON_VALGRIND __extension__ \
({unsigned int _qzz_res; \
VALGRIND_MAGIC_SEQUENCE(_qzz_res, 0 /* returned if not */, \
|