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
72 lines
2.5 KiB
Python
72 lines
2.5 KiB
Python
"""
|
|
Test SBBreakpoint APIs.
|
|
"""
|
|
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class BreakpointAPITestCase(TestBase):
|
|
NO_DEBUG_INFO_TESTCASE = True
|
|
|
|
def test_breakpoint_is_valid(self):
|
|
"""Make sure that if an SBBreakpoint gets deleted its IsValid returns false."""
|
|
self.build()
|
|
exe = self.getBuildArtifact("a.out")
|
|
|
|
# Create a target by the debugger.
|
|
target = self.dbg.CreateTarget(exe)
|
|
self.assertTrue(target, VALID_TARGET)
|
|
|
|
# Now create a breakpoint on main.c by name 'AFunction'.
|
|
breakpoint = target.BreakpointCreateByName("AFunction", "a.out")
|
|
self.trace("breakpoint:", breakpoint)
|
|
self.assertTrue(
|
|
breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT
|
|
)
|
|
|
|
# Now delete it:
|
|
did_delete = target.BreakpointDelete(breakpoint.GetID())
|
|
self.assertTrue(did_delete, "Did delete the breakpoint we just created.")
|
|
|
|
# Make sure we can't find it:
|
|
del_bkpt = target.FindBreakpointByID(breakpoint.GetID())
|
|
self.assertTrue(not del_bkpt, "We did delete the breakpoint.")
|
|
|
|
# Finally make sure the original breakpoint is no longer valid.
|
|
self.assertTrue(not breakpoint, "Breakpoint we deleted is no longer valid.")
|
|
|
|
def test_target_delete(self):
|
|
"""Make sure that if an SBTarget gets deleted the associated
|
|
Breakpoint's IsValid returns false."""
|
|
|
|
self.build()
|
|
exe = self.getBuildArtifact("a.out")
|
|
|
|
# Create a target by the debugger.
|
|
target = self.dbg.CreateTarget(exe)
|
|
self.assertTrue(target, VALID_TARGET)
|
|
|
|
# Now create a breakpoint on main.c by name 'AFunction'.
|
|
breakpoint = target.BreakpointCreateByName("AFunction", "a.out")
|
|
self.trace("breakpoint:", breakpoint)
|
|
self.assertTrue(
|
|
breakpoint and breakpoint.GetNumLocations() == 1, VALID_BREAKPOINT
|
|
)
|
|
location = breakpoint.GetLocationAtIndex(0)
|
|
self.assertTrue(location.IsValid())
|
|
|
|
# Test negative index access.
|
|
self.assertTrue(breakpoint.location[-1].IsValid())
|
|
|
|
# Make sure the breakpoint's target is right:
|
|
self.assertEqual(
|
|
target, breakpoint.GetTarget(), "Breakpoint reports its target correctly"
|
|
)
|
|
|
|
self.assertTrue(self.dbg.DeleteTarget(target))
|
|
self.assertFalse(breakpoint.IsValid())
|
|
self.assertFalse(location.IsValid())
|