]> Cypherpunks repositories - gostls13.git/commit
cmd/link: use . as DW_AT_comp_dir
authorHeschi Kreinick <heschi@google.com>
Thu, 16 Nov 2017 21:19:19 +0000 (16:19 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 21 Nov 2017 15:22:20 +0000 (15:22 +0000)
commit4a3d408d18df344dd8e597b46f7ddb963a9d9ddf
tree92ecbd6c6135e8b93452aa600af3199bd52a192d
parent556fb16bbda6c9312d8862cfce2d0c03e5ce0426
cmd/link: use . as DW_AT_comp_dir

Go's DWARF usually has absolute paths, in which case DW_AT_comp_dir
doesn't matter. But the -trimpath flag produces relative paths, and
then the spec says that they are relative to _comp_dir.

There's no way to know what the "right" value of _comp_dir is without
more user input, but we can at least leave the paths alone rather than
making them absolute.

After this change, Delve can find sources to a program built with
-gcflags=-trimpath=$(pwd) as long as it's run in the right directory.

Change-Id: I8bc7bed098e352d2c06800bfbbe14e8392e1bbed
Reviewed-on: https://go-review.googlesource.com/78415
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/link/internal/ld/dwarf.go