Documentation ¶
Overview ¶
Package testutil provides common assembly stubs for testing.
Index ¶
- func CheckTestRegs(regs *syscall.PtraceRegs, full bool) (err error)
- func CheckTestSegments(regs *syscall.PtraceRegs) (err error)
- func FloatingPointWorks() bool
- func Getpid()
- func HaltLoop()
- func RewindSyscall(regs *syscall.PtraceRegs)
- func SetTestRegs(regs *syscall.PtraceRegs)
- func SetTestSegments(regs *syscall.PtraceRegs)
- func SetTestTarget(regs *syscall.PtraceRegs, fn func())
- func SetTouchTarget(regs *syscall.PtraceRegs, target *uintptr)
- func SpinLoop()
- func SyscallLoop()
- func Touch()
- func TwiddleRegsFault()
- func TwiddleRegsSyscall()
- func TwiddleSegments()
- type RegisterMismatchError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTestRegs ¶
func CheckTestRegs(regs *syscall.PtraceRegs, full bool) (err error)
CheckTestRegs checks that registers were twiddled per TwiddleRegs.
func CheckTestSegments ¶
func CheckTestSegments(regs *syscall.PtraceRegs) (err error)
CheckTestSegments checks that registers were twiddled per TwiddleSegments.
func FloatingPointWorks ¶
func FloatingPointWorks() bool
FloatingPointWorks is a floating point test.
It returns true or false.
func RewindSyscall ¶
func RewindSyscall(regs *syscall.PtraceRegs)
RewindSyscall rewinds a syscall RIP.
func SetTestRegs ¶
func SetTestRegs(regs *syscall.PtraceRegs)
SetTestRegs initializes registers to known values.
func SetTestSegments ¶
func SetTestSegments(regs *syscall.PtraceRegs)
SetTestSegments initializes segments to known values.
func SetTestTarget ¶
func SetTestTarget(regs *syscall.PtraceRegs, fn func())
SetTestTarget sets the rip appropriately.
func SetTouchTarget ¶
func SetTouchTarget(regs *syscall.PtraceRegs, target *uintptr)
SetTouchTarget sets rax appropriately.
func TwiddleRegsSyscall ¶
func TwiddleRegsSyscall()
TwiddleRegsSyscall twiddles registers then executes a syscall.
Types ¶
type RegisterMismatchError ¶
type RegisterMismatchError []string
RegisterMismatchError is used for checking registers.
func (RegisterMismatchError) Error ¶
func (r RegisterMismatchError) Error() string
Error returns a human-readable error.