[Lldb-commits] [lldb] 662c1c2 - [LLDB][ARM] Remove unused LoadPseudoRegistersFromFrame function

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 16 01:28:54 PDT 2022


Author: David Spickett
Date: 2022-08-16T08:28:50Z
New Revision: 662c1c28813b4dd0cf8775b9acb950ded9705cae

URL: https://github.com/llvm/llvm-project/commit/662c1c28813b4dd0cf8775b9acb950ded9705cae
DIFF: https://github.com/llvm/llvm-project/commit/662c1c28813b4dd0cf8775b9acb950ded9705cae.diff

LOG: [LLDB][ARM] Remove unused LoadPseudoRegistersFromFrame function

https://reviews.llvm.org/D131658 identified a bug in this and
turns out it's not used anywhere.

Reviewed By: JDevlieghere, clayborg

Differential Revision: https://reviews.llvm.org/D131664

Added: 
    

Modified: 
    lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
    lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
index 4bfff9277f08..1bb96fc8a2f7 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
@@ -26,43 +26,6 @@ EmulationStateARM::EmulationStateARM() : m_vfp_regs(), m_memory() {
 
 EmulationStateARM::~EmulationStateARM() = default;
 
-bool EmulationStateARM::LoadPseudoRegistersFromFrame(StackFrame &frame) {
-  RegisterContext *reg_ctx = frame.GetRegisterContext().get();
-  bool success = true;
-  uint32_t reg_num;
-
-  for (int i = dwarf_r0; i < dwarf_r0 + 17; ++i) {
-    reg_num =
-        reg_ctx->ConvertRegisterKindToRegisterNumber(eRegisterKindDWARF, i);
-    const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg_num);
-    RegisterValue reg_value;
-    if (reg_ctx->ReadRegister(reg_info, reg_value)) {
-      m_gpr[i - dwarf_r0] = reg_value.GetAsUInt32();
-    } else
-      success = false;
-  }
-
-  for (int i = dwarf_d0; i < dwarf_d0 + 32; ++i) {
-    reg_num =
-        reg_ctx->ConvertRegisterKindToRegisterNumber(eRegisterKindDWARF, i);
-    RegisterValue reg_value;
-    const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg_num);
-
-    if (reg_ctx->ReadRegister(reg_info, reg_value)) {
-      uint64_t value = reg_value.GetAsUInt64();
-      uint32_t idx = i - dwarf_d0;
-      if (idx < 16) {
-        m_vfp_regs.s_regs[idx * 2] = (uint32_t)value;
-        m_vfp_regs.s_regs[idx * 2 + 1] = (uint32_t)(value >> 32);
-      } else
-        m_vfp_regs.d_regs[idx - 16] = value;
-    } else
-      success = false;
-  }
-
-  return success;
-}
-
 bool EmulationStateARM::StorePseudoRegisterValue(uint32_t reg_num,
                                                  uint64_t value) {
   if (reg_num <= dwarf_cpsr)

diff  --git a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h
index bc885dab9ac7..bf322f5b1a91 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h
+++ b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h
@@ -32,8 +32,6 @@ class EmulationStateARM {
 
   void ClearPseudoMemory();
 
-  bool LoadPseudoRegistersFromFrame(lldb_private::StackFrame &frame);
-
   bool LoadStateFromDictionary(lldb_private::OptionValueDictionary *test_data);
 
   bool CompareState(EmulationStateARM &other_state,


        


More information about the lldb-commits mailing list