I compiled a simple move application with debug flags:
go build -gcflags "-N -l" -o main main.go
main.go
package main import ( "fmt" "time" ) func main() { for i := 0; true; i++ { fmt.Println("number:", i) time.Sleep(time.Second) } }
In gdb, I am tied to its pid and performed break and break 11 .
gdb --pid=<pid>
Gdb reports that breakpoints have been set successfully, but they are never hit. Is there any way to make this work?
source share