Closed mvhatch closed 3 weeks ago
Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.
If this is about source listing not showing up (or breakpoints not being accepted) while running in a container please read our FAQ first.
What version of Delve are you using (dlv version)?
dlv version
$ dlv version Delve Debugger Version: 1.22.1 Build: $Id: 0c3470054da6feac5f6dcf3e3e5144a64f7a9a48
What version of Go are you using? (go version)?
go version
$ go version go version go1.22.2 linux/amd64
What operating system and processor architecture are you using?
Linux x86_64
What did you do? I set a breakpoint at an existing source code line
$ dlv exec ./tmp/app (dlv) ls main.main Showing /path/to/main.go:10 (PC: 0x145837c) 5: 6: "github.com/my/local/package" 7: _ "google.golang.org/grpc/encoding/gzip" 8: ) 9: 10: func main() { 11: if err := app.Run(); err != nil { 12: stdlog.Fatal(err) 13: } 14: } (dlv) b main.main:11
What did you expect to see? I expected to see a success response (e.g. Breakpoint 1 set at 0x1458388 for main.main() ./app/main.go:11)
Breakpoint 1 set at 0x1458388 for main.main() ./app/main.go:11
What did you see instead? An error message that the breakpoint could not be set, but it was for the wrong line number.
Command failed: could not find statement at /path/to/main.go:21, please use a line with a statement
When you say b main.main:11 you mean the 11th line of function main.main. Since main.main starts at line 10 that will be line 21 of the file main.go where main.main is defined.
b main.main:11
main.main
main.go
Closing, working as intended.
Please answer the following before submitting your issue:
Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.
If this is about source listing not showing up (or breakpoints not being accepted) while running in a container please read our FAQ first.
What version of Delve are you using (
dlv version
)?What version of Go are you using? (
go version
)?What operating system and processor architecture are you using?
What did you do? I set a breakpoint at an existing source code line
What did you expect to see? I expected to see a success response (e.g.
Breakpoint 1 set at 0x1458388 for main.main() ./app/main.go:11
)What did you see instead? An error message that the breakpoint could not be set, but it was for the wrong line number.