[Lldb-commits] [PATCH] D70797: [LLDB] Use r11 as frame pointer on Windows on ARM

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 27 14:27:21 PST 2019


mstorsjo created this revision.
mstorsjo added reviewers: labath, amccarth.
Herald added a subscriber: kristof.beyls.
Herald added a project: LLDB.

The change in itself is straightforward based on reading the code, but I don't have a real world case where I know this made a difference, so I don't really know what to use to distill a test case out of though.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70797

Files:
  lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp


Index: lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
===================================================================
--- lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -850,6 +850,7 @@
 
   /* On Apple iOS et al, the frame pointer register is always r7.
    * Typically on other ARM systems, thumb code uses r7; arm code uses r11.
+   * Windows on ARM, which is in thumb mode, uses r11 though.
    */
 
   uint32_t fp_regnum = 11;
@@ -857,7 +858,7 @@
   if (is_apple)
     fp_regnum = 7;
 
-  if (m_opcode_mode == eModeThumb)
+  if (m_opcode_mode == eModeThumb && !m_arch.GetTriple().isOSWindows())
     fp_regnum = 7;
 
   return fp_regnum;
@@ -879,6 +880,7 @@
 
   /* On Apple iOS et al, the frame pointer register is always r7.
    * Typically on other ARM systems, thumb code uses r7; arm code uses r11.
+   * Windows on ARM, which is in thumb mode, uses r11 though.
    */
 
   uint32_t fp_regnum = dwarf_r11;
@@ -886,7 +888,7 @@
   if (is_apple)
     fp_regnum = dwarf_r7;
 
-  if (m_opcode_mode == eModeThumb)
+  if (m_opcode_mode == eModeThumb && !m_arch.GetTriple().isOSWindows())
     fp_regnum = dwarf_r7;
 
   return fp_regnum;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70797.231325.patch
Type: text/x-patch
Size: 1244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191127/7d663b4d/attachment.bin>


More information about the lldb-commits mailing list