Questions tagged [delve]

Delve is a debugger for Go

Delve is a debugger for the Go. Most Go editors/IDEs use delve as the backend for their debugger features.

Homepage.

201 questions
4
votes
1 answer

Cannot set breakpoint in golang packages in Intellij 2020.1

I have a simple web app which has cmd/ and pkg/ folders. As a convention, I'm importing packages in *.go files in cmd folder. Setting breakpoints work fine in any file in cmd but it doesn't work in packages. Error message is: could not find…
baqx0r
  • 105
  • 1
  • 2
  • 11
4
votes
1 answer

How to inspect memory region of a core dump with Delve?

Given a core dump of a Go service, is there any command on Delve that can inspect memory region? We are trying to find out what is occupying the heap.
Dian Bakti
  • 310
  • 5
  • 15
4
votes
3 answers

Unable to debug Go code: could not launch process: decoding dwarf section info at offset 0x0: too short

we are trying to debug Go code and getting this error: could not launch process: decoding dwarf section info at offset 0x0: too short our settings: WITSC02X6385JGH:orderer sjain68$ uname -a Darwin WITSC02X6385JGH 17.7.0 Darwin Kernel Version…
morpheus
  • 18,676
  • 24
  • 96
  • 159
4
votes
1 answer

Debugging with Delve: execute function

I setup a breakpoint in my Go code with runtime.Breakpoint(), save the file (my editor, Atom with go-plus installed, runs go install . on save). Then I run Delve in terminal with dlv debug, and type continue after it starts. When the breakpoint…
Dušan Maďar
  • 9,269
  • 5
  • 49
  • 64
4
votes
1 answer

golang doing unexpected heap memory allocation

While benchmarking, I noticed a surprising heap memory allocation. After reducing the repro, I ended up with the following: // --- Repro file --- func memAllocRepro(values []int) *[]int { for { break } return &values } // ---…
djme
  • 51
  • 4
3
votes
0 answers

Goland debugger does step into functions

A couple of GoLand versions ago, the GoLand debugger stopped stepping into functions properly. It works partially but with annoying caveats. The debugger is stopping on breakpoints and step-over is working fine, but when I step into a function: the…
user3913439
  • 396
  • 1
  • 10
3
votes
0 answers

Go Delve debugger just hangs when debugging WSL2-target from within GoLand

That's a question that goes hand in hand with this one here. Difference: in the linked question I am using GoLand from within WSL (having Run Target set to its default which is "Local Machine") and in this question I am using GoLand from outside WSL…
marc wellman
  • 5,808
  • 5
  • 32
  • 59
3
votes
3 answers

Unable to debug Golang on Vscode M1 Mac (arm64)

I have an M1 mac and cannot invoke functions via DLV in VSCode. Unable to evaluate expression: backend does not support function calls Delve Debugger Version: 1.8.2 ❯ go version …
Ryan
  • 1,102
  • 1
  • 15
  • 30
3
votes
0 answers

Delve - instruct binary to wait for client to connect

I'm currently developing a plugin for a product. This product invokes this plugin, written in GO, which runs for a very short time. Because it runs so quickly, it makes it very hard (almost impossible with my knowledge) to attach delve client to…
Matej
  • 7,728
  • 4
  • 23
  • 30
3
votes
1 answer

Go plugin debugging

There is a golang application that loads the plugin at runtime. I am developing this plugin and I would like to ask if there is an opportunity to debug the code of my plugin? I tried to run delve by compiling both the application and the plugin with…
3
votes
0 answers

How to specify port, on which debugger will launch Go app, in VSCode

I am trying to debug Go app. Launch config works fine, but seems dlv picking up random port every time debugger starts, which I can see from my logs in console the port is "0"(which means random one): 2021/12/23 15:16:57 Serving on port: 0 Compare…
Ivan S
  • 31
  • 2
3
votes
1 answer

Go & VS Code Debugging | manually setting variable, not appearing in Locals, using Dlv

I'm trying to "force" my Go system to behave in a particular manner to make my "testing" easier. I have the following code snippet: func SendTokenProcessFromModel(process model.Process) (*SendTokenProcess, error) { cdc := codec.New() var…
Ben
  • 41
  • 8
3
votes
0 answers

Unable to debug Go code on Windows using VSCode/GoLand (Getting '%1 is not a valid Win32 application')

When I am trying to debug this Go application using VS Code and dlv, I get the following error: Failed to launch: could not launch process: fork/exec C:\Users\MyUser\Workspaces\goworkspace\github.com...__debug_bin.exe:%1 is not a valid Win32…
SDB
  • 61
  • 1
  • 4
3
votes
2 answers

how to show float value of decimal.Decimal during delve mozilla rr(record-replay) replay session

How can we easily see the float value of decimal.Decimal value in delve session. especially in dlv replay session recorded by mozilla rr. (dlv) args underlyingPx = github.com/shopspring/decimal.Decimal {value: ("*math/big.Int")(0xc00101cca0), exp:…
whunmr
  • 2,435
  • 2
  • 22
  • 35
3
votes
3 answers

How can I simulate interactive console in VSCode debugger?

I am trying to debug this Go program which reads text and outputs it to console via VSCode debugger. package main import ( "bufio" "fmt" "os" ) func main() { reader := bufio.NewReader(os.Stdin) fmt.Print("Enter text: ") …
ik1ne
  • 1,041
  • 15
  • 20