mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
proc/gdbserial: pass environment variables to target (#820)
debugserver requires a special option to forward the environment to the target. Fixes #818
This commit is contained in:
committed by
Derek Parker
parent
76ce11cffb
commit
f29b9edad2
@ -2730,3 +2730,17 @@ func TestPackageWithPathVar(t *testing.T) {
|
||||
assertNoError(err, t, "EvalVariable(pkg.SomeVar.X)")
|
||||
})
|
||||
}
|
||||
|
||||
func TestEnvironment(t *testing.T) {
|
||||
os.Setenv("SOMEVAR", "bah")
|
||||
withTestProcess("testenv", t, func(p proc.Process, fixture protest.Fixture) {
|
||||
assertNoError(proc.Continue(p), t, "Continue()")
|
||||
v, err := evalVariable(p, "x")
|
||||
assertNoError(err, t, "EvalVariable()")
|
||||
vv := constant.StringVal(v.Value)
|
||||
t.Logf("v = %q", vv)
|
||||
if vv != "bah" {
|
||||
t.Fatalf("value of v is %q (expected \"bah\")", vv)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user