mirror of
				https://github.com/go-delve/delve.git
				synced 2025-11-04 06:32:16 +08:00 
			
		
		
		
	Inline PtracePokeData
This commit is contained in:
		@ -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
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user