|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1986 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: * @(#)kdb_pcs.c 7.2 (Berkeley) 12/15/86 ! 7: */ ! 8: ! 9: #include "../kdb/defs.h" ! 10: ! 11: char *NOBKPT; ! 12: char *SZBKPT; ! 13: char *EXBKPT; ! 14: char *BADMOD; ! 15: ! 16: /* breakpoints */ ! 17: BKPTR bkpthead; ! 18: ! 19: char *lp; ! 20: char lastc; ! 21: extern char *kdbmalloc(); ! 22: long loopcnt; ! 23: ! 24: /* sub process control */ ! 25: ! 26: subpcs(modif) ! 27: { ! 28: register check, runmode; ! 29: register BKPTR bkptr; ! 30: register char *comptr; ! 31: ! 32: loopcnt=cntval; ! 33: switch (modif) { ! 34: ! 35: /* delete breakpoint */ ! 36: case 'd': case 'D': ! 37: if (bkptr=scanbkpt((ADDR)dot)) { ! 38: bkptr->flag=0; ! 39: return; ! 40: } ! 41: error(NOBKPT); ! 42: ! 43: /* set breakpoint */ ! 44: case 'b': case 'B': ! 45: if (bkptr=scanbkpt((ADDR)dot)) ! 46: bkptr->flag=0; ! 47: for (bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt) ! 48: if (bkptr->flag == 0) ! 49: break; ! 50: if (bkptr==0) { ! 51: bkptr=(BKPTR)kdbmalloc(sizeof *bkptr); ! 52: if (bkptr == (BKPTR)-1) ! 53: error(SZBKPT); ! 54: bkptr->nxtbkpt=bkpthead; ! 55: bkpthead=bkptr; ! 56: } ! 57: bkptr->loc = dot; ! 58: bkptr->initcnt = bkptr->count = cntval; ! 59: bkptr->flag = BKPTSET; ! 60: check=MAXCOM-1; comptr=bkptr->comm; (void) rdc(); lp--; ! 61: do ! 62: *comptr++ = readchar(); ! 63: while (check-- && lastc!=EOR); ! 64: *comptr=0; lp--; ! 65: if (check) ! 66: return; ! 67: error(EXBKPT); ! 68: ! 69: /* single step */ ! 70: case 's': case 'S': ! 71: runmode=SINGLE; ! 72: break; ! 73: ! 74: /* continue */ ! 75: case 'c': case 'C': ! 76: runmode=CONTIN; ! 77: break; ! 78: ! 79: default: ! 80: error(BADMOD); ! 81: } ! 82: if (loopcnt>0) ! 83: runpcs(runmode, 0); ! 84: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.