pinktrace-0.0.5: Haskell bindings to Pink's Tracing LibraryContentsIndex
System.PinkTrace.Trace
Portabilitynon-portable, requires freebsd or linux
Stabilityprovisional
Maintaineralip@exherbo.org
Description
Pink's low level wrappers around ptrace(2) internals
Synopsis
type Addr = CInt
type EventMessage = CULong
data TraceOption = TraceOption {
traceOptionSysGoodBool
traceOptionForkBool
traceOptionVForkBool
traceOptionCloneBool
traceOptionExecBool
traceOptionVForkDoneBool
traceOptionExitBool
}
traceMeIO ()
traceContinueAddrSignalProcessIDIO ()
traceResumeSignalProcessIDIO ()
traceKillProcessIDIO ()
traceSingleStepSignalProcessIDIO ()
traceSystemCallSignalProcessIDIO ()
traceSystemCallEntrySignalProcessIDIO ()
traceSystemCallExitSignalProcessIDIO ()
traceSystemEmulationSignalProcessIDIO ()
traceSystemEmulationSingleStepSignalProcessIDIO ()
traceGetEventMessageProcessIDIO EventMessage
traceSetupTraceOptionProcessIDIO ()
traceAttachProcessIDIO ()
traceDetachSignalProcessIDIO ()
Documentation
type Addr = CInt
Address argument of traceContinue and similar functions.
type EventMessage = CULong
EventMessage returned by traceGetEventMessage.
data TraceOption
Trace options that may be passed to traceSetup.
Constructors
TraceOption
traceOptionSysGoodBoolWhen delivering system call traps, set bit 7 in signal number.
traceOptionForkBoolStop the child at the next fork(2) call.
traceOptionVForkBoolStop the child at the next vfork(2) call.
traceOptionCloneBoolStop the child at the next clone(2) call.
traceOptionExecBoolStop the child at the next execve(2) call.
traceOptionVForkDoneBoolStop the child at the completion of the next vfork(2) call.
traceOptionExitBoolStop the child at exit.
show/hide Instances
traceMeIO ()

Indicates that this process is to be traced by its parent. Any signal (except SIGKILL) delivered to this process will cause it to stop and its parent to be notified via wait(2). Also, all subsequent calls to execve(2) by this process will cause a SIGTRAP to be sent to it, giving the parent a chance to gain control before the new program begins execution.

  • Note: This function is used only by the child process; the rest are used only by the parent.
  • Note: This function calls throwErrno in case of failure.
traceContinue
AddrOn FreeBSD this argument is an address specifying the place where execution is to be resumed (a new value for the program counter), or 1 to indicate that execution is to pick up where it left off. On Linux this argument is not used.
SignalIf this is non-zero and not sigSTOP, it is interpreted as the signal delivered to the child; otherwise, no signal is delivered.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process.

  • Note: This function calls throwErrno in case of failure.
traceResume
SignalIf this is non-zero and not sigSTOP, it is interpreted as the signal delivered to the child; otherwise, no signal is delivered.
ProcessIDProcess ID of the child to be resumed.
IO ()

Resumes the stopped child process.

  • Note: This function calls throwErrno in case of failure.
traceKill
ProcessIDProcess ID of the child to be killed.
IO ()

Kills the traced child process with SIGKILL.

  • Note: This function calls throwErrno in case of failure.
traceSingleStep
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process and arranges it to be stopped after execution of a single instruction.

  • Note: This function calls throwErrno in case of failure.
traceSystemCall
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process and arranges it to be stopped after the entry or exit of the next system call.

  • Note: This function calls throwErrno in case of failure.
traceSystemCallEntry
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process and arranges it to be stopped after the entry of the next system call.

  • Note: This function calls throwErrno in case of failure.
  • Availability: FreeBSD
traceSystemCallExit
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process and arranges it to be stopped after the entry of the next system call.

  • Note: This function calls throwErrno in case of failure.
  • Availability: FreeBSD
traceSystemEmulation
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process and arranges it to be stopped after the entry of the next system call which will *not* be executed.

  • Note: This function calls throwErrno in case of failure.
  • Availability: Linux (2.6.14 or newer)
traceSystemEmulationSingleStep
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be restarted.
IO ()

Restarts the stopped child process like traceSystemEmulation but also singlesteps if not a system call.

  • Note: This function calls throwErrno in case of failure.
  • Availability: Linux (2.6.14 or newer)
traceGetEventMessage
ProcessIDProcess ID of the child whose event is to be reported.
IO EventMessageThe event message, for Exit this is the child's exit status. For Fork, VFork, Clone, VForkDone this is the process ID of the new process.

Retrieve a message about the trace event that just happened.

  • Note: This function calls throwErrno in case of failure.
  • Availability: Linux
traceSetup
TraceOptionTracing options
ProcessIDProcess ID of the child to be setup.
IO ()

Sets the tracing options.

  • Note: This function calls throwErrno in case of failure.
  • Availability: Linux
traceAttach
ProcessIDProcess ID of the child to be attached.
IO ()

Attaches to the process specified in pid, making it a traced child of the calling process; the behaviour of the child is as if it had done a traceMe. The child is sent a sigSTOP, but will not necessarily have stopped by the completion of this call; use wait(2) to wait for the child to stop.

  • Note: This function calls throwErrno in case of failure.
traceDetach
SignalTreated the same as the signal argument of traceContinue.
ProcessIDProcess ID of the child to be detached.
IO ()

Restarts the stopped child as for traceContinue, but first detaches from the process, undoing the reparenting effect of traceAttach.

  • Note: This function calls throwErrno in case of failure.
Produced by Haddock version 2.6.1