MCPcopy Create free account
hub / github.com/google/pprof / chooseExe

Function chooseExe

internal/binutils/binutils.go:194–204  ·  view source on GitHub ↗

chooseExe finds and returns path to preferred binary. names is a list of names to search on both Linux and OSX. osxNames is a list of names specific to OSX. names always has a higher priority than osxNames. The order of the name within each list decides its priority (e.g. the first name has a higher

(names, osxNames []string, paths []string)

Source from the content-addressed store, hash-verified

192// It returns a string with path to the binary and a boolean indicating if any
193// acceptable binary was found.
194func chooseExe(names, osxNames []string, paths []string) (string, bool) {
195 if runtime.GOOS == "darwin" {
196 names = append(names, osxNames...)
197 }
198 for _, name := range names {
199 if binary, found := findExe(name, paths); found {
200 return binary, true
201 }
202 }
203 return "", false
204}
205
206// isLLVMObjdump accepts a string with path to an objdump binary,
207// and returns a boolean indicating if the given binary is an LLVM

Callers 1

initToolsFunction · 0.85

Calls 1

findExeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…