|
From: <sv...@va...> - 2011-07-05 09:18:31
|
Author: sewardj
Date: 2011-07-05 10:13:41 +0100 (Tue, 05 Jul 2011)
New Revision: 11855
Log:
Make the wait-for-gdb delay loop somewhat more modern-compiler-proof.
Modified:
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2011-07-05 09:13:04 UTC (rev 11854)
+++ trunk/coregrind/m_main.c 2011-07-05 09:13:41 UTC (rev 11855)
@@ -1841,8 +1841,7 @@
/* Hook to delay things long enough so we can get the pid and
attach GDB in another shell. */
if (VG_(clo_wait_for_gdb)) {
- Long iters;
- volatile Long q;
+ ULong iters, q;
VG_(debugLog)(1, "main", "Wait for GDB\n");
VG_(printf)("pid=%d, entering delay loop\n", VG_(getpid)());
@@ -1862,9 +1861,9 @@
# error "Unknown plat"
# endif
- iters *= 1000*1000*1000;
+ iters *= 1000ULL * 1000 * 1000;
for (q = 0; q < iters; q++)
- ;
+ __asm__ __volatile__("" ::: "memory","cc");
}
//--------------------------------------------------------------
|