Annotation of researchv9/cmd/adb/sun/mchrun.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * machine-dependent code for controlling a process
        !             3:  * this for vax
        !             4:  */
        !             5: 
        !             6: #include "defs.h"
        !             7: #include "bkpt.h"
        !             8: #include "regs.h"
        !             9: #include "space.h"
        !            10: #include <machine/reg.h>
        !            11: #include <machine/psl.h>
        !            12: 
        !            13: 
        !            14: /*
        !            15:  * install (f != 0) or remove (f == 0) a breakpoint
        !            16:  */
        !            17: 
        !            18: #define        BPT     0x4e4f          /* Trap #15 */
        !            19: 
        !            20: extern ADDR txtsize;
        !            21: bkput(bk, f)
        !            22: register BKPT *bk;
        !            23: {
        !            24:        register int sp;
        !            25: 
        !            26:        if (bk->loc < txtsize)
        !            27:                sp = CORF | INSTSP;
        !            28:        else
        !            29:                sp = CORF | DATASP;
        !            30:        if (f == 0)
        !            31:                sput(bk->loc, sp, wtos(bk->ins));
        !            32:        else {
        !            33:                bk->ins = stow(sget(bk->loc, sp));
        !            34:                sput(bk->loc, sp, wtos(BPT));
        !            35:                if (errflg) {
        !            36:                        printf("cannot set breakpoint: ");
        !            37:                        /* stuff */
        !            38:                        prints(errflg);
        !            39:                }
        !            40:        }
        !            41: }
        !            42: 
        !            43: /*
        !            44:  * set psl to cause a trap after one instruction
        !            45:  * needed for v8; no ioctl to step pc
        !            46:  */
        !            47: 
        !            48: setstep()
        !            49: {
        !            50: 
        !            51:        rput(PS, rget(PS) | PSL_T);
        !            52: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.