I compiled a simple go 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 attached to its pid
and executed break
and break 11
.
gdb --pid=<pid>
Gdb reports that the breakpoints are successfully set, but they don't ever get hit. Is there a way to get this working?