mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
Unbreak ksym loading and make reading /proc/PID/stack not crash.
This commit is contained in:
parent
683185e4aa
commit
4b6a8f8a08
7 changed files with 7 additions and 10 deletions
|
@ -91,13 +91,13 @@ void dump_backtrace(bool use_ksyms)
|
|||
};
|
||||
Vector<RecognizedSymbol> recognized_symbols;
|
||||
if (use_ksyms) {
|
||||
for (dword* stackPtr = (dword*)&use_ksyms; current->isValidAddressForKernel(LinearAddress((dword)stackPtr)); stackPtr = (dword*)*stackPtr) {
|
||||
for (dword* stackPtr = (dword*)&use_ksyms; current->validate_read_from_kernel(LinearAddress((dword)stackPtr)); stackPtr = (dword*)*stackPtr) {
|
||||
dword retaddr = stackPtr[1];
|
||||
if (auto* ksym = ksymbolicate(retaddr))
|
||||
recognized_symbols.append({ retaddr, ksym });
|
||||
}
|
||||
} else{
|
||||
for (dword* stackPtr = (dword*)&use_ksyms; current->isValidAddressForKernel(LinearAddress((dword)stackPtr)); stackPtr = (dword*)*stackPtr) {
|
||||
for (dword* stackPtr = (dword*)&use_ksyms; current->validate_read_from_kernel(LinearAddress((dword)stackPtr)); stackPtr = (dword*)*stackPtr) {
|
||||
dword retaddr = stackPtr[1];
|
||||
kprintf("%x (next: %x)\n", retaddr, stackPtr ? (dword*)*stackPtr : 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue