|
From: <sv...@va...> - 2016-10-05 13:17:13
|
Author: sewardj
Date: Wed Oct 5 14:17:03 2016
New Revision: 16017
Log:
Merge from trunk:
r15999 Replace --wait-for-gdb=yes memory loop by a call to VG_(poll)
(5000 milliseconds)
r16000 Well, 5 seconds is too short for me to type a attach pid command
so increase to 8 seconds.
Modified:
branches/VALGRIND_3_12_BRANCH/ (props changed)
branches/VALGRIND_3_12_BRANCH/coregrind/m_main.c
Modified: branches/VALGRIND_3_12_BRANCH/coregrind/m_main.c
==============================================================================
--- branches/VALGRIND_3_12_BRANCH/coregrind/m_main.c (original)
+++ branches/VALGRIND_3_12_BRANCH/coregrind/m_main.c Wed Oct 5 14:17:03 2016
@@ -2166,36 +2166,10 @@
/* Hook to delay things long enough so we can get the pid and
attach GDB in another shell. */
if (VG_(clo_wait_for_gdb)) {
- ULong iters, q;
- VG_(debugLog)(1, "main", "Wait for GDB\n");
- VG_(printf)("pid=%d, entering delay loop\n", VG_(getpid)());
-
-# if defined(VGP_x86_linux)
- iters = 10;
-# elif defined(VGP_amd64_linux) || defined(VGP_ppc64be_linux) \
- || defined(VGP_ppc64le_linux) || defined(VGP_tilegx_linux)
- iters = 10;
-# elif defined(VGP_ppc32_linux)
- iters = 5;
-# elif defined(VGP_arm_linux)
- iters = 5;
-# elif defined(VGP_arm64_linux)
- iters = 5;
-# elif defined(VGP_s390x_linux)
- iters = 10;
-# elif defined(VGP_mips32_linux) || defined(VGP_mips64_linux)
- iters = 10;
-# elif defined(VGO_darwin)
- iters = 3;
-# elif defined(VGO_solaris)
- iters = 10;
-# else
-# error "Unknown plat"
-# endif
-
- iters *= 1000ULL * 1000 * 1000;
- for (q = 0; q < iters; q++)
- __asm__ __volatile__("" ::: "memory","cc");
+ const int ms = 8000; // milliseconds
+ VG_(debugLog)(1, "main", "Wait for GDB during %d ms\n", ms);
+ VG_(printf)("pid=%d, entering delay %d ms loop\n", VG_(getpid)(), ms);
+ VG_(poll)(NULL, 0, ms);
}
//--------------------------------------------------------------
|