summaryrefslogtreecommitdiff
path: root/shared/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'shared/debug.go')
-rw-r--r--shared/debug.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/shared/debug.go b/shared/debug.go
new file mode 100644
index 000000000..0c9ba4f95
--- /dev/null
+++ b/shared/debug.go
@@ -0,0 +1,17 @@
+package shared
+
+import (
+ "os"
+ "os/exec"
+)
+
+// Finds the Delve binary to use. Either uses the SOONG_DELVE_PATH environment
+// variable or if that is unset, looks at $PATH.
+func ResolveDelveBinary() string {
+ result := os.Getenv("SOONG_DELVE_PATH")
+ if result == "" {
+ result, _ = exec.LookPath("dlv")
+ }
+
+ return result
+}