[Lldb-commits] [PATCH] D131029: [NFC] Remove no-op code, duplicated, with multiple confusing comments, from x86AssemblyInspectionEngine::jmp_to_reg_p

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 2 16:16:53 PDT 2022


jasonmolenda created this revision.
jasonmolenda added a reviewer: fixathon.
jasonmolenda added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.

Thanks to @fixathon for catching this code I added in https://reviews.llvm.org/D62764.  This method clears the lower 3 bits of the second byte of an instruction, then compares it to a few values including 0x20 (fine) and 0x24, twice, with comments that seem to contradict the behavior.  Of course, having masked off the low 3 bits, these duplicated entries are never matched.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131029

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
@@ -682,10 +682,6 @@
   // The second byte is a ModR/M /4 byte, strip off the registers
   uint8_t second_byte_sans_reg = *(m_cur_insn + 1) & ~7;
 
-  // Don't handle 0x24 disp32, because the target address is
-  // knowable statically - pc_rel_branch_or_jump_p() will
-  // return the target address.
-
   // [reg]
   if (second_byte_sans_reg == 0x20)
     return true;
@@ -702,17 +698,6 @@
   if (second_byte_sans_reg == 0xe0)
     return true;
 
-  // disp32
-  // jumps to an address stored in memory, the value can't be cached
-  // in an unwind plan.
-  if (second_byte_sans_reg == 0x24)
-    return true;
-
-  // use SIB byte
-  // ff 24 fe  jmpq   *(%rsi,%rdi,8)
-  if (second_byte_sans_reg == 0x24)
-    return true;
-
   return false;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131029.449471.patch
Type: text/x-patch
Size: 1046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220802/99d19d16/attachment.bin>


More information about the lldb-commits mailing list