Files
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

76 lines
2.6 KiB
Python

"""
Test that LLDB can launch a linux executable through the dynamic loader and still hit a breakpoint.
"""
import lldb
import os
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@skipIfTargetDoesNotSupportSharedLibraries()
class TestLinux64LaunchingViaDynamicLoader(TestBase):
@skipIf(oslist=no_match(["linux"]))
@no_debug_info_test
def test(self):
self.build()
# Extracts path of the interpreter.
spec = lldb.SBModuleSpec()
spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
interp_section = lldb.SBModule(spec).FindSection(".interp")
if not interp_section:
return
section_data = interp_section.GetSectionData()
error = lldb.SBError()
exe = section_data.GetString(error, 0)
if error.Fail():
return
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# Set breakpoints both on shared library function as well as on
# main. Both of them will be pending breakpoints.
breakpoint_main = target.BreakpointCreateBySourceRegex(
"// Break here", lldb.SBFileSpec("main.cpp")
)
breakpoint_shared_library = target.BreakpointCreateBySourceRegex(
"get_signal_crash", lldb.SBFileSpec("signal_file.cpp")
)
inferior_exe_path = lldbutil.install_to_target(
self, self.getBuildArtifact("a.out")
)
lldbutil.install_to_target(self, self.getBuildArtifact("libsignal_file.so"))
launch_info = lldb.SBLaunchInfo(
[
"--library-path",
self.get_process_working_directory(),
inferior_exe_path,
]
)
launch_info.SetWorkingDirectory(self.get_process_working_directory())
error = lldb.SBError()
process = target.Launch(launch_info, error)
self.assertSuccess(error)
# Stopped on main here.
self.assertState(process.GetState(), lldb.eStateStopped)
thread = process.GetSelectedThread()
self.assertIn("main", thread.GetFrameAtIndex(0).GetDisplayFunctionName())
process.Continue()
# Stopped on get_signal_crash function here.
self.assertState(process.GetState(), lldb.eStateStopped)
self.assertIn(
"get_signal_crash", thread.GetFrameAtIndex(0).GetDisplayFunctionName()
)
process.Continue()
# Stopped because of generated signal.
self.assertState(process.GetState(), lldb.eStateStopped)
self.assertIn("raise", lldbutil.get_function_names(thread))