[Lldb-commits] [PATCH] D108768: [lldb] [DynamicRegisterInfo] Fix mistaken reg type when calculating offsets

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 26 08:20:49 PDT 2021


mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste, jasonmolenda, JDevlieghere.
mgorny requested review of this revision.

Fix the DynamicRegisterInfo::ConfigureOffsets() method to treat
value_regs as local register numbers (eRegisterKindLLDB) rather than
gdb-remote numbers (eRegisterKindProcessPlugin).  This seems consistent
with other uses in the class, and it fixes calculating register offsets
when remote and local register numbers are not in sync.


https://reviews.llvm.org/D108768

Files:
  lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp


Index: lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
===================================================================
--- lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -663,9 +663,7 @@
       if (reg.byte_offset == LLDB_INVALID_INDEX32) {
         uint32_t value_regnum = reg.value_regs[0];
         if (value_regnum != LLDB_INVALID_INDEX32)
-          reg.byte_offset =
-              GetRegisterInfoAtIndex(remote_to_local_regnum_map[value_regnum])
-                  ->byte_offset;
+          reg.byte_offset = GetRegisterInfoAtIndex(value_regnum)->byte_offset;
       }
     }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108768.368890.patch
Type: text/x-patch
Size: 681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210826/0bc132f2/attachment.bin>


More information about the lldb-commits mailing list