mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 10:17:03 +08:00
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:
committed by
Derek Parker
parent
c731a83424
commit
cc9ab6d687
@ -334,6 +334,7 @@ func (dbp *Process) setChanRecvBreakpoints() (int, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, g := range allg {
|
for _, g := range allg {
|
||||||
if g.ChanRecvBlocked() {
|
if g.ChanRecvBlocked() {
|
||||||
ret, err := g.chanRecvReturnAddr(dbp)
|
ret, err := g.chanRecvReturnAddr(dbp)
|
||||||
@ -344,6 +345,11 @@ func (dbp *Process) setChanRecvBreakpoints() (int, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if _, err = dbp.SetTempBreakpoint(ret); err != nil {
|
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
|
return 0, err
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
|
|||||||
Reference in New Issue
Block a user