[llvm-branch-commits] [lldb] 069d90a - Revert "Fix error in unrecognized register name handling for "SBFrame.registe…"

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Apr 11 20:12:46 PDT 2024


Author: Chelsea Cassanova
Date: 2024-04-11T20:12:43-07:00
New Revision: 069d90a500ed02067f3f1a5d01c7827623353b85

URL: https://github.com/llvm/llvm-project/commit/069d90a500ed02067f3f1a5d01c7827623353b85
DIFF: https://github.com/llvm/llvm-project/commit/069d90a500ed02067f3f1a5d01c7827623353b85.diff

LOG: Revert "Fix error in unrecognized register name handling for "SBFrame.registe…"

This reverts commit 9a36077e4db30c7da603620762036d4a430e4e62.

Added: 
    

Modified: 
    lldb/bindings/interface/SBFrameExtensions.i
    lldb/test/API/python_api/frame/TestFrames.py

Removed: 
    


################################################################################
diff  --git a/lldb/bindings/interface/SBFrameExtensions.i b/lldb/bindings/interface/SBFrameExtensions.i
index e0472280666ab9..43b22ed7a6b325 100644
--- a/lldb/bindings/interface/SBFrameExtensions.i
+++ b/lldb/bindings/interface/SBFrameExtensions.i
@@ -44,16 +44,6 @@ STRING_EXTENSION_OUTSIDE(SBFrame)
                 def __init__(self, regs):
                     self.regs = regs
 
-                def __iter__(self):
-                    return self.get_registers()
-
-                def get_registers(self):
-                    for i in range(0,len(self.regs)):
-                        rs = self.regs[i]
-                        for j in range (0,rs.num_children):
-                            reg = rs.GetChildAtIndex(j)
-                            yield reg
-                          
                 def __getitem__(self, key):
                     if type(key) is str:
                         for i in range(0,len(self.regs)):
@@ -62,7 +52,7 @@ STRING_EXTENSION_OUTSIDE(SBFrame)
                                 reg = rs.GetChildAtIndex(j)
                                 if reg.name == key: return reg
                     else:
-                        return SBValue()
+                        return lldb.SBValue()
 
             return registers_access(self.registers)
 

diff  --git a/lldb/test/API/python_api/frame/TestFrames.py b/lldb/test/API/python_api/frame/TestFrames.py
index dfa96d51830bae..a82b129bc8099d 100644
--- a/lldb/test/API/python_api/frame/TestFrames.py
+++ b/lldb/test/API/python_api/frame/TestFrames.py
@@ -73,19 +73,7 @@ def test_get_arg_vals_for_call_stack(self):
                 gpr_reg_set = lldbutil.get_GPRs(frame)
                 pc_value = gpr_reg_set.GetChildMemberWithName("pc")
                 self.assertTrue(pc_value, "We should have a valid PC.")
-                # Make sure we can also get this from the "register" property:
-                iterator_pc_value = 0
-                found_pc = False
-                for reg in frame.register:
-                    if reg.name == "pc":
-                        found_pc = True
-                        iterator_pc_value = int(reg.GetValue(), 0)
-                        break
-
                 pc_value_int = int(pc_value.GetValue(), 0)
-                self.assertTrue(found_pc, "Found the PC value in the register list")
-                self.assertEqual(iterator_pc_value, pc_value_int, "The methods of finding pc match")
-    
                 # Make sure on arm targets we dont mismatch PC value on the basis of thumb bit.
                 # Frame PC will not have thumb bit set in case of a thumb
                 # instruction as PC.


        


More information about the llvm-branch-commits mailing list