(b *binrep, config string)
| 132 | } |
| 133 | |
| 134 | func initTools(b *binrep, config string) { |
| 135 | // paths collect paths per tool; Key "" contains the default. |
| 136 | paths := make(map[string][]string) |
| 137 | for _, t := range strings.Split(config, ",") { |
| 138 | name, path := "", t |
| 139 | if ct := strings.SplitN(t, ":", 2); len(ct) == 2 { |
| 140 | name, path = ct[0], ct[1] |
| 141 | } |
| 142 | paths[name] = append(paths[name], path) |
| 143 | } |
| 144 | |
| 145 | defaultPath := paths[""] |
| 146 | b.llvmSymbolizer, b.llvmSymbolizerFound = chooseExe([]string{"llvm-symbolizer"}, []string{}, append(paths["llvm-symbolizer"], defaultPath...)) |
| 147 | b.addr2line, b.addr2lineFound = chooseExe([]string{"addr2line"}, []string{"gaddr2line"}, append(paths["addr2line"], defaultPath...)) |
| 148 | // The "-n" option is supported by LLVM since 2011. The output of llvm-nm |
| 149 | // and GNU nm with "-n" option is interchangeable for our purposes, so we do |
| 150 | // not need to differrentiate them. |
| 151 | b.nm, b.nmFound = chooseExe([]string{"llvm-nm", "nm"}, []string{"gnm"}, append(paths["nm"], defaultPath...)) |
| 152 | b.objdump, b.objdumpFound, b.isLLVMObjdump = findObjdump(append(paths["objdump"], defaultPath...)) |
| 153 | } |
| 154 | |
| 155 | // findObjdump finds and returns path to preferred objdump binary. |
| 156 | // Order of preference is: llvm-objdump, objdump. |
no test coverage detected
searching dependent graphs…