@@ 10,21 10,26 @@ export fn fork() (pid_t | void | error) = {
return pid : pid_t;
case let err: rt::errno =>
return err : error;
- case void => return void;
+ case void =>
+ return void;
};
};
export fn traceme() void = {
match (rt::ptrace(rt::PTRACE_TRACEME, 0, 0, 0)) {
- case let err: rt::errno => abort("ptrace(PTRACE_TRACEME, ...) failed");
- case => void;
+ case let err: rt::errno =>
+ abort("ptrace(PTRACE_TRACEME, ...) failed");
+ case =>
+ void;
};
};
export fn cont(pid: pid_t) void = {
match (rt::ptrace(rt::PTRACE_CONT, pid, 0, 0)) {
- case let err: rt::errno => abort("ptrace(PTRACE_CONT, ...) failed");
- case => void;
+ case let err: rt::errno =>
+ abort("ptrace(PTRACE_CONT, ...) failed");
+ case =>
+ void;
};
};
@@ 37,14 42,18 @@ export fn waitpid(pid: pid_t) void = {
export fn readmem(pid: pid_t, addr: u64) u64 = {
match (rt::ptrace(rt::PTRACE_PEEKDATA, pid, addr : uintptr, 0)) {
- case let err: rt::errno => abort("ptrace(PTRACE_PEEKDATA, ...) failed");
- case let data: u64 => return data;
+ case let err: rt::errno =>
+ abort("ptrace(PTRACE_PEEKDATA, ...) failed");
+ case let data: u64 =>
+ return data;
};
};
export fn writemem(pid: pid_t, addr: u64, val: u64) void = {
match (rt::ptrace(rt::PTRACE_POKEDATA, pid, addr : uintptr, val : uintptr)) {
- case let err: rt::errno => abort("ptrace(PTRACE_POKEDATA, ...) failed");
- case => void;
+ case let err: rt::errno =>
+ abort("ptrace(PTRACE_POKEDATA, ...) failed");
+ case =>
+ void;
};
};