mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 18:27:37 +08:00
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user