proc: avoid dup chan recv breakpoints

I encountered the error message described in the issue while debugging
InfluxDB. I can confirm that after this fix the error disapeared.

Fixes #258
This commit is contained in:
Konstantin Shaposhnikov
2015-10-06 23:26:43 +08:00
committed by Derek Parker
parent c731a83424
commit cc9ab6d687

View File

@ -334,6 +334,7 @@ func (dbp *Process) setChanRecvBreakpoints() (int, error) {
if err != nil {
return 0, err
}
for _, g := range allg {
if g.ChanRecvBlocked() {
ret, err := g.chanRecvReturnAddr(dbp)
@ -344,6 +345,11 @@ func (dbp *Process) setChanRecvBreakpoints() (int, error) {
return 0, err
}
if _, err = dbp.SetTempBreakpoint(ret); err != nil {
if _, ok := err.(BreakpointExistsError); ok {
// Ignore duplicate breakpoints in case if multiple
// goroutines wait on the same channel
continue
}
return 0, err
}
count++