aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go
diff options
context:
space:
mode:
authorHana (Hyang-Ah) Kim <hyangah@gmail.com>2018-03-20 16:56:20 -0400
committerHyang-Ah Hana Kim <hyangah@gmail.com>2018-03-23 14:36:29 +0000
commitc6e69ec7f930191022f1369761a680eecc2e89f1 (patch)
treeeb57044879d427d13d3ff49dcbd41a01304a7d75 /src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go
parent50921bfa2e154f2e9346ebefba073c15c8afc453 (diff)
downloadgo-c6e69ec7f930191022f1369761a680eecc2e89f1.tar.xz
cmd/vendor/.../pprof: refresh from upstream@a74ae6f
Merges updates listed in https://github.com/google/pprof/compare/0e0e5b725...a74ae6f Update #24443 cmd/vendor/vendor.json was updated manually. Change-Id: I15d5fe82ac18263d4d54f5773cee0e197e93dd59 Reviewed-on: https://go-review.googlesource.com/101736 Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
Diffstat (limited to 'src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go b/src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go
index 390f952feb..94edd0711a 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/binutils/binutils.go
@@ -111,6 +111,11 @@ func initTools(b *binrep, config string) {
defaultPath := paths[""]
b.llvmSymbolizer, b.llvmSymbolizerFound = findExe("llvm-symbolizer", append(paths["llvm-symbolizer"], defaultPath...))
b.addr2line, b.addr2lineFound = findExe("addr2line", append(paths["addr2line"], defaultPath...))
+ if !b.addr2lineFound {
+ // On MacOS, brew installs addr2line under gaddr2line name, so search for
+ // that if the tool is not found by its default name.
+ b.addr2line, b.addr2lineFound = findExe("gaddr2line", append(paths["addr2line"], defaultPath...))
+ }
b.nm, b.nmFound = findExe("nm", append(paths["nm"], defaultPath...))
b.objdump, b.objdumpFound = findExe("objdump", append(paths["objdump"], defaultPath...))
}
@@ -306,9 +311,9 @@ func (f *fileNM) SourceLine(addr uint64) ([]plugin.Frame, error) {
}
// fileAddr2Line implements the binutils.ObjFile interface, using
-// 'addr2line' to map addresses to symbols (with file/line number
-// information). It can be slow for large binaries with debug
-// information.
+// llvm-symbolizer, if that's available, or addr2line to map addresses to
+// symbols (with file/line number information). It can be slow for large
+// binaries with debug information.
type fileAddr2Line struct {
once sync.Once
file