aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/addr2line
AgeCommit message (Collapse)Author
2020-12-09all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTempRuss Cox
As part of #42026, these helpers from io/ioutil were moved to os. (ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.) Update the Go tree to use the preferred names. As usual, code compiled with the Go 1.4 bootstrap toolchain and code vendored from other sources is excluded. ReadDir changes are in a separate CL, because they are not a simple search and replace. For #42026. Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/266365 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-09-17cmd/addr2line: don't assume that GOROOT_FINAL is cleanBryan C. Mills
Fixes #41447 Change-Id: I4460c1c7962d02c41622a5ea1a3c4bc3714a1873 Reviewed-on: https://go-review.googlesource.com/c/go/+/255477 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-06-10run.bat: do not unset GOROOT_FINAL before running testsBryan C. Mills
This removes the same logic from run.bat that was removed from cmd/dist in CL 236819. The duplicated logic was removed from run.bash and run.rc in CL 6531, but that part of run.bat was apparently missed (and not noticed because its effect was redundant). Also fix a path-separator bug in cmd/addr2line.TestAddr2Line that was exposed as a result. Fixes #39478 Updates #39385 Change-Id: I00054966cf92ef92a03681bf23de7f45f46fbb5e Reviewed-on: https://go-review.googlesource.com/c/go/+/237359 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-09cmd/dist: do not unset GOROOT_FINAL prior to running testsBryan C. Mills
Also do not unset it by default in the tests for cmd/go. GOROOT_FINAL affects the GOROOT value embedded in binaries, such as 'cmd/cgo'. If its value changes and a build command is performed that depends on one of those binaries, the binary would be spuriously rebuilt. Instead, only unset it in the specific tests that make assumptions about the GOROOT paths embedded in specific compiled binaries. That may cause those tests to do a little extra rebuilding when GOROOT_FINAL is set, but that little bit of extra rebuilding seems preferable to spuriously-stale binaries. Fixes #39385 Change-Id: I7c87b1519bb5bcff64babf1505fd1033ffa4f4fb Reviewed-on: https://go-review.googlesource.com/c/go/+/236819 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2019-03-08internal/testenv: remove SetModVendorBryan C. Mills
It turns out not to be necessary. Russ expressed a preference for avoiding module fetches over making 'go mod tidy' work within std and cmd right away, so for now we will make the loader use the vendor directory for the standard library even if '-mod=vendor' is not set explicitly. Updates #30228 Change-Id: Idf7208e63da8cb7bfe281b93ec21b61d40334947 Reviewed-on: https://go-review.googlesource.com/c/go/+/166357 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-03-05all: add -mod=vendor to GOFLAGS in tests that execute 'go' commands within ↵Bryan C. Mills
std or cmd Updates #30228 Updates #30240 Updates #30241 Change-Id: Idc311ba77e99909318b5b86f8ef82d4878f73e47 Reviewed-on: https://go-review.googlesource.com/c/go/+/165378 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2018-11-05cmd/addr2line: defer closing objfileMuhammad Falak R Wani
Change-Id: I19ff9d231c4cc779b0737802c3c40ee2e00934dd Reviewed-on: https://go-review.googlesource.com/c/147477 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-29cmd/go: build test binaries with -s in addition to -wRuss Cox
Fixes #19753. Change-Id: Ib20a69b1d0bcc42aa9e924918bcb578d6a560a31 Reviewed-on: https://go-review.googlesource.com/38742 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-30all: use testing.GoToolPath instead of "go"Keith Randall
This change makes sure that tests are run with the correct version of the go tool. The correct version is the one that we invoked with "go test", not the one that is first in our path. Fixes #16577 Change-Id: If22c8f8c3ec9e7c35d094362873819f2fbb8559b Reviewed-on: https://go-review.googlesource.com/28089 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-06-17cmd/addr2line: simplify windows testRuss Cox
Change-Id: I0fcc35f43bc6059e6203af6134319cfc060c4b9a Reviewed-on: https://go-review.googlesource.com/11085 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-16all: extract "can I exec?" check from tests into internal/testenvRuss Cox
Change-Id: I7b54be9d8b50b39e01c6be21f310ae9a10404e9d Reviewed-on: https://go-review.googlesource.com/10753 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-04-12cmd/addr2line: skip fork test on darwin/arm64David Crawshaw
Just like darwin/arm. Change-Id: Ia84662f58f6b1bb168cce8a9837945b1cbd175e1 Reviewed-on: https://go-review.googlesource.com/8828 Reviewed-by: Minux Ma <minux@golang.org>
2015-02-26cmd/addr2line: exclude Go tool test on darwin/armDavid Crawshaw
Change-Id: Icee6c88b7eed5fb27f046373ecf53bf64b68c696 Reviewed-on: https://go-review.googlesource.com/6191 Reviewed-by: Minux Ma <minux@golang.org>
2014-08-07cmd/addr2line, cmd/nm: factor object reading into cmd/internal/objfileRuss Cox
To do in another CL: make cmd/objdump use cmd/internal/objfile too. There is a package placement decision in this CL: cmd/internal/objfile instead of internal/objfile. I chose to put internal under cmd to make clear (and enforce) that no standard library packages should use this (it's a bit dependency-heavy). LGTM=r R=r CC=golang-codereviews https://golang.org/cl/123910043
2014-07-19cmd/addr2line, cmd/objdump: fix on amd64 Plan 9David du Colombier
Fix virtual address of the start of the text segment on amd64 Plan 9. This issue has been partially fixed in cmd/add2line, as part of CL 106460044, but we forgot to report the change to cmd/objdump. In the meantime, we also fixed the textStart address in both cmd/add2line and cmd/objdump. LGTM=aram, ality, mischief R=rsc, mischief, aram, ality CC=golang-codereviews, jas https://golang.org/cl/117920043
2014-07-09debug/plan9obj, cmd/addr2line: on Plan 9 use a.out headerAram Hăvărneanu
size instead of abusing text symbol cmd/addr2line needs to know the virtual address of the start of the text segment (load address plus header size). For this, it used the text symbol added by the linker. This is wrong on amd64. Header size is 40 bytes, not 32 like on 386 and arm. Function alignment is 16 bytes causing text to be at 0x200030. debug/plan9obj now exports both the load address and the header size; cmd/addr2line uses this new information and doesn't rely on text anymore. LGTM=0intro R=0intro, gobot, ality CC=ality, golang-codereviews, jas, mischief https://golang.org/cl/106460044
2014-07-08cmd/addr2line: skip test on androidDavid Crawshaw
LGTM=minux R=golang-codereviews, minux CC=golang-codereviews https://golang.org/cl/104600043
2014-05-20build: make nacl passRuss Cox
Add nacl.bash, the NaCl version of all.bash. It's a separate script because it builds a variant of package syscall with a large zip file embedded in it, containing all the input files needed for tests. Disable various tests new since the last round, mostly the ones using os/exec. Fixes #7945. LGTM=dave R=golang-codereviews, remyoudompheng, dave, bradfitz CC=golang-codereviews https://golang.org/cl/100590044
2014-05-16cmd/addr2line, cmd/objdump: handle Plan 9 a.out object filesDavid du Colombier
Update #7947. LGTM=iant R=rsc, iant CC=golang-codereviews https://golang.org/cl/91500044
2014-05-15cmd/addr2line,cmd/objdump: test that commands accept addresses with 0x ↵Alex Brainman
prefix and without LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/100440045
2014-05-15cmd/addr2line, cmd/objdump: fix pe text section starting addressAlex Brainman
fixes windows build LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/97500043
2014-05-10cmd/addr2line: accept optional "0x" prefix for addresses.Shenghou Ma
LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/91250043
2014-05-07cmd/addr2line: skip broken TestAddr2Line on plan9 (fixes build)Alex Brainman
Update #7947 LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/100180043
2014-05-07cmd/addr2line: works with windows pe executables nowAlex Brainman
Update #7406 Fixes #7899 LGTM=bradfitz R=golang-codereviews, rsc, bradfitz CC=golang-codereviews https://golang.org/cl/96960043
2014-04-15addr2line, objdump: write doc commentsRuss Cox
LGTM=r R=r CC=golang-codereviews https://golang.org/cl/88050046
2014-02-19cmd/addr2line: reimplement in GoRuss Cox
We never updated libmach for the new object file format, so it the existing 'go tool addr2line' is broken. Reimplement in Go to fix. LGTM=r R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/66020043
2013-07-18libmach: update for Go 1.2 pcln tableRuss Cox
The change to addr2line makes it easy to test by hand. R=golang-dev, r CC=golang-dev https://golang.org/cl/11485044
2013-03-11cmd/addr2line: exit 0 for --helpRuss Cox
This is what pprof expects, or else it won't use the program. And if it doesn't use the program, it gets very bad results. Fixes #4818. R=golang-dev, r CC=golang-dev https://golang.org/cl/7728043
2012-02-28runtime/pprof: support OS X CPU profilingRuss Cox
Work around profiling kernel bug with signal masks. Still broken on 64-bit Snow Leopard kernel, but I think we can ignore that one and let people upgrade to Lion. Add new trivial tools addr2line and objdump to take the place of the GNU tools of the same name, since those are not installed on OS X. Adapt pprof to invoke 'go tool addr2line' and 'go tool objdump' if the system tools do not exist. Clean up disassembly of base register on amd64. Fixes #2008. R=golang-dev, bradfitz, mikioh.mikioh, r, iant CC=golang-dev https://golang.org/cl/5697066