Inline PtracePokeData
This commit is contained in:
parent
4fe0978e4b
commit
f570a84539
@ -132,7 +132,7 @@ func (dbp *DebuggedProcess) Clear(pc uint64) (*BreakPoint, error) {
|
||||
return nil, fmt.Errorf("No breakpoint currently set for %s", bp.FunctionName)
|
||||
}
|
||||
|
||||
err := dbp.restoreInstruction(bp.Addr, bp.OriginalData)
|
||||
_, err := syscall.PtracePokeData(dbp.Pid, uintptr(bp.Addr), bp.OriginalData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -251,8 +251,3 @@ func (dbp *DebuggedProcess) PCtoBP(pc uint64) (*BreakPoint, bool) {
|
||||
bp, ok := dbp.BreakPoints[fmt.Sprintf("%s:%d", f, l)]
|
||||
return bp, ok
|
||||
}
|
||||
|
||||
func (dbp *DebuggedProcess) restoreInstruction(pc uint64, data []byte) error {
|
||||
_, err := syscall.PtracePokeData(dbp.Pid, uintptr(pc), data)
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user