summaryrefslogtreecommitdiff
path: root/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-11-04 05:48:11 +0000
committerJason Molenda <jmolenda@apple.com>2014-11-04 05:48:11 +0000
commit4426eaa8b145042c984f3090d7db25fccd0597c8 (patch)
tree3430fcb5ef2082c2b6643688c03e3ab033baa848 /source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
parent8cee0d7eb216c09995cec11284188996513dfe99 (diff)
Add recognition for another x86 epilogue sequence (ret followed by
a nop). Fixes an instruction stepping problem when trying to step over the final instructions of an epilogue. <rdar://problem/18068877> git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@221241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp')
-rw-r--r--source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
index 32a21d2b8..d6f8f2457 100644
--- a/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
+++ b/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
@@ -804,6 +804,12 @@ loopnext:
// [ 0xc3 ] ret
// [ 0xe8 xx xx xx xx ] call __stack_chk_fail (this is sometimes the final insn in the function)
+ // or
+
+ // [ 0x5d ] mov %rbp, %rsp (aka pop %rbp)
+ // [ 0xc3 ] ret
+ // [ 0x0f 0x1f 0x44 xx xx ] nopl (%rax,%rax) (aka nop)
+
// We want to add a Row describing how to unwind when we're stopped on the 'ret' instruction where the
// CFA is no longer defined in terms of rbp, but is now defined in terms of rsp like on function entry.
// (or the 'jmp' instruction in the second case)
@@ -834,6 +840,11 @@ loopnext:
{
ret_insn_offset = m_func_bounds.GetByteSize() - 6;
}
+ else if (bytebuf[0] == 0x5d && bytebuf[1] == 0xc3
+ && bytebuf[2] == 0x0f && bytebuf[3] == 0x1f & bytebuf[4] == 0x44) // mov & ret & nop
+ {
+ ret_insn_offset = m_func_bounds.GetByteSize() - 6;
+ }
}
}
else if (m_func_bounds.GetByteSize() > 2)