Files
TheRock/compiler/amd-llvm/lldb/test/API/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.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

63 lines
2.2 KiB
Python

"""
Test lldb breakpoint command for CPP methods & functions in a namespace.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class CPPBreakpointCommandsTestCase(TestBase):
def make_breakpoint(self, name, type, expected_num_locations):
bkpt = self.target.BreakpointCreateByName(
name, type, self.a_out_module, self.nested_comp_unit
)
num_locations = bkpt.GetNumLocations()
self.assertEqual(
num_locations,
expected_num_locations,
"Wrong number of locations for '%s', expected: %d got: %d"
% (name, expected_num_locations, num_locations),
)
return bkpt
def test_cpp_breakpoint_cmds(self):
"""Test a sequence of breakpoint command add, list, and delete."""
self.build()
exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
self.a_out_module = lldb.SBFileSpecList()
self.a_out_module.Append(lldb.SBFileSpec(exe))
self.nested_comp_unit = lldb.SBFileSpecList()
self.nested_comp_unit.Append(lldb.SBFileSpec("nested.cpp"))
# First provide ONLY the method name. This should get everybody...
self.make_breakpoint("Function", lldb.eFunctionNameTypeAuto, 5)
# Now add the Baz class specifier. This should get the version contained in Bar,
# AND the one contained in ::
self.make_breakpoint("Baz::Function", lldb.eFunctionNameTypeAuto, 2)
# Then add the Bar::Baz specifier. This should get the version
# contained in Bar only
self.make_breakpoint("Bar::Baz::Function", lldb.eFunctionNameTypeAuto, 1)
self.make_breakpoint("Function", lldb.eFunctionNameTypeMethod, 3)
self.make_breakpoint("Baz::Function", lldb.eFunctionNameTypeMethod, 2)
self.make_breakpoint("Bar::Baz::Function", lldb.eFunctionNameTypeMethod, 1)
self.make_breakpoint("Function", lldb.eFunctionNameTypeBase, 2)
self.make_breakpoint("Bar::Function", lldb.eFunctionNameTypeBase, 1)