Skip to content

Revert "Fix error in unrecognized register name handling for "SBFrame.register"" #88468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

chelcassanova
Copy link
Contributor

Reverts #88047. TestFrames.py is failing on x86_64 GreenDragon: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/983/

@chelcassanova chelcassanova merged commit 9f14914 into main Apr 12, 2024
@chelcassanova chelcassanova deleted the revert-88047-sbframe-register-error branch April 12, 2024 03:15
@llvmbot llvmbot added the lldb label Apr 12, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 12, 2024

@llvm/pr-subscribers-lldb

Author: Chelsea Cassanova (chelcassanova)

Changes

Reverts llvm/llvm-project#88047. TestFrames.py is failing on x86_64 GreenDragon: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/983/


Full diff: https://github.com/llvm/llvm-project/pull/88468.diff

2 Files Affected:

  • (modified) lldb/bindings/interface/SBFrameExtensions.i (+1-11)
  • (modified) lldb/test/API/python_api/frame/TestFrames.py (-12)
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.

jimingham added a commit to jimingham/from-apple-llvm-project that referenced this pull request Apr 12, 2024
…e.register"" (llvm#88468)"

with a fix for the "register" iterator test to not rely on particular register names.

I mistook where the artificial "pc" register is generated.  It isn't added to the register
list or the register sets (except on arm where that's the name of the actual register), so
I can't use it in this test.  I instead just assert that the "register" generator produces
the same list as flattening the register sets from "registers".

This reverts commit 9f14914.
jimingham added a commit that referenced this pull request Apr 12, 2024
……e.register"" (#88468)" (#88535)

The only change is a fix for the "register" iterator test to not rely on
particular register names.

I mistook where the artificial "pc" register is generated. It isn't
added to the register list or the register sets (except on arm where
that's the name of the actual register), so I can't use it in this test.
I instead just assert that the "register" generator produces the same
list as flattening the register sets from "registers".

This reverts commit 9f14914.
bazuzi pushed a commit to bazuzi/llvm-project that referenced this pull request Apr 15, 2024
……e.register"" (llvm#88468)" (llvm#88535)

The only change is a fix for the "register" iterator test to not rely on
particular register names.

I mistook where the artificial "pc" register is generated. It isn't
added to the register list or the register sets (except on arm where
that's the name of the actual register), so I can't use it in this test.
I instead just assert that the "register" generator produces the same
list as flattening the register sets from "registers".

This reverts commit 9f14914.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants