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