Bug 1100911 - For MacOS builds running on Valgrind, make ThreadStackHelper::GetStack be a no-op. r=nchen.

--HG--
extra : rebase_source : b78df813b0fb211043836f4b8692caf277a2b28f
This commit is contained in:
Julian Seward 2014-11-20 20:50:26 +01:00
parent d159649494
commit 89afba7ee7

View File

@ -38,6 +38,10 @@
#include "processor/stackwalker_arm.h"
#endif
#if defined(MOZ_VALGRIND)
# include <valgrind/valgrind.h>
#endif
#include <string.h>
#include <vector>
@ -260,6 +264,14 @@ ThreadStackHelper::GetStack(Stack& aStack)
MOZ_ALWAYS_TRUE(::ResumeThread(mThreadID) != DWORD(-1));
#elif defined(XP_MACOSX)
# if defined(MOZ_VALGRIND) && defined(RUNNING_ON_VALGRIND)
if (RUNNING_ON_VALGRIND) {
/* thread_suspend and thread_resume sometimes hang runs on Valgrind,
for unknown reasons. So, just avoid them. See bug 1100911. */
return;
}
# endif
if (::thread_suspend(mThreadID) != KERN_SUCCESS) {
MOZ_ASSERT(false);
return;