From 640dedb479488b4d23d5f99f20fe27b9e40e905e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florin=20P=C4=83=C8=9Ban?= Date: Mon, 12 Jun 2017 22:55:53 +0100 Subject: [PATCH] Return breakpoints when they already exist (#870) See https://youtrack.jetbrains.com/issue/GO-3931#comment=27-2224179 for more details --- pkg/proc/gdbserial/gdbserver.go | 2 +- pkg/proc/native/proc.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/proc/gdbserial/gdbserver.go b/pkg/proc/gdbserial/gdbserver.go index 3c748b67..73234a44 100644 --- a/pkg/proc/gdbserial/gdbserver.go +++ b/pkg/proc/gdbserial/gdbserver.go @@ -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 { diff --git a/pkg/proc/native/proc.go b/pkg/proc/native/proc.go index 4ff96b59..5c1d604a 100644 --- a/pkg/proc/native/proc.go +++ b/pkg/proc/native/proc.go @@ -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)) -- GitLab