Closed maliyan closed 1 year ago
It is very likely that, when you attach to that program, that line 16 will have already been executed. Use the debug
or exec
commands instead of attach
.
It is very likely that, when you attach to that program, that line 16 will have already been executed. Use the
debug
orexec
commands instead ofattach
.
Thanks Reply. I have a question, what scene does attach use?
It's for attaching to a running process.
Please answer the following before submitting your issue:
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?
x86_64
What did you do? I want to know how Fasthttp works, here is a very simple example.
import ( "flag" "fmt" "log"
)
func main() { flag.Parse()
}
func requestHandler(ctx *fasthttp.RequestCtx) { fmt.Fprintf(ctx, "Hello, world!\n\n")
}
What did you expect to see? when execute
continue
, it would show source code at break point.What did you see instead? Connect from MacOS(client), set break point, and then
continue
, debugger seems waitting for some kind of interactive.After setting the breakpoint, the log output of the server is similar to this: