These are chat archives for derekparker/delve

14th
Aug 2018
Boran Car
@borancar
Aug 14 2018 14:14
Hey guys, sorry if this question has been asked before. I am using https://please.build/ (similar to and inspired by Bazel) to build Golang programs. please likes to put relative paths from the repo root to the source files in the DWARF information and I have not seen a way to override this behavior. I am trying to debug using GoLand's external connection, but when setting breakpoints, GoLand will give the absolute path from the root of the filesystem (/) (following https://github.com/derekparker/delve/blob/master/Documentation/api/ClientHowto.md#using-rpcservercreatebreakpoint) and dlv will reject it because the DWARF information contains only relative paths to repo root. Since I haven't seen an option to modify what GoLand gives, I was thinking along the lines of a delve override inside the RPCServer - is such an approach OK or is there something I'm fundamentally missing?
Alessandro Arzilli
@aarzilli
Aug 14 2018 14:23
I'd like to see what the DWARF inside those executables looks like
Boran Car
@borancar
Aug 14 2018 17:11

here's a sample (I'm assuming you want readelf --debug-dump=decodedline | grep CU::

CU: woz_tv/db/db.go:
CU: woz_tv/db/product/product.go:

When GoLand contacts via the RPC, it asks for
/home/boran/git/project/woz_tv/db/db.go

And these result in location not found

(again, I'm unable to use idiomatic go folder structure due to a hard constraint)

If I modify service/rpc2/server.go, func (s *RPCServer) CreateBreakpoint(arg CreateBreakpointIn, out *CreateBreakpointOut) error { to actually strip the /home/boran/git/project/, it works
Alessandro Arzilli
@aarzilli
Aug 14 2018 18:17
I'm not convinced that delve is the right place to handle this, IMHO delve is doing what the DWARF is saying, IMHO the problem is that your IDE doesn't understand your build system