Annotation of researchv9/sys/construct/junk/readcore.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: #include <sys/param.h>
        !             3: #include <sys/types.h>
        !             4: #include <sys/dir.h>
        !             5: #include <sys/user.h>
        !             6: #include <machine/reg.h>
        !             7: 
        !             8: char xx[1024 * 8];
        !             9: struct user *u = (struct user *)xx;
        !            10: 
        !            11: main()
        !            12: {
        !            13:        FILE *fp;
        !            14:        int *r;
        !            15: 
        !            16:        if ((fp = fopen("core", "r")) == NULL) {
        !            17:                printf("Can't open core file\n");
        !            18:                exit(1);
        !            19:        }
        !            20: 
        !            21:        fread(u, sizeof(xx), 1, fp);
        !            22: 
        !            23:        printf("u.u_ar0 = 0x%x\n", u->u_ar0);
        !            24: 
        !            25:        r = (int *)&xx[((int)u->u_ar0) & 0x1fff];
        !            26:        printf("D0/%x   A0/%x\n", r[R0], r[AR0]);
        !            27:        printf("D1/%x   A1/%x\n", r[R1], r[AR1]);
        !            28:        printf("D2/%x   A2/%x\n", r[R2], r[AR2]);
        !            29:        printf("D3/%x   A3/%x\n", r[R3], r[AR3]);
        !            30:        printf("D4/%x   A4/%x\n", r[R4], r[AR4]);
        !            31:        printf("D5/%x   A5/%x\n", r[R5], r[AR5]);
        !            32:        printf("D6/%x   A6/%x\n", r[R6], r[AR6]);
        !            33:        printf("D7/%x   SP/%x\n", r[R7], r[SP]);
        !            34:        printf("PS/%x   PC/%x\n", r[PS], r[PC]);
        !            35: 
        !            36:        fclose(fp);
        !            37: }

unix.superglobalmegacorp.com

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