mirror of
https://github.com/go-delve/delve.git
synced 2025-11-02 04:36:29 +08:00
Only clear and reset breakpoint for current thread
This commit is contained in:
@ -123,7 +123,7 @@ func (dbp *Process) setBreakpoint(tid int, addr uint64, temp bool) (*Breakpoint,
|
||||
if _, err := readMemory(thread, uintptr(addr), originalData); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := writeMemory(thread, uintptr(addr), dbp.arch.BreakpointInstruction()); err != nil {
|
||||
if err := dbp.writeSoftwareBreakpoint(thread, addr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dbp.Breakpoints[addr] = &Breakpoint{
|
||||
@ -139,6 +139,11 @@ func (dbp *Process) setBreakpoint(tid int, addr uint64, temp bool) (*Breakpoint,
|
||||
return dbp.Breakpoints[addr], nil
|
||||
}
|
||||
|
||||
func (dbp *Process) writeSoftwareBreakpoint(thread *Thread, addr uint64) error {
|
||||
_, err := writeMemory(thread, uintptr(addr), dbp.arch.BreakpointInstruction())
|
||||
return err
|
||||
}
|
||||
|
||||
// Error thrown when trying to clear a breakpoint that does not exist.
|
||||
type NoBreakpointError struct {
|
||||
addr uint64
|
||||
|
||||
Reference in New Issue
Block a user