aboutsummaryrefslogtreecommitdiff
path: root/src/debug/dwarf/testdata
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-05-24 16:21:01 -0400
committerAustin Clements <austin@google.com>2017-05-26 14:35:20 +0000
commitc31231ccab371b31f5563a91e68720657799fe70 (patch)
tree7f039d6252213823319e747269054150965acb7c /src/debug/dwarf/testdata
parent6654e3e0a1fa1deff4acf7d5ea68cd078df7e2fa (diff)
downloadgo-c31231ccab371b31f5563a91e68720657799fe70.tar.xz
debug/dwarf: heuristically handle both UNIX and Windows paths
Currently debug/dwarf assumes all paths in line tables will be UNIX-style paths, which obviously isn't the case for binaries built on Windows. However, we can't simply switch from the path package to the filepath package because we don't know that we're running on the same host type that built the binary and we want this to work even if we're not. This is essentially the approach taken by GDB, which treats paths in accordance with the system GDB itself is compiled for. In fact, we can't even guess the compilation system from the type of the binary because it may have been cross-compiled. We fix this by heuristically determining whether paths are UNIX-style or DOS-style by looking for a drive letter or UNC path. If we see a DOS-style path, we use appropriate logic for determining whether the path is absolute and for joining two paths. This is helped by the fact that we should basically always be starting with an absolute path. However, it could mistake a relative UNIX-style path that begins with a directory like "C:" for an absolute DOS-style path. There doesn't seem to be any way around this. Fixes #19784. Change-Id: Ie13b546d2f1dcd8b02e668583a627b571b281588 Reviewed-on: https://go-review.googlesource.com/44017 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Diffstat (limited to 'src/debug/dwarf/testdata')
-rw-r--r--src/debug/dwarf/testdata/line-gcc-win.binbin0 -> 133202 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/src/debug/dwarf/testdata/line-gcc-win.bin b/src/debug/dwarf/testdata/line-gcc-win.bin
new file mode 100644
index 0000000000..583ad44dd0
--- /dev/null
+++ b/src/debug/dwarf/testdata/line-gcc-win.bin
Binary files differ