Skip to content

Conversation

@kastiglione
Copy link
Contributor

@kastiglione kastiglione commented Nov 24, 2024

SBThread.frames can be used instead of get_stack_frames.

@llvmbot
Copy link
Member

llvmbot commented Nov 24, 2024

@llvm/pr-subscribers-lldb

Author: Dave Lee (kastiglione)

Changes

SBThread.frames can be used instead of get_stack_frames.


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

2 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/lldbutil.py (-11)
  • (modified) lldb/test/API/symbol_ondemand/shared_library/TestSharedLibOnDemand.py (+2-2)
diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py
index 660a3c085a908a..07b5f8cc7d900b 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py
@@ -1158,17 +1158,6 @@ def GetModuleName(i):
     return list(map(GetModuleName, list(range(thread.GetNumFrames()))))
 
 
-def get_stack_frames(thread):
-    """
-    Returns a sequence of stack frames for this thread.
-    """
-
-    def GetStackFrame(i):
-        return thread.GetFrameAtIndex(i)
-
-    return list(map(GetStackFrame, list(range(thread.GetNumFrames()))))
-
-
 def print_stacktrace(thread, string_buffer=False):
     """Prints a simple stack trace of this thread."""
 
diff --git a/lldb/test/API/symbol_ondemand/shared_library/TestSharedLibOnDemand.py b/lldb/test/API/symbol_ondemand/shared_library/TestSharedLibOnDemand.py
index f1c23a58d1f486..dbb9576ed4d51a 100644
--- a/lldb/test/API/symbol_ondemand/shared_library/TestSharedLibOnDemand.py
+++ b/lldb/test/API/symbol_ondemand/shared_library/TestSharedLibOnDemand.py
@@ -59,7 +59,7 @@ def test_source_line_breakpoint(self):
         lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
 
         thread = process.GetSelectedThread()
-        stack_frames = lldbutil.get_stack_frames(thread)
+        stack_frames = thread.frames
         self.assertGreater(len(stack_frames), 2)
 
         leaf_frame = stack_frames[0]
@@ -97,7 +97,7 @@ def test_symbolic_breakpoint(self):
         lldbutil.check_breakpoint(self, bpno=1, expected_hit_count=1)
 
         thread = process.GetSelectedThread()
-        stack_frames = lldbutil.get_stack_frames(thread)
+        stack_frames = thread.frames
         self.assertGreater(len(stack_frames), 2)
 
         leaf_frame = stack_frames[0]

@kastiglione kastiglione merged commit 0bfc951 into llvm:main Nov 25, 2024
9 checks passed
@kastiglione kastiglione deleted the lldb-Remove-lldbutil.get_stack_frames-NFC branch November 25, 2024 03:02
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