зеркало из https://github.com/mozilla/gecko-dev.git
Bug 317962 make stack walking code not reinit in a way that fails and improve stack bottom detection
r=dougt
This commit is contained in:
Родитель
90d92bfc9a
Коммит
f175783805
|
@ -414,8 +414,12 @@ GetCurrentPIDorHandle()
|
|||
PRBool
|
||||
EnsureSymInitialized()
|
||||
{
|
||||
static PRBool gInitialized = PR_FALSE;
|
||||
PRBool retStat;
|
||||
|
||||
if (gInitialized)
|
||||
return gInitialized;
|
||||
|
||||
if (!EnsureImageHlpInitialized())
|
||||
return PR_FALSE;
|
||||
|
||||
|
@ -423,6 +427,10 @@ EnsureSymInitialized()
|
|||
retStat = _SymInitialize(GetCurrentPIDorHandle(), NULL, TRUE);
|
||||
if (!retStat)
|
||||
PrintError("SymInitialize", NULL);
|
||||
|
||||
gInitialized = retStat;
|
||||
/* XXX At some point we need to arrange to call _SymCleanup */
|
||||
|
||||
return retStat;
|
||||
}
|
||||
|
||||
|
@ -613,12 +621,12 @@ DumpStackToFileMain64(struct DumpStackToFileData* data)
|
|||
ReleaseMutex(hStackWalkMutex);
|
||||
|
||||
if (ok)
|
||||
fprintf(aStream, "%s!%s+0x%016X\n", modInfo.ImageName, pSymbol->Name, displacement);
|
||||
fprintf(aStream, "%s!%s+0x%016X\n", modInfo.ModuleName, pSymbol->Name, displacement);
|
||||
else
|
||||
fprintf(aStream, "0x%016X\n", addr);
|
||||
|
||||
// Stop walking when we get to kernel32.dll.
|
||||
if (strcmp(modInfo.ImageName, "kernel32.dll") == 0)
|
||||
// Stop walking when we get to kernel32.
|
||||
if (strcmp(modInfo.ModuleName, "kernel32") == 0)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче