proc: add waitfor option to attach (#3445)

Adds a waitfor option to 'dlv attach' that waits for a process with a
name starting with a given prefix to appear before attaching to it.

Debugserver on macOS does not support follow-fork mode, but has this
feature instead which is not the same thing but still helps with
multiprocess debugging somewhat.
This commit is contained in:
Alessandro Arzilli
2023-08-09 19:30:22 +02:00
committed by GitHub
parent 2b785f293b
commit dc5d8de320
16 changed files with 389 additions and 56 deletions

View File

@ -87,7 +87,7 @@ func TestSignalDeath(t *testing.T) {
assertNoError(err, t, "StdoutPipe")
cmd.Stderr = os.Stderr
assertNoError(cmd.Start(), t, "starting fixture")
p, err := native.Attach(cmd.Process.Pid, []string{})
p, err := native.Attach(cmd.Process.Pid, nil, []string{})
assertNoError(err, t, "Attach")
stdout.Close() // target will receive SIGPIPE later on
err = p.Continue()