|
@@ -431,9 +431,9 @@ func getMissingFunctionSource(filename string, asm map[int]graph.Nodes, start, e
|
431
|
431
|
|
432
|
432
|
// openSourceFile opens a source file from a name encoded in a
|
433
|
433
|
// profile. File names in a profile after often relative paths, so
|
434
|
|
-// search them in each of the paths in sourcePath (or CWD by default),
|
|
434
|
+// search them in each of the paths in searchPath (or CWD by default),
|
435
|
435
|
// and their parents.
|
436
|
|
-func openSourceFile(path string, sourcePath string) (*os.File, string, error) {
|
|
436
|
+func openSourceFile(path, searchPath string) (*os.File, string, error) {
|
437
|
437
|
path = trimPath(path)
|
438
|
438
|
|
439
|
439
|
if filepath.IsAbs(path) {
|
|
@@ -442,7 +442,7 @@ func openSourceFile(path string, sourcePath string) (*os.File, string, error) {
|
442
|
442
|
}
|
443
|
443
|
|
444
|
444
|
// Scan each component of the path
|
445
|
|
- for _, dir := range strings.Split(sourcePath, ":") {
|
|
445
|
+ for _, dir := range strings.Split(searchPath, ":") {
|
446
|
446
|
// Search up for every parent of each possible path.
|
447
|
447
|
for {
|
448
|
448
|
filename := filepath.Join(dir, path)
|
|
@@ -457,7 +457,7 @@ func openSourceFile(path string, sourcePath string) (*os.File, string, error) {
|
457
|
457
|
}
|
458
|
458
|
}
|
459
|
459
|
|
460
|
|
- return nil, "", fmt.Errorf("Could not find file %s on path %s", path, sourcePath)
|
|
460
|
+ return nil, "", fmt.Errorf("Could not find file %s on path %s", path, searchPath)
|
461
|
461
|
}
|
462
|
462
|
|
463
|
463
|
// trimPath cleans up a path by removing prefixes that are commonly
|