Giter Site home page Giter Site logo

Comments (13)

aarzilli avatar aarzilli commented on August 22, 2024 1

@xsank: this should be fixed by f6e8fb3 (see #594), update your dlv.

from delve.

quarnster avatar quarnster commented on August 22, 2024

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.

derekparker avatar derekparker commented on August 22, 2024

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.

ahl avatar ahl commented on August 22, 2024

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.

aarzilli avatar aarzilli commented on August 22, 2024

@ahl do you have steps we can follow to reproduce this or a binary to examine?

from delve.

ahl avatar ahl commented on August 22, 2024
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.

gabriel avatar gabriel commented on August 22, 2024

This also happens if you use -ldflags -s to get macOS codesigning to work golang/go#11887

from delve.

xsank avatar xsank commented on August 22, 2024

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...
image
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.

xsank avatar xsank commented on August 22, 2024

@aarzilli ,is there any windows release dlv i can use or i have to build it myself?

from delve.

xsank avatar xsank commented on August 22, 2024

thank you for your help! @aarzilli

from delve.

aarzilli avatar aarzilli commented on August 22, 2024

@sank: you have to build it yourself.

from delve.

aambati avatar aambati commented on August 22, 2024

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.

aarzilli avatar aarzilli commented on August 22, 2024

Open a new issue and fill the form.

from delve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.