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