service/debugger,terminal: API and user interface for follow exec mode (#3286)

Updates #2551
This commit is contained in:
Alessandro Arzilli
2023-04-24 23:37:31 +02:00
committed by GitHub
parent 47481fe0ab
commit a61ccea65a
12 changed files with 295 additions and 1 deletions

View File

@ -530,6 +530,30 @@ func (c *RPCClient) CoreDumpCancel() error {
return c.call("DumpCancel", DumpCancelIn{}, out)
}
// ListTargets returns the current list of debug targets.
func (c *RPCClient) ListTargets() ([]api.Target, error) {
out := &ListTargetsOut{}
err := c.call("ListTargets", ListTargetsIn{}, out)
return out.Targets, err
}
// FollowExec enabled or disabled follow exec mode. When follow exec is
// enabled Delve will automatically attach to new subprocesses with a
// command line matched by regex, if regex is nil all new subprocesses are
// automatically debugged.
func (c *RPCClient) FollowExec(v bool, regex string) error {
out := &FollowExecOut{}
err := c.call("FollowExec", FollowExecIn{Enable: v, Regex: regex}, out)
return err
}
// FollowExecEnabled returns true if follow exex mode is enabled.
func (c *RPCClient) FollowExecEnabled() bool {
out := &FollowExecEnabledOut{}
_ = c.call("FollowExecEnabled", FollowExecEnabledIn{}, out)
return out.Enabled
}
func (c *RPCClient) call(method string, args, reply interface{}) error {
return c.client.Call("RPCServer."+method, args, reply)
}