Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime.epollwait() /usr/local/go/src/runtime/sys_linux_amd64.s:725 (PC: 0x4791a0) #2583

Closed
zhangguanzhang opened this issue Jul 13, 2021 · 7 comments

Comments

@zhangguanzhang
Copy link

zhangguanzhang commented Jul 13, 2021

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output,
stacktraces, etc) as linked gists.

  1. What version of Delve are you using (dlv version)?

windows

$ dlv version
Delve Debugger
Version: 1.6.1
Build: $Id: 114218c22f3791287c4bc2f4ff35a846a1416ee9 $

Linux:

$ dlv version
Delve Debugger
Version: 1.6.1
Build: $Id: 114218c22f3791287c4bc2f4ff35a846a1416ee9 $
  1. What version of Go are you using? (go version)?

windows

go version go1.16.5 windows/amd64

Linux

go version go1.16.5 linux/amd64
  1. What operating system and processor architecture are you using?
x86_64
  1. What did you do?

on the Linux os, GOROOT is /usr/local/go

mkdir temp
cd temp
export GO111MODULE=on
cat > main.go <<EOF
package main

import "github.com/gin-gonic/gin"

func main() {
        var count int
	r := gin.Default()
	r.GET("/ping", func(c *gin.Context) {
                count++
		c.JSON(200, gin.H{
			"message": "pong",
                        "count": count,
		})
	})
	r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}
EOF
go mod init
go mod tidy
go build -gcflags="all=-trimpath=$PWD -N -l" -asmflags "all=-trimpath=$PWD"  -o gin-demo main.go 
./gin-demo
# use the another tty run the dlv
dlv attach $(pgrep gin-demo) --listen=:2345 --headless=true --log=true  \
  --log-output=debugger,debuglineerr,gdbwire,lldbout,rpc --accept-multiclient --api-version=2

on my windows, my GOROOT is D:\Install\Go

$  dlv connect 192.168.2.111:2345
Type 'help' for list of commands.
ls
> runtime.epollwait() /usr/local/go/src/runtime/sys_linux_amd64.s:725 (PC: 0x4791a0)
Warning: debugging optimized function
Command failed: open /usr/local/go/src/runtime/sys_linux_amd64.s: The system cannot find the path specified.
  1. What did you expect to see?
  2. What did you see instead?
@aarzilli
Copy link
Member

You can use the substitute-path configuration option in .dlv/config.yml, or the config substitute-path (see help config) to map remote paths to local paths.

@zhangguanzhang
Copy link
Author

config substitute-path /usr/local/go D:\Install\Go

It works, thanks

@zhangguanzhang
Copy link
Author

but this does not display the format:

$ dlv connect 192.168.2.111:2345
Type 'help' for list of commands.
config substitute-path /usr/local/go D:\Install\Go
b main.go:10
Command failed: Breakpoint exists at main.go:10 at 892500
c
> main.main.func1() main.go:10 (hits goroutine(19):1 total:2) (PC: 0x892500)
Warning: listing may not match stale executable
     5: func main() {
     6:         var count int
     7:         r := gin.Default()
     8:         r.GET("/ping", func(c *gin.Context) {
     9:                 count++
=>  10:                 c.JSON(200, gin.H{
    11:                         "message": "pong",
    12:                         "count":   count,
    13:                 })
    14:         })
    15:         r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
p count
2

@aarzilli
I hope will be this:

$ dlv connect 192.168.2.111:2345
Type 'help' for list of commands.
(dlv) config substitute-path /usr/local/go D:\Install\Go
(dlv) b main.go:10
Command failed: Breakpoint exists at main.go:10 at 892500
(dlv) c
> main.main.func1() main.go:10 (hits goroutine(19):1 total:2) (PC: 0x892500)
Warning: listing may not match stale executable
     5: func main() {
     6:         var count int
     7:         r := gin.Default()
     8:         r.GET("/ping", func(c *gin.Context) {
     9:                 count++
=>  10:                 c.JSON(200, gin.H{
    11:                         "message": "pong",
    12:                         "count":   count,
    13:                 })
    14:         })
    15:         r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
(dlv) p count
2

@aarzilli
Copy link
Member

What format? What's the difference?

@zhangguanzhang
Copy link
Author

What format? What's the difference?

I hope this will display the (dlv)

@aarzilli
Copy link
Member

I've noticed that happening when running the Windows build of dlv on a mingw terminal. This is a problem between the library we are using for the command prompt and mintty: peterh/liner#96

@zhangguanzhang
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants