[Lldb-commits] [PATCH] D57928: Fix x86 return pattern detection

Todd Mortimer via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 7 14:41:48 PST 2019


mortimer created this revision.
mortimer added a reviewer: jasonmolenda.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Replace 0xc9 (LEAVE) with 0xcb (RETF) in ret_pattern_p(). Also put 0xc3 first, since it is the most common form and will match first.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D57928

Files:
  lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp


Index: lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
===================================================================
--- lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
+++ lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
@@ -665,10 +665,10 @@
   return false;
 }
 
-// ret [0xc9] or [0xc2 imm8] or [0xca imm8]
+// ret [0xc3] or [0xcb] or [0xc2 imm16] or [0xca imm16]
 bool x86AssemblyInspectionEngine::ret_pattern_p() {
   uint8_t *p = m_cur_insn;
-  return *p == 0xc9 || *p == 0xc2 || *p == 0xca || *p == 0xc3;
+  return *p == 0xc3 || *p == 0xc2 || *p == 0xca || *p == 0xcb;
 }
 
 uint32_t x86AssemblyInspectionEngine::extract_4(uint8_t *b) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57928.185870.patch
Type: text/x-patch
Size: 719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190207/36f1f24b/attachment.bin>


More information about the lldb-commits mailing list