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

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAD_8WbL4n%3DAKmDrkrSpZZQ-3VY8c_Z048QT0BsEn2q4MgaeZ6Q%40mail.gmail.com.

Reply via email to