Backed out changeset fddfc0739043 (bug 1312883)
This commit is contained in:
@@ -162,12 +162,6 @@ public:
|
||||
|
||||
void
|
||||
ThreadStackHelper::GetStack(Stack& aStack)
|
||||
{
|
||||
GetStackInternal(aStack, /* aAppendNativeStack */ false);
|
||||
}
|
||||
|
||||
void
|
||||
ThreadStackHelper::GetStackInternal(Stack& aStack, bool aAppendNativeStack)
|
||||
{
|
||||
// Always run PrepareStackBuffer first to clear aStack
|
||||
if (!PrepareStackBuffer(aStack)) {
|
||||
@@ -201,13 +195,6 @@ ThreadStackHelper::GetStackInternal(Stack& aStack, bool aAppendNativeStack)
|
||||
MOZ_ASSERT(false);
|
||||
return;
|
||||
}
|
||||
#ifdef _WIN64
|
||||
AcquireStackWalkWorkaroundLock();
|
||||
#endif
|
||||
if (aAppendNativeStack) {
|
||||
aStack.EnsureNativeFrameCapacity(Telemetry::HangStack::sMaxNativeFrames);
|
||||
}
|
||||
|
||||
if (::SuspendThread(mThreadID) == DWORD(-1)) {
|
||||
MOZ_ASSERT(false);
|
||||
return;
|
||||
@@ -222,22 +209,6 @@ ThreadStackHelper::GetStackInternal(Stack& aStack, bool aAppendNativeStack)
|
||||
FillStackBuffer();
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
ReleaseStackWalkWorkaroundLock();
|
||||
#endif
|
||||
|
||||
if (aAppendNativeStack) {
|
||||
auto callback = [](uint32_t, void* aPC, void*, void* aClosure) {
|
||||
Stack* stack = static_cast<Stack*>(aClosure);
|
||||
stack->AppendNativeFrame(reinterpret_cast<uintptr_t>(aPC));
|
||||
};
|
||||
|
||||
MozStackWalk(callback, /* skipFrames */ 0,
|
||||
/* maxFrames */ Telemetry::HangStack::sMaxNativeFrames,
|
||||
reinterpret_cast<void*>(&aStack),
|
||||
reinterpret_cast<uintptr_t>(mThreadID), nullptr);
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_TRUE(::ResumeThread(mThreadID) != DWORD(-1));
|
||||
|
||||
#elif defined(XP_MACOSX)
|
||||
@@ -265,7 +236,10 @@ void
|
||||
ThreadStackHelper::GetNativeStack(Stack& aStack)
|
||||
{
|
||||
#ifdef MOZ_THREADSTACKHELPER_NATIVE
|
||||
GetStackInternal(aStack, /* aAppendNativeStack */ true);
|
||||
// Get pseudostack first and fill the thread context.
|
||||
GetStack(aStack);
|
||||
|
||||
// TODO: walk the saved stack frames.
|
||||
#endif // MOZ_THREADSTACKHELPER_NATIVE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user