Replies: 2 comments
-
See issue #3871
Il mer 11 dic 2024, 16:36 Volodymyr ***@***.***> ha scritto:
… How can I make dlv run my application without stopping, but then later
when I decide to connect to it from a client remotely I could set a
breakpoint to stop the execution? I'd set the --continue and
--accept-multiclient thinking that is what needed for it to work, but then
when I try to connect from vscode -- new breakpoints don't do anything.
—
Reply to this email directly, view it on GitHub
<#3877>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKEBEESRTSPDG2O5JTN2D2FBLYPAVCNFSM6AAAAABTNYMZ5KVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXGY2TQNZVGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@aarzilli Thank you for answering. I changed debugAdapter in my vscode config: {
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"debugAdapter": "dlv-dap",
"port": 2345,
"host": "127.0.0.1",
"apiVersion": 2,
"showLog": true
} The directory structure of the debugging session inside the docker container is the same as the directory structure of the source code in my local host (I just copied the executable to docker container) so no need for the FROM golang:1.23.2-alpine
ADD myapp /usr/bin/myapp
RUN go install github.com/go-delve/delve/cmd/dlv@latest
EXPOSE 2345
ENTRYPOINT dlv --log --log-output=debugger,dap,rpc \
--listen=:2345 --headless=true --api-version=2 \
exec --accept-multiclient /usr/bin/myapp However any requested breakpoint fails (initially set or later) and the server app continues to execute: {
"verified": false,
"message": "input/output error"
} The rest of the logs from dlv: $ docker run -p 8989: 8989 -p 2345: 2345 -it policy-debug:latest
API server listening at: [
: :
]: 2345
2024-12-12T10: 58: 21Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2024-12-12T10: 58: 21Z debug layer=rpc API server pid = 1
2024-12-12T10: 58: 21Z info layer=debugger launching process with args: [/usr/bin/myapp
]
2024-12-12T10: 58: 21Z warning layer=debugger asyncpreemptoff field unreadable: input/output error
2024-12-12T10: 58: 21Z debug layer=debugger Adding target 12 "/usr/bin/rosetta-wrapper /usr/bin/myapp /usr/bin/myapp"2024-12-12T10: 58: 21Z warning layer=rpc methodListFunctionshas wrong number of ins: 4
2024-12-12T10: 58: 39Z debug layer=rpc serving DAP on new connection
2024-12-12T10: 58: 39Z debug layer=dap DAP connection 1 started
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 1,
"type": "request",
"command": "initialize",
"arguments": {
"clientID": "vscode",
"clientName": "Visual Studio Code",
"adapterID": "go",
"locale": "en",
"linesStartAt1": true,
"columnsStartAt1": true,
"pathFormat": "path",
"supportsVariableType": true,
"supportsVariablePaging": true,
"supportsRunInTerminalRequest": true,
"supportsMemoryReferences": true,
"supportsProgressReporting": true,
"supportsInvalidatedEvent": true,
"supportsMemoryEvent": true,
"supportsArgsCanBeInterpretedByShell": true,
"supportsStartDebuggingRequest": true
}
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 1,
"success": true,
"command": "initialize",
"body": {
"supportsConfigurationDoneRequest": true,
"supportsFunctionBreakpoints": true,
"supportsConditionalBreakpoints": true,
"supportsEvaluateForHovers": true,
"supportsSetVariable": true,
"supportsExceptionInfoRequest": true,
"supportsDelayedStackTraceLoading": true,
"supportsLogPoints": true,
"supportsDisassembleRequest": true,
"supportsClipboardContext": true,
"supportsSteppingGranularity": true,
"supportsInstructionBreakpoints": true
}
}
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 2,
"type": "request",
"command": "attach",
"arguments": {
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"debugAdapter": "dlv-dap",
"port": 2345,
"host": "127.0.0.1",
"apiVersion": 2,
"showLog": true,
"__configurationTarget": 6,
"packagePathToGoModPathMap": {},
"showRegisters": false,
"showGlobalVariables": false,
"substitutePath": [],
"logOutput": "debugger",
"dlvFlags": [],
"hideSystemGoroutines": false,
"dlvToolPath": "/Users/user/go/bin/dlv",
"env": {
"GODEBUG": "true",
"GOPATH": "/Users/user/go"
},
"__sessionId": "5614ebb2-0a05-407d-8220-0d738bf25ffc"
}
}
2024-12-12T10: 58: 39Z debug layer=dap parsed launch config: {
"mode": "remote",
"backend": "default",
"stackTraceDepth": 50
}
2024-12-12T10: 58: 39Z debug layer=dap debugger already started
2024-12-12T10: 58: 39Z debug layer=dap halting
2024-12-12T10: 58: 39Z debug layer=dap process not running
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "event",
"event": "capabilities",
"body": {
"capabilities": {
"supportTerminateDebuggee": true
}
}
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "event",
"event": "initialized"
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 2,
"success": true,
"command": "attach"
}
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 3,
"type": "request",
"command": "setBreakpoints",
"arguments": {
"source": {
"name": "main.go",
"path": "/Users/user/work/personal/dlv-testing/main.go"
},
"breakpoints": [
{
"line": 9
},
{
"line": 14
},
{
"line": 20
},
{
"line": 22
}
],
"lines": [
9,
14,
20,
22
]
}
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 3,
"success": true,
"command": "setBreakpoints",
"body": {
"breakpoints": [
{
"verified": false,
"message": "input/output error"
},
{
"verified": false,
"message": "input/output error"
},
{
"verified": false,
"message": "input/output error"
},
{
"verified": false,
"message": "input/output error"
}
]
}
}
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 4,
"type": "request",
"command": "setFunctionBreakpoints",
"arguments": {
"breakpoints": []
}
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 4,
"success": true,
"command": "setFunctionBreakpoints",
"body": {
"breakpoints": []
}
}
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 5,
"type": "request",
"command": "setInstructionBreakpoints",
"arguments": {
"breakpoints": []
}
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 5,
"success": true,
"command": "setInstructionBreakpoints",
"body": {
"breakpoints": []
}
}
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 6,
"type": "request",
"command": "configurationDone"
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "event",
"event": "output",
"body": {
"category": "console",
"output": "Type 'dlv help' for list of commands.\n"
}
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 6,
"success": true,
"command": "configurationDone"
}
2024-12-12T10: 58: 39Z debug layer=debugger continuing
2024-12-12T10: 58: 39Z debug layer=debugger ContinueOnce
2024-12-12T10: 58: 39Z debug layer=dap [<- from client
]{
"seq": 7,
"type": "request",
"command": "threads"
}
2024-12-12T10: 58: 39Z debug layer=dap [-> to client
]{
"seq": 0,
"type": "response",
"request_seq": 7,
"success": true,
"command": "threads",
"body": {
"threads": [
{
"id": -1,
"name": "Current"
}
]
}
}
2024-12-12T10: 58: 39Z debug layer=debugger callInjection protocol on: 2024-12-12T10: 58: 39Z debug layer=debugger 12 PC=0x800000025030
2024-12-12T10: 58: 39Z debug layer=debugger ContinueOnce
Starting the server... |
Beta Was this translation helpful? Give feedback.
-
How can I make dlv run my application without stopping, but then later when I decide to connect to it from a client remotely I could set a breakpoint to stop the execution? I'd set the --continue and --accept-multiclient thinking that is what needed for it to work, but then when I try to connect from vscode -- new breakpoints don't do anything.
Beta Was this translation helpful? Give feedback.
All reactions