Files
TheRock/compiler/amd-llvm/lldb/test/API/commands/frame/select/TestFrameSelect.py
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

106 lines
3.7 KiB
Python

"""
Test 'frame select' command.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestFrameSelect(TestBase):
@no_debug_info_test
@skipIfWindows
def test_relative(self):
self.build()
lldbutil.run_to_source_breakpoint(
self, "// Set break point at this line.", lldb.SBFileSpec("main.cpp")
)
self.expect("frame select -r 1", substrs=["nested2() at"])
self.expect("frame select -r -1", substrs=["nested3() at"])
self.expect(
"frame select -r -1",
error=True,
substrs=["already at the bottom of the stack"],
)
self.expect(
"frame select -r -2147483647",
error=True,
substrs=["already at the bottom of the stack"],
)
self.expect(
"frame select -r -2147483648",
error=True,
substrs=["error: invalid frame offset argument '-2147483648'"],
)
self.expect(
"frame select -r -2147483649",
error=True,
substrs=["error: invalid frame offset argument '-2147483649'"],
)
self.expect("frame select -r 1", substrs=["nested2() at"])
self.expect("frame select -r -2", substrs=["nested3() at"])
self.expect("frame select -r 1", substrs=["nested2() at"])
self.expect("frame select -r -2147483647", substrs=["nested3() at"])
self.expect("frame select -r 1", substrs=["nested2() at"])
self.expect(
"frame select -r -2147483648",
error=True,
substrs=["error: invalid frame offset argument '-2147483648'"],
)
self.expect(
"frame select -r -2147483649",
error=True,
substrs=["error: invalid frame offset argument '-2147483649'"],
)
self.expect("frame select -r 100")
self.expect(
"frame select -r 1",
error=True,
substrs=["already at the top of the stack"],
)
@no_debug_info_test
@skipIfWindows
def test_mixing_relative_and_abs(self):
self.build()
lldbutil.run_to_source_breakpoint(
self, "// Set break point at this line.", lldb.SBFileSpec("main.cpp")
)
# The function associated with each frame index can change depending
# on the function calling main (e.g. `start`), so this only tests that
# the frame index number is correct. We test the actual functions
# in the relative test.
# Jump to the top of the stack.
self.expect("frame select 0", substrs=["frame #0"])
# Run some relative commands.
self.expect("up", substrs=["frame #1"])
self.expect("frame select -r 1", substrs=["frame #2"])
self.expect("frame select -r -1", substrs=["frame #1"])
# Test that absolute indices still work.
self.expect("frame select 2", substrs=["frame #2"])
self.expect("frame select 1", substrs=["frame #1"])
self.expect("frame select 3", substrs=["frame #3"])
self.expect("frame select 0", substrs=["frame #0"])
self.expect("frame select 1", substrs=["frame #1"])
# Run some other relative frame select commands.
self.expect("down", substrs=["frame #0"])
self.expect("frame select -r 1", substrs=["frame #1"])
self.expect("frame select -r -1", substrs=["frame #0"])
# Test that absolute indices still work.
self.expect("frame select 2", substrs=["frame #2"])
self.expect("frame select 1", substrs=["frame #1"])
self.expect("frame select 3", substrs=["frame #3"])
self.expect("frame select 0", substrs=["frame #0"])