forked from go-delve/delve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement source listing from debuginfo (go-delve#2885)
* service: Implement BuildID Parse the BuildID of executables and provides it over the RPC service. Signed-off-by: Morten Linderud <[email protected]> * command: Support debuinfod for file listing Signed-off-by: Morten Linderud <[email protected]> * debuginfod: create debuginfod package for common code We remove the duplicated code and provide our a new debuginfod package. Signed-off-by: Morten Linderud <[email protected]> * starlark: Workaround for 'build_i_d' Signed-off-by: Morten Linderud <[email protected]> * command: Ensure we only overwrite path when one has been found Signed-off-by: Morten Linderud <[email protected]> * bininfo: Inline parseBuildID Signed-off-by: Morten Linderud <[email protected]>
- Loading branch information
Showing
10 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package debuginfod | ||
|
||
import ( | ||
"os/exec" | ||
"strings" | ||
) | ||
|
||
const debuginfodFind = "debuginfod-find" | ||
|
||
func execFind(args ...string) (string, error) { | ||
if _, err := exec.LookPath(debuginfodFind); err != nil { | ||
return "", err | ||
} | ||
cmd := exec.Command(debuginfodFind, args...) | ||
out, err := cmd.CombinedOutput() | ||
if err != nil { | ||
return "", err | ||
} | ||
return strings.TrimSpace(string(out)), err | ||
} | ||
|
||
func GetSource(buildid, filename string) (string, error) { | ||
return execFind("source", buildid, filename) | ||
} | ||
|
||
func GetDebuginfo(buildid string) (string, error) { | ||
return execFind("debuginfo", buildid) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters