ARM32 and x86 pop frame support
This commit is contained in:
+28
-1
@@ -57,11 +57,38 @@ void StackFrame::ret() {
|
||||
}
|
||||
|
||||
bool StackFrame::popStub(instruction_t* entry, const char* name) {
|
||||
instruction_t* ip = (instruction_t*)pc();
|
||||
if (ip == entry || *ip == 0xe12fff1e
|
||||
|| strncmp(name, "itable", 6) == 0
|
||||
|| strncmp(name, "vtable", 6) == 0
|
||||
|| strcmp(name, "InlineCacheBuffer") == 0)
|
||||
{
|
||||
ret();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StackFrame::popMethod(instruction_t* entry) {
|
||||
return false;
|
||||
instruction_t* ip = (instruction_t*)pc();
|
||||
if (ip > entry && ip <= entry + 4 && (*ip & 0xffffff00) == 0xe24dd000) {
|
||||
// push {r11, lr}
|
||||
// mov r11, sp (optional)
|
||||
// -> sub sp, sp, #offs
|
||||
fp() = stackAt(0);
|
||||
pc() = stackAt(1);
|
||||
sp() += 8;
|
||||
return true;
|
||||
} else if (*ip == 0xe8bd4800) {
|
||||
// add sp, sp, #offs
|
||||
// -> pop {r11, lr}
|
||||
fp() = stackAt(0);
|
||||
pc() = stackAt(1);
|
||||
sp() += 8;
|
||||
return true;
|
||||
}
|
||||
ret();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StackFrame::checkInterruptedSyscall() {
|
||||
|
||||
Reference in New Issue
Block a user