mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 17:56:45 +08:00
service/debugger,terminal: API and user interface for follow exec mode (#3286)
Updates #2551
This commit is contained in:
committed by
GitHub
parent
47481fe0ab
commit
a61ccea65a
@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user