1/* 2 * Copyright (c) 1982 Regents of the University of California. 3 * All rights reserved. The Berkeley software License Agreement 4 * specifies the terms and conditions for redistribution. 5 */ 6 7#ifndef lint 8static char sccsid[] = "@(#)process.rep 5.1 (Berkeley) 06/07/85"; 9#endif not lint 10 11/* 12 * This file defines the representation of a process. 13 * It is MACHINE DEPENDENT. 14 */ 15 16#define STOPPED 0177 17#define FINISHED 0 18 19#ifdef vax 20#define NREG 12 /* maximum number of saved registers */ 21#else 22#define NREG 14 /* maximum number of saved registers */ 23#endif 24#define CSIZE 101 /* size of instruction cache */ 25 26/* 27 * Cache-ing of instruction segment is done to reduce the number 28 * of calls to ptrace. 29 */ 30 31typedef struct { 32 WORD addr; 33 WORD val; 34} CACHEWORD; 35 36/* 37 * This structure holds the information we need from the user structure. 38 */ 39 40struct process { 41 int pid; /* process being traced */ 42 WORD reg[NREG]; /* process's registers */ 43 WORD ap, fp, sp, pc; /* special registers */ 44 WORD oreg[NREG]; /* registers when process last stopped */ 45 WORD oap, ofp, osp, opc;/* special registers when process stopped */ 46 int status; /* either STOPPED or FINISHED */ 47 int signo; /* signal that stopped process */ 48 int exitval; /* return value from exit() */ 49 long sigset; /* bit array of traced signals */ 50 CACHEWORD word[CSIZE]; /* text segment cache */ 51}; 52 53/* 54 * Process manipulation routines local to this module. 55 */ 56 57pstart(); /* start up a process */ 58pcont(); /* continue execution */ 59pstep(); /* single step */ 60pio(); /* process memory move */ 61psigtrace(); /* catch/don't catch a signal */ 62unsetsigtraces(); /* don't catch any signals */ 63 64/* 65 * These definitions are for the arguments to "pio". 66 */ 67 68typedef enum { PREAD, PWRITE } PIO_OP; 69typedef enum { TEXTSEG, DATASEG } PIO_SEG; 70