 | pinktrace-0.0.5: Haskell bindings to Pink's Tracing Library | Contents | Index |
|
| System.PinkTrace.Trace | | Portability | non-portable, requires freebsd or linux | | Stability | provisional | | Maintainer | alip@exherbo.org |
|
|
|
| Description |
| Pink's low level wrappers around ptrace(2) internals
|
|
| Synopsis |
|
|
|
| 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 | | | traceOptionSysGood ∷ Bool | When delivering system call traps, set bit 7 in signal number.
| | traceOptionFork ∷ Bool | Stop the child at the next fork(2) call.
| | traceOptionVFork ∷ Bool | Stop the child at the next vfork(2) call.
| | traceOptionClone ∷ Bool | Stop the child at the next clone(2) call.
| | traceOptionExec ∷ Bool | Stop the child at the next execve(2) call.
| | traceOptionVForkDone ∷ Bool | Stop the child at the completion of the next vfork(2) call.
| | traceOptionExit ∷ Bool | Stop the child at exit.
|
|
| Instances | |
|
|
| traceMe ∷ IO () |
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 |
| ∷ Addr | On 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.
| | → Signal | If this is non-zero and not sigSTOP,
it is interpreted as the signal delivered to the child;
otherwise, no signal is delivered.
| | → ProcessID | Process ID of the child to be restarted.
| | → IO () | | Restarts the stopped child process.
- Note: This function calls throwErrno in case of failure.
|
|
|
| traceResume |
| ∷ Signal | If this is non-zero and not sigSTOP,
it is interpreted as the signal delivered to the child;
otherwise, no signal is delivered.
| | → ProcessID | Process ID of the child to be resumed.
| | → IO () | | Resumes the stopped child process.
- Note: This function calls throwErrno in case of failure.
|
|
|
| traceKill |
| ∷ ProcessID | Process 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 |
| ∷ Signal | Treated the same as the signal argument of traceContinue.
| | → ProcessID | Process 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 |
| ∷ Signal | Treated the same as the signal argument of traceContinue.
| | → ProcessID | Process 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 |
| ∷ Signal | Treated the same as the signal argument of traceContinue.
| | → ProcessID | Process 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 |
| ∷ Signal | Treated the same as the signal argument of traceContinue.
| | → ProcessID | Process 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 |
| ∷ Signal | Treated the same as the signal argument of traceContinue.
| | → ProcessID | Process 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 |
| ∷ Signal | Treated the same as the signal argument of traceContinue.
| | → ProcessID | Process 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 |
| ∷ ProcessID | Process ID of the child whose event is to be reported.
| | → IO EventMessage | The 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 |
| ∷ TraceOption | Tracing options
| | → ProcessID | Process ID of the child to be setup.
| | → IO () | | Sets the tracing options.
- Note: This function calls throwErrno in case of failure.
- Availability: Linux
|
|
|
| traceAttach |
| ∷ ProcessID | Process 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 |
|
|
| Produced by Haddock version 2.6.1 |