Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (37 sloc) 1.437 kb
648ff26 @nelhage Start to separate ptrace.c into a library.
authored
1 #include <sys/ptrace.h>
2 #include <sys/user.h>
3 #include <unistd.h>
4
5 enum child_state {
6 ptrace_detached = 0,
7 ptrace_at_syscall,
8 ptrace_after_syscall,
9 ptrace_running,
10 ptrace_stopped,
11 ptrace_exited
12 };
13
14 struct ptrace_child {
15 pid_t pid;
16 enum child_state state;
17 int status;
c2c4701 @nelhage ptrace: Make error handling consistent.
authored
18 int error;
9e91662 @nelhage Checkpoint working version.
authored
19 unsigned long forked_pid;
1dfdfbc @nelhage Add architecture hooks for saving and restoring the syscall number.
authored
20 struct user user;
21 unsigned long saved_syscall;
648ff26 @nelhage Start to separate ptrace.c into a library.
authored
22 };
23
35d826e @nelhage Implement memcpy to/from child.
authored
24 typedef unsigned long child_addr_t;
25
648ff26 @nelhage Start to separate ptrace.c into a library.
authored
26 int ptrace_wait(struct ptrace_child *child);
27 int ptrace_attach_child(struct ptrace_child *child, pid_t pid);
9e91662 @nelhage Checkpoint working version.
authored
28 int ptrace_finish_attach(struct ptrace_child *child, pid_t pid);
648ff26 @nelhage Start to separate ptrace.c into a library.
authored
29 int ptrace_detach_child(struct ptrace_child *child);
30 int ptrace_wait(struct ptrace_child *child);
31 int ptrace_advance_to_state(struct ptrace_child *child,
32 enum child_state desired);
33 int ptrace_save_regs(struct ptrace_child *child);
34 int ptrace_restore_regs(struct ptrace_child *child);
35 unsigned long ptrace_remote_syscall(struct ptrace_child *child,
36 unsigned long sysno,
37 unsigned long p0, unsigned long p1,
38 unsigned long p2, unsigned long p3,
39 unsigned long p4, unsigned long p5);
35d826e @nelhage Implement memcpy to/from child.
authored
40
fff1db5 @nelhage const fix for memcpy_to_child
authored
41 int ptrace_memcpy_to_child(struct ptrace_child *, child_addr_t, const void*, size_t);
35d826e @nelhage Implement memcpy to/from child.
authored
42 int ptrace_memcpy_from_child(struct ptrace_child *, void*, child_addr_t, size_t);
Something went wrong with that request. Please try again.