mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	 8c392d2fdf
			
		
	
	8c392d2fdf
	
	
	
		
			
			* service: Implement BuildID Parse the BuildID of executables and provides it over the RPC service. Signed-off-by: Morten Linderud <morten@linderud.pw> * command: Support debuinfod for file listing Signed-off-by: Morten Linderud <morten@linderud.pw> * debuginfod: create debuginfod package for common code We remove the duplicated code and provide our a new debuginfod package. Signed-off-by: Morten Linderud <morten@linderud.pw> * starlark: Workaround for 'build_i_d' Signed-off-by: Morten Linderud <morten@linderud.pw> * command: Ensure we only overwrite path when one has been found Signed-off-by: Morten Linderud <morten@linderud.pw> * bininfo: Inline parseBuildID Signed-off-by: Morten Linderud <morten@linderud.pw>
		
			
				
	
	
		
			29 lines
		
	
	
		
			587 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			587 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 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)
 | |
| }
 |