Documentation ¶
Index ¶
- Constants
- type TracedProgram
- func (p *TracedProgram) Detach() error
- func (p *TracedProgram) Madvise(addr uint64, length uint64) error
- func (p *TracedProgram) Mlock(addr uint64, length uint64) error
- func (p *TracedProgram) Mmap(length uint64, fd uint64) (uint64, error)
- func (p *TracedProgram) Pid() int
- func (p *TracedProgram) Protect() error
- func (p *TracedProgram) Restore() error
- func (p *TracedProgram) SetMemLockInfinity() error
- func (p *TracedProgram) Step() error
- func (p *TracedProgram) Syscall(number uint64, args ...uint64) (uint64, error)
- func (p *TracedProgram) Wait() error
Constants ¶
View Source
const ( // MADV_POPULATE_READ. MadvisePopulateRead = 0x16 // MADV_POPULATE_WRITE. MadvisePopulateWrite = 0x17 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TracedProgram ¶
type TracedProgram struct {
// contains filtered or unexported fields
}
TracedProgram is a program traced by ptrace.
func NewTracedProgram ¶
func NewTracedProgram(pid int, logger logr.Logger) (*TracedProgram, error)
NewTracedProgram ptrace all threads of a process.
func (*TracedProgram) Detach ¶
func (p *TracedProgram) Detach() error
Detach detaches from all threads of the processes.
func (*TracedProgram) Madvise ¶
func (p *TracedProgram) Madvise(addr uint64, length uint64) error
Madvise runs madvise syscall.
func (*TracedProgram) Mlock ¶
func (p *TracedProgram) Mlock(addr uint64, length uint64) error
Mlock runs mlock syscall.
func (*TracedProgram) Mmap ¶
func (p *TracedProgram) Mmap(length uint64, fd uint64) (uint64, error)
Mmap runs mmap syscall.
func (*TracedProgram) Protect ¶
func (p *TracedProgram) Protect() error
Protect will backup regs and rip into fields.
func (*TracedProgram) Restore ¶
func (p *TracedProgram) Restore() error
Restore will restore regs and rip from fields.
func (*TracedProgram) SetMemLockInfinity ¶
func (p *TracedProgram) SetMemLockInfinity() error
SetMemLockInfinity sets the memlock rlimit to infinity.
func (*TracedProgram) Syscall ¶
func (p *TracedProgram) Syscall(number uint64, args ...uint64) (uint64, error)
Syscall runs a syscall at main thread of process.
func (*TracedProgram) Wait ¶
func (p *TracedProgram) Wait() error
Wait waits until the process stops.
Click to show internal directories.
Click to hide internal directories.