Annotation of researchv9/cmd/adb/vax/mchpr.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * code to print the name of a signal
                      3:  * machine-dependent for less than obvious reasons
                      4:  * this for VAX
                      5:  */
                      6: 
                      7: #include "defs.h"
                      8: #include "regs.h"
                      9: #include "space.h"
                     10: #include <signal.h>
                     11: 
                     12: static char *signals[] = {
                     13:        "",
                     14:        "hangup",
                     15:        "interrupt",
                     16:        "quit",
                     17:        "illegal instruction",
                     18:        "trace/BPT",
                     19:        "IOT",
                     20:        "EMT",
                     21:        "floating exception",
                     22:        "killed",
                     23:        "bus error",
                     24:        "memory fault",
                     25:        "bad system call",
                     26:        "broken pipe",
                     27:        "alarm call",
                     28:        "terminated",
                     29:        "signal 16",
                     30:        "stopped",
                     31:        "stop (tty)",
                     32:        "continue (signal)",
                     33:        "child termination",
                     34:        "stop (tty input)",
                     35:        "stop (tty output)",
                     36:        "input available (signal)",
                     37:        "cpu timelimit",
                     38:        "file sizelimit",
                     39:        "signal 26",
                     40:        "signal 27",
                     41:        "signal 28",
                     42:        "signal 29",
                     43:        "signal 30",
                     44:        "signal 31",
                     45: };
                     46: 
                     47: static char *illinames[] = {
                     48:        "reserved addressing fault",
                     49:        "privileged instruction fault",
                     50:        "reserved operand fault"
                     51: };
                     52: static char *fpenames[] = {
                     53:        0,
                     54:        "integer overflow trap",
                     55:        "integer divide by zero trap",
                     56:        "floating overflow trap",
                     57:        "floating/decimal divide by zero trap",
                     58:        "floating underflow trap",
                     59:        "decimal overflow trap",
                     60:        "subscript out of range trap",
                     61:        "floating overflow fault",
                     62:        "floating divide by zero fault",
                     63:        "floating undeflow fault"
                     64: };
                     65: 
                     66: sigprint()
                     67: {
                     68:        if ((signo>=0) && (signo<sizeof signals/sizeof signals[0]))
                     69:                prints(signals[signo]);
                     70:        switch (signo) {
                     71: 
                     72:        case SIGFPE:
                     73:                if ((sigcode > 0
                     74:                &&  sigcode < sizeof fpenames / sizeof fpenames[0]))
                     75:                        printf(" (%s)", fpenames[sigcode]);
                     76:                break;
                     77: 
                     78:        case SIGILL:
                     79:                if ((sigcode >= 0
                     80:                &&  sigcode < sizeof illinames / sizeof illinames[0]))
                     81:                        printf(" (%s)", illinames[sigcode]);
                     82:                break;
                     83:        }
                     84: }
                     85: 
                     86: printpc()
                     87: {
                     88: 
                     89:        dot = (ADDR)rtow(rget(PC));
                     90:        psymoff((WORD)dot, INSTSP, "?%16t");
                     91:        printins(SYMF|INSTSP);
                     92:        printc(EOR);
                     93: }

unix.superglobalmegacorp.com

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