-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/debug: setting debug breakpoints by file/line broken #25715
Comments
I thought this might be the change to DW_AT_comp_dir in CL 74790 but looking at the code for LineToBreakpointPCs that's giving the error, it seems like it should be resilient to that. https://github.com/golang/debug/blob/cb5e6d581c5b9d2e229187cecb199106564df20e/dwarf/line.go#L47-L94 So I'm not sure offhand. @fabxc, can you put your repro somewhere I can try it? cc @zombiezen |
Thanks for looking into this. The following gist shows a minimal example: https://gist.github.com/fabxc/99c9f81adafda4969deafad94ed14224 |
Ouch. x/debug/dwarf (this code doesn't exist in pkg/debug/dwarf) assumes that there's only one CU: Fixing it probably isn't too hard but requires more than a couple minutes of thought to do right. |
Seems like any related code was purged from The Go cloud debugger agent vendored the former |
Moving to googleapis/google-cloud-go#1079. |
I tried to setup the GCP cloud debugger for a Go application but it fails to set breakpoints with:
error setting breakpoint at scrape/scrape.go:818: couldn't find file "scrape/scrape.go"
.I reproduced this locally by loading a compiled Go program with
golang.org/x/debug/local.New
. CallingProgram.BreakpointAtLine("scrape/scrape.go", 818)
fails with the same error. Using more specific paths (e.g. full file path at compile time) does not change anything.Setting a breakpoint directly through symbol name with
Program.BreakpointAtFunction
works.When re-compiling the debugged program with go1.9,
BreakpointAtLine
works without issues again.In both cases the binary was compiled with
-gcflags='-N -l'
andCGO_ENABLED=0
.This blog post reported a similar problem some time ago. I could not find a matching issue though.
The text was updated successfully, but these errors were encountered: