ogle/program: return the PCs of the breakpoints set.
LGTM=r
R=r
https://golang.org/cl/135610043
diff --git a/program/client/client.go b/program/client/client.go
index 9a770c3..66187d6 100644
--- a/program/client/client.go
+++ b/program/client/client.go
@@ -194,12 +194,13 @@
panic("unimplemented")
}
-func (p *Program) Breakpoint(address string) error {
+func (p *Program) Breakpoint(address string) ([]uint64, error) {
req := proxyrpc.BreakpointRequest{
Address: address,
}
var resp proxyrpc.BreakpointResponse
- return p.client.Call("Server.Breakpoint", &req, &resp)
+ err := p.client.Call("Server.Breakpoint", &req, &resp)
+ return resp.PCs, err
}
func (p *Program) DeleteBreakpoint(address string) error {
diff --git a/program/program.go b/program/program.go
index 5e51152..ac7325a 100644
--- a/program/program.go
+++ b/program/program.go
@@ -60,7 +60,7 @@
// The address is the same mini-language accepted by Eval,
// which permits setting multiple breakpoints using a regular
// expression to match a set of symbols.
- Breakpoint(address string) error
+ Breakpoint(address string) (PCs []uint64, err error)
// DeleteBreakpoint removes the breakpoint at the specified
// address. TODO: Probably the wrong interface.
diff --git a/program/proxyrpc/proxyrpc.go b/program/proxyrpc/proxyrpc.go
index e201f1f..3784268 100644
--- a/program/proxyrpc/proxyrpc.go
+++ b/program/proxyrpc/proxyrpc.go
@@ -70,6 +70,7 @@
}
type BreakpointResponse struct {
+ PCs []uint64
}
type EvalRequest struct {
diff --git a/program/server/server.go b/program/server/server.go
index 72c8a5a..3536379 100644
--- a/program/server/server.go
+++ b/program/server/server.go
@@ -429,6 +429,7 @@
}
bp.pc = pc
s.breakpoints[pc] = bp
+ resp.PCs = append(resp.PCs, pc)
}
return nil