提交 640dedb4 编写于 作者: F Florin Pățan 提交者: Derek Parker

Return breakpoints when they already exist (#870)

See https://youtrack.jetbrains.com/issue/GO-3931#comment=27-2224179
for more details
上级 c0d23387
......@@ -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 {
......
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册