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
68 lines
2.3 KiB
Python
68 lines
2.3 KiB
Python
import lldb
|
|
from lldbsuite.test.lldbtest import TestBase
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class TestCase(TestBase):
|
|
def test_disable_enable(self):
|
|
self.build()
|
|
_, _, thread, bp = lldbutil.run_to_source_breakpoint(
|
|
self, "break here", lldb.SBFileSpec("main.c")
|
|
)
|
|
|
|
loc = self._stop_location(thread, bp)
|
|
self.assertTrue(loc.IsEnabled())
|
|
self.expect("breakpoint disable .", startstr="1 breakpoints disabled.")
|
|
self.assertFalse(loc.IsEnabled())
|
|
self.expect("breakpoint enable .", startstr="1 breakpoints enabled.")
|
|
self.assertTrue(loc.IsEnabled())
|
|
|
|
def test_delete(self):
|
|
self.build()
|
|
_, _, thread, bp = lldbutil.run_to_source_breakpoint(
|
|
self, "break here", lldb.SBFileSpec("main.c")
|
|
)
|
|
|
|
loc = self._stop_location(thread, bp)
|
|
self.expect(
|
|
"breakpoint delete .",
|
|
startstr="0 breakpoints deleted; 1 breakpoint locations disabled",
|
|
)
|
|
self.assertFalse(loc.IsEnabled())
|
|
|
|
def test_error_not_breakpoint_stop(self):
|
|
self.build()
|
|
_, _, thread, bp = lldbutil.run_to_source_breakpoint(
|
|
self, "break here", lldb.SBFileSpec("main.c")
|
|
)
|
|
|
|
loc = self._stop_location(thread, bp)
|
|
self.assertTrue(loc.IsEnabled())
|
|
thread.StepOver()
|
|
self.assertNotEqual(thread.stop_reason, lldb.eStopReasonBreakpoint)
|
|
self.expect(
|
|
"breakpoint disable .",
|
|
error=True,
|
|
startstr="error: current thread is not stopped at a breakpoint",
|
|
)
|
|
self.assertTrue(loc.IsEnabled())
|
|
|
|
def test_error_no_process(self):
|
|
self.build()
|
|
target = self.createTestTarget()
|
|
target.BreakpointCreateByLocation("main.c", 2)
|
|
self.expect("breakpoint disable .", error=True, substrs=["no current thread"])
|
|
|
|
def _stop_location(
|
|
self, thread: lldb.SBThread, bp: lldb.SBBreakpoint
|
|
) -> lldb.SBBreakpointLocation:
|
|
# At a breakpoint stop, the stop reason data has the following structure:
|
|
# [bp1_id, loc1_id, bp2_id, loc2_id, ...]
|
|
self.assertEqual(
|
|
thread.GetStopReasonDataCount(),
|
|
2,
|
|
"stop should be for one breakpoint only",
|
|
)
|
|
loc_id = thread.GetStopReasonDataAtIndex(1)
|
|
return bp.FindLocationByID(loc_id)
|