go1.14/go1.14.1 missing some debug information

93 views
Skip to first unread message

sanye

unread,
Mar 31, 2020, 8:20:05 PM3/31/20
to golang-nuts
Hello gophers,
  I have a problem when debugging with gdb using go1.14/1.14.1, set a breakpoint on entrypoint will not show line and file information, but go1.13.9 and older versions have, here is the detail

  demo.go
----------------
package main

func main() {
    println("hello world")
}

build
----------------
go build -gcflags "all=-N -l" demo.go

go1.13.9
-----------------
$ go version
go version go1.13.9 linux/amd64
$ go build -gcflags "all=-N -l" demo.go
$ gdb ./demo
...
(gdb) info files
Symbols from "/dev/shm/ex/demo".
Local exec file:
`/dev/shm/ex/demo', file type elf64-x86-64.
Entry point: 0x4542a0
...
(gdb) b *0x4542a0
Breakpoint 1 at 0x4542a0: file /dev/shm/ex/go/src/runtime/rt0_linux_amd64.s, line 8.

go1.14/go1.14.1
----------------
$ go version
go version go1.14.1 linux/amd64
$ go build -gcflags "all=-N -l" demo.go
$ gdb ./demo
...
(gdb) info files
Symbols from "/dev/shm/ex/demo".
Local exec file:
`/dev/shm/ex/demo', file type elf64-x86-64.
Entry point: 0x45cdd0
...
(gdb) b *0x45cdd0
Breakpoint 1 at 0x45cdd0

any help would be appreciated

Ian Lance Taylor

unread,
Apr 1, 2020, 12:47:07 AM4/1/20
to sanye, golang-nuts
Odd. I can recreate this, but I don't know what is going on here.
Please open a bug report at https://golang.org/issue. Thanks.

Ian

Than McIntosh

unread,
Apr 1, 2020, 11:54:07 AM4/1/20
to Ian Lance Taylor, sanye, golang-nuts
Thanks for filing the issue (https://github.com/golang/go/issues/38192). I added some comments.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWwbswFmYZmBV5vto9gvP%2Bn_ufw8VR1D9sGL38CX0rn_g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages