249 questions
-2
votes
0
answers
107
views
How can I make the custom type (Decimal struct that wraps math/big.Int) display correctly in VSCode or Delve debugger?
I have a custom type defined as follows:
// Package link: https://github.com/shopspring/decimal
//
type Decimal struct {
inner decimal.Decimal
}
decimal.Decimal wraps math/big.Int internally.
...
1
vote
0
answers
134
views
dlv 'Warning: debugging optimized function' despite 'go build -gcflags "-N -l"'
I compile my binary like this go build -gcflags '-N -l', but when I run them in dlv I get Warning: debugging optimized function. My guess it's that it's a different host than the build host and the ...
0
votes
0
answers
80
views
Why aren't application logs (e.g., fmt.Println, logrus) shown when debugging with Delve in headless mode?
I'm running a Go application using urfave/cli, where start is a subcommand.
I'm using Delve (dlv) in headless mode to enable remote debugging from IDE like VS Code or IntelliJ IDEA. Here's the command ...
1
vote
0
answers
62
views
Delve debugger splits command line argument by space
I have a program that is supposed to take a json string as input and run some token extraction logic. I'm using flag.Parse to parse the string from the command line and this works when i run the ...
4
votes
1
answer
208
views
Debugging go HelloWorld api with docker and delve on MacBook Pro M2 and Goland
I have simple Hello World go application with single endpoint on :8080
I have dockerized it and added delve in Dockerfile
Then I run this app with docker-compose up --build -d and then docker ps it:
...
1
vote
1
answer
279
views
Run Single Go Test With launch.json Configuration
Is it possible to run a single Go test in VS Code with a launch.json configuration?
Here's my OS and Go version
Windows 11
Delve Debugger Version: 1.24.0
go version go1.23.4 windows/amd64
Right now, ...
-1
votes
1
answer
1k
views
invalid memory address or nil pointer dereference panic from delve package
Delve version: 1.23.1
Go version: go1.23.2 darwin/arm64
Cursor version: 0.42.4 (VSCode 1.93.1)
OS: MacOS 14.6
Architecture: M1 arm64
When running the debugger in VS Code, I get the following panic ...
1
vote
1
answer
121
views
How can I make VSCode act as a server to debug golang apps with delve when I run `dlv dap --client-addr=:2345` in the remote machine?
I'd expect to find an option in launch.json that would allow me to specify the port VSCode should listen to for connections so I can tell dlv to connect as a client to VSCode with its --client-addr ...
1
vote
1
answer
241
views
Go project specific - Debugger (delve), binary exec, doesn't work
For a particular Go project (and not for others), delve debugger doesn't work. On vscode when I try to run the debugger I get the following:
decoding dwarf section info at offset 0x0: too short - ...
10
votes
4
answers
9k
views
Getting the following error while trying to debug go tests in VSCode on mac
Failed to launch: could not launch process: error reading debug_info: decoding dwarf section info at offset 0xac6f38: DW_FORM_strx with no .debug_str_offsets section
I'm using:
dlv - 1.23.0
Go - 1.22....
1
vote
1
answer
270
views
How to setcap berore debugging golang application in VSCode?
How to apply setcap before debugging Go application in VSCode in Linux?
I have an app that requires special capabilities. Normally to run application from shell I'd write something like
go build
sudo ...
1
vote
0
answers
170
views
Delve hangs at "DAP server listening at:". on Windows 11 ARM64 VM
I am trying to debug some go code on my windows 11 arm64 VM running on my mac. It has been 3 days that I am trying to fix this and I don't know why it keeps getting stuck at "DAP server listening ...
2
votes
0
answers
109
views
How do you add aliases for the dlv debugger?
When I use Go's command line debugger, dlv, I start by running the Go code from dlv like so:
$ dlv debug simple.go
Now, I cannot simply hit "n" to run the first line of your program. If I ...
1
vote
0
answers
50
views
Cannot run dlv for go debug with administrator privileges in vscode
My configuration in launch.json is as follows:
{
"name": "Launch as Root",
"type": "go",
"request": "launch",
"mode&...
-2
votes
1
answer
3k
views
How do I resolve the warning "compile: version "go1.21.10" does not match go tool version "go1.22.5" shown when I try to debug Go tests in VS Code
When I click the "debug benchmark" or "debug test" options that Microsoft Visual Studio Code adds above my func Test_ and func Benchmark_ line, I get taken to the debug consle ...