Return breakpoints when they already exist (#870)

See https://youtrack.jetbrains.com/issue/GO-3931#comment=27-2224179
for more details
This commit is contained in:
Florin Pățan
2017-06-12 22:55:53 +01:00
committed by Derek Parker
parent c0d233878c
commit 640dedb479
2 changed files with 2 additions and 2 deletions

View File

@ -874,7 +874,7 @@ func (p *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool) {
func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error) {
if bp, ok := p.breakpoints[addr]; ok {
return nil, proc.BreakpointExistsError{bp.File, bp.Line, bp.Addr}
return bp, proc.BreakpointExistsError{bp.File, bp.Line, bp.Addr}
}
f, l, fn := p.bi.PCToLine(uint64(addr))
if fn == nil {

View File

@ -198,7 +198,7 @@ func (dbp *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond as
tid := dbp.currentThread.ID
if bp, ok := dbp.FindBreakpoint(addr); ok {
return nil, proc.BreakpointExistsError{bp.File, bp.Line, bp.Addr}
return bp, proc.BreakpointExistsError{bp.File, bp.Line, bp.Addr}
}
f, l, fn := dbp.bi.PCToLine(uint64(addr))