Comments (13)
@xsank: this should be fixed by f6e8fb3 (see #594), update your dlv.
from delve.
Appears to be related to Go#8973, building with go build -ldflags="-linkmode=internal"
appears to work just fine.
Feel free to close this issue if you see nothing you'd like to fix here.
from delve.
Thanks, this surfaced another issue of the -v
flag not working, fixed now.
I'll keep this issue open because I can probably get a fix in to Delve to handle this until 1.5 lands.
Also, it's preferred to use dlv run
over building yourself, simply because run
compiles the program to be a bit more debugger friendly.
from delve.
I just hit this on c3ade94 (
could not attach to pid 39933: decoding dwarf section info at offset 0x0: too short
Even more concerning is that dlv
killed the process I was trying to debug.
from delve.
@ahl do you have steps we can follow to reproduce this or a binary to examine?
from delve.
package main
import "fmt"
func main() {
for {
fmt.Println("all work and no play makes jack a dull boy")
}
}
go run test.go
and dlv attach $(pgrep test)
on darwin:
could not attach to pid 68703: decoding dwarf section info at offset 0x0: too short
Perhaps you're not supposed to use dlv
with go run
? Irrespective "do no harm" is job one for a debugger and my process should not end up dead in any circumstance.
This also happens on a non-golang binary. Again, the debugger should never kill target process.
from delve.
This also happens if you use -ldflags -s
to get macOS codesigning to work golang/go#11887
from delve.
i use the idea to debug grafana project on windows,but meet the same problem.
could not launch process: decoding dwarf section info at offset 0x0: too short
after i solved this, and success use the dlv debugging, another trouble comes...
it always suspend in here from github.com/go-stack/stack/stack.go
here is my usage:
C:\Users\.IntelliJIdea15\config\plugins\Go\lib\dlv\windows\dlv.exe --listen=localhost:51358 --headless=true exec "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\jre\jre\bin\bin\Build main.exe" --
GOROOT=C:/Go
GOPATH=D:/code/mine/go
C:/Go\bin\go.exe build -ldflags -linkmode=internal -o "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.2\jre\jre\bin\bin\Build main.exe" -gcflags "-N -l" github.com/grafana/grafana/pkg/cmd/grafana-server
API server listening at: 127.0.0.1:51358
without any warnings. but it just hang there and cannot move on.
IDEA:15.0.2
Go:1.7.3
OS:widnows 7
from delve.
@aarzilli ,is there any windows release dlv i can use or i have to build it myself?
from delve.
thank you for your help! @aarzilli
from delve.
@sank: you have to build it yourself.
from delve.
I am seeing this error in Visual Studio code Version 1.12.2 (1.12.2) on Mac:
2017/05/17 13:41:33 server.go:73: Using API v1
2017/05/17 13:41:33 debugger.go:97: launching process with args: [./debug.test]
could not launch process: decoding dwarf section info at offset 0x0: too short
Process exiting with code: 1
GOPATH env variable is set and dlv is installed in $GOPATH/bin directory
launch.json looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "go test",
"type": "go",
"request": "launch",
"mode": "test",
"remotePath": "",
"port": 5000,
"host": "127.0.0.1",
"program": "<set to directory that contains go test files>",
"env": {},
"args": [],
"showLog": true
}
]
}
I have tried adding GOPATH variable to "env" configuration property in launch.json but got the same error. I am using delve version 1.0.0-rc.1
from delve.
Open a new issue and fill the form.
from delve.
Related Issues (20)
- polish go1.23 range-over-func UX HOT 1
- Does delve ignore // line instructions during debug HOT 1
- Breakpoints do not work in packages with a TestMain(*testing.M) function HOT 1
- Unable to print a package string const value during a breakpoint HOT 1
- Error clearing stack watchpoint HOT 2
- Add defer functions to follow-calls tracing option
- Breakpoint line numbers not matching HOT 1
- Hitting compile error when launching delve in devbox HOT 4
- `undefined behavior - version of Delve is too old for Go version 1.22.3 (maximum supported version 1.20)` HOT 2
- trace: allow tracing from (or skip tracing on) G-less threads
- panic when data length is greater than memCache size
- Unable to find escape variables when using Delve HOT 7
- Fail to set watchpoint after clearing one of four HOT 3
- Dwarf parsing infinite loop causes OOM HOT 1
- Feature request: restart the current function HOT 6
- Seeing a warning that delve is too old for the latest Go version 1.22.5 HOT 1
- align the output of vars with 'expresson' spec
- Delve Fails to Locate Source Files Across All Projects on Apple M1 Pro (macOS) with "no source available" Error HOT 1
- Improper string representation of Google uuid.UUID type HOT 1
- Inconsistent go and delve expression results
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delve.