Build some test binaries alongside the debugger; add shared-library debugging test#1105
Open
xusheng6 wants to merge 1 commit into
Open
Build some test binaries alongside the debugger; add shared-library debugging test#1105xusheng6 wants to merge 1 commit into
xusheng6 wants to merge 1 commit into
Conversation
…ebugging test Add opt-in infra to build debugger unit-test binaries alongside the debugger (-DBUILD_DEBUGGER_TEST_BINARIES=ON), so adding a new test no longer requires a separate build. The full, signed, multi-platform set is still produced by the debugger-test-binaries CI. Implements #818. The previous test/src sources and test/CMakeLists.txt were unused (binary builds moved to the debugger-test-binaries repo), so remove them and add a fresh, focused CMakeLists that defaults to the host architecture. Add a shared library and a loader executable plus a test that analyzes the library while setting the executable path to the loader. This is the scenario from #540 and regresses #1104, where the debugger created the LLDB target from the input file (the library) and dyld fell back to launching /bin/sh. The test fails against the pre-fix debugger and passes after e45cd3f. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #818 and adds a regression test for #1104 (the scenario tracked in #540).
Infra — build test binaries alongside the debugger (opt-in)
CMakeLists.txt: newBUILD_DEBUGGER_TEST_BINARIESoption (default OFF) thatadd_subdirectory(test). Adding a new test binary no longer needs a separate build.test/src/*(36 files) and the oldtest/CMakeLists.txt— these were unused since binary builds moved to thedebugger-test-binariesCI repo.test/CMakeLists.txt: defaultsARCHto the host and builds only what the host toolchain can produce.test/README.mdrewritten to document the new model..gitignore: allow committing the testshared_lib.{so,dylib}(otherwise caught by the blanket*.so/*.dylibignore).New binaries + test (#540)
test/src/shared_lib.c— shared library exportingshared_lib_add.test/src/load_shared_lib.c— executable that links and calls into it (@loader_path/$ORIGINso the library resolves beside it).shared_lib.dylib/load_shared_libforDarwin-arm64andDarwin-x86_64.test_debug_shared_library: analyzes the library, setsexecutable_pathto the loader, stops at the system entry point, and asserts the launched program is the loader (not the library, not/bin/sh), then runs to a cleanexit_code == 0(which also proves the dependent library loaded and was called).Verification
e45cd3f)The test goes green with the fix and red without it.
Follow-up
Only macOS arm64/x86_64 binaries were built locally. The Linux/Windows
shared_lib.{so,dll}+load_shared_libshould be produced by thedebugger-test-binariesCI for the test to run there.🤖 Generated with Claude Code