-
Notifications
You must be signed in to change notification settings - Fork 700
Add hack/codesign/debugserver
that wraps the LLDB debugserver to codesign the target executable.
#4052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AkihiroSuda
merged 1 commit into
lima-vm:master
from
norio-nomura:add-hack-codesign-debugserver
Sep 22, 2025
Merged
Add hack/codesign/debugserver
that wraps the LLDB debugserver to codesign the target executable.
#4052
AkihiroSuda
merged 1 commit into
lima-vm:master
from
norio-nomura:add-hack-codesign-debugserver
Sep 22, 2025
+113
−0
Conversation
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
AkihiroSuda
reviewed
Sep 18, 2025
AkihiroSuda
reviewed
Sep 19, 2025
AkihiroSuda
reviewed
Sep 19, 2025
ba335d5
to
e8500c4
Compare
…design the target executable. # `hack/codesign/debugserver` This script wraps the LLDB `debugserver` to `codesign` the target executable. This is needed for [Delve](https://github.com/go-delve/delve) to work properly on macOS with the virtualization framework. ## How to use this script with Delve ### Use `DELVE_DEBUGSERVER_PATH` environment variable Override `debugserver` by setting the `DELVE_DEBUGSERVER_PATH` environment variable. Ref: [Environment variables - Using Delve](https://github.com/go-delve/delve/blob/master/Documentation/usage/README.md#environment-variables) e.g. in `.vscode/launch.json`: ```jsonc { "version": "0.2.0", "configurations": [ { "name": "hostagent for input instance", "type": "go", "request": "launch", "mode": "debug", // Use integratedTerminal to stop using ctrl+C "console": "integratedTerminal", "program": "${workspaceFolder}/cmd/limactl", "buildFlags": [ "-ldflags=-X github.com/lima-vm/lima/pkg/version.Version=2.0.0-alpha.0", ], "env": { "CGO_ENABLED": "1", "DELVE_DEBUGSERVER_PATH": "${workspaceFolder}/hack/codesign/debugserver", "LIMA_SSH_PORT_FORWARDER": "true", }, "cwd": "${userHome}/.lima/${input:targetInstance}", "args": [ "--debug", "hostagent", "--pidfile", "ha.pid", "--socket", "ha.sock", "--guestagent", "${workspaceFolder}/_output/share/lima/lima-guestagent.Linux-aarch64", "${input:targetInstance}" ], }, ], "inputs": [ { "id": "targetInstance", "type": "promptString", "description": "Input target instance parameter for `limactl` command", } ] } ``` ### Override `debugserver` in the PATH You can also override the `debugserver` in the PATH environment variable. e.g. in `.vscode/launch.json`: ```diff "env": { "CGO_ENABLED": "1", - "DELVE_DEBUGSERVER_PATH": "${workspaceFolder}/hack/codesign/debugserver", + "PATH": "${workspaceFolder}/hack/codesign:${env:PATH}", }, ``` Signed-off-by: Norio Nomura <[email protected]>
e8500c4
to
77f5a1f
Compare
fixed ltag violation |
AkihiroSuda
approved these changes
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Thanks! 🙏🏻 |
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.
hack/codesign/debugserver
This script wraps the LLDB
debugserver
tocodesign
the target executable. This is needed for Delve to work properly on macOS with the virtualization framework.How to use this script with Delve
Use
DELVE_DEBUGSERVER_PATH
environment variableOverride
debugserver
by setting theDELVE_DEBUGSERVER_PATH
environment variable.Ref: Environment variables - Using Delve
e.g. in
.vscode/launch.json
:Override
debugserver
in the PATHYou can also override the
debugserver
in the PATH environment variable.e.g. in
.vscode/launch.json
: