Fixed RIP tracing

This commit is contained in:
Alex 2022-12-20 00:38:52 +02:00
parent 061edc0f13
commit 47e4731b78
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -56,28 +56,28 @@ namespace CrashHandler
EHPrint("\n\n\eFAFAFATracing thread RIP history..."); EHPrint("\n\n\eFAFAFATracing thread RIP history...");
SymbolResolver::Symbols *sh = data.Process->ELFSymbolTable; SymbolResolver::Symbols *sh = data.Process->ELFSymbolTable;
if (!sh) if (!sh)
EHPrint("\n\eFF0000< No symbol table available. >\n"); EHPrint("\n\eFFA500Warning: No symbol table available.");
else int SameItr = 0;
uint64_t LastRIP = 0;
for (int i = 0; i < 128; i++)
{ {
int SameItr = 0; if (data.Thread->RIPHistory[i] == 0)
uint64_t LastRIP = 0; break;
for (int i = 0; i < 128; i++) if (data.Thread->RIPHistory[i] == LastRIP)
{ {
if (data.Thread->RIPHistory[i] == 0) SameItr++;
break; if (SameItr > 3)
if (data.Thread->RIPHistory[i] == LastRIP) continue;
{
SameItr++;
if (SameItr > 3)
continue;
}
else
SameItr = 0;
LastRIP = data.Thread->RIPHistory[i];
EHPrint("\n\e2565CC%p\e7925CC-\e25CCC9%s", data.Thread->RIPHistory[i], sh->GetSymbolFromAddress((uint64_t)data.Thread->RIPHistory[i]));
} }
EHPrint("\n\e7925CCNote: \e2565CCSame RIPs are not shown more than 3 times.\n"); else
SameItr = 0;
LastRIP = data.Thread->RIPHistory[i];
if (!sh)
EHPrint("\n\e2565CC%p", data.Thread->RIPHistory[i]);
else
EHPrint("\n\e2565CC%p\e7925CC-\e25CCC9%s", data.Thread->RIPHistory[i], sh->GetSymbolFromAddress((uint64_t)data.Thread->RIPHistory[i]));
} }
EHPrint("\n\e7925CCNote: \e2565CCSame RIPs are not shown more than 3 times.\n");
} }
} }
} }