/** * Try to execute |step|, adjusting for |req| if needed. Return 0 if * |step| was made, or nonzero if there was a trap or |step| needs * more work. */ static int try_one_trace_step(struct context* ctx, const struct rep_trace_step* step, const struct dbg_request* req) { int stepi = (DREQ_STEP == req->type && get_threadid(ctx) == req->target); switch (step->action) { case TSTEP_RETIRE: return 0; case TSTEP_ENTER_SYSCALL: return enter_syscall(ctx, step, stepi); case TSTEP_EXIT_SYSCALL: return exit_syscall(ctx, step, stepi); case TSTEP_DETERMINISTIC_SIGNAL: return emulate_deterministic_signal(ctx, step->signo, stepi); case TSTEP_PROGRAM_ASYNC_SIGNAL_INTERRUPT: return emulate_async_signal(ctx, step->target.rcb, step->target.regs, step->target.signo, stepi); default: fatal("Unhandled step type %d", step->action); return 0; } }
void main() { enter_syscall(68, 0) syscall(__NR_sgetmask); exit_syscall return; }
void main() { pid_t pid; ASSERT((pid = getpid())) ASSERT(nice(7)) enter_syscall(97, 0) ASSERT(setpriority(PRIO_PROCESS, pid, 8)) exit_syscall return; }
void main() { struct statfs buf; int fd; ASSERT(creat("testfile099", 0444)) enter_syscall(99,0) ASSERT(statfs("testfile099", &buf)) exit_syscall ASSERT(unlink("testfile099")) return; }
#include "head.h" void main() { enter_syscall(120, 0) ASSERT(fork()) exit_syscall }