Add command to restart process

Fixes #95
This commit is contained in:
Derek Parker
2015-07-03 15:35:22 -05:00
parent d2b8d57053
commit 2f7612d4af
8 changed files with 130 additions and 7 deletions

View File

@ -12,8 +12,9 @@ import (
// Client is a RPC service.Client.
type RPCClient struct {
addr string
client *rpc.Client
addr string
processPid int
client *rpc.Client
}
// Ensure the implementation satisfies the interface.
@ -31,10 +32,20 @@ func NewClient(addr string) *RPCClient {
}
}
func (c *RPCClient) ProcessPid() int {
var pid int
c.call("ProcessPid", nil, &pid)
return pid
}
func (c *RPCClient) Detach(kill bool) error {
return c.call("Detach", kill, nil)
}
func (c *RPCClient) Restart() error {
return c.call("Restart", nil, nil)
}
func (c *RPCClient) GetState() (*api.DebuggerState, error) {
state := new(api.DebuggerState)
err := c.call("State", nil, state)