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