mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 02:07:58 +08:00
Improve 'next' impl for non-go next'ing
This commit is contained in:
@ -130,6 +130,14 @@ func (dbp *DebuggedProcess) setBreakpoint(tid int, addr uint64, temp bool) (*Bre
|
||||
return dbp.BreakPoints[addr], nil
|
||||
}
|
||||
|
||||
type NoBreakPointError struct {
|
||||
addr uint64
|
||||
}
|
||||
|
||||
func (nbp NoBreakPointError) Error() string {
|
||||
return fmt.Sprintf("no breakpoint at %#v", nbp.addr)
|
||||
}
|
||||
|
||||
func (dbp *DebuggedProcess) clearBreakpoint(tid int, addr uint64) (*BreakPoint, error) {
|
||||
thread := dbp.Threads[tid]
|
||||
// Check for hardware breakpoint
|
||||
@ -154,5 +162,5 @@ func (dbp *DebuggedProcess) clearBreakpoint(tid int, addr uint64) (*BreakPoint,
|
||||
delete(dbp.BreakPoints, addr)
|
||||
return bp, nil
|
||||
}
|
||||
return nil, fmt.Errorf("no breakpoint at %#v", addr)
|
||||
return nil, NoBreakPointError{addr: addr}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user