Annotation of researchv10no/cmd/adb/seq/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 sequent
                      5:  */
                      6: 
                      7: #include "defs.h"
                      8: #include "regs.h"
                      9: #include "space.h"
                     10: #include <signal.h>
                     11: #include <sys/param.h>
                     12: 
                     13: static char *signals[] = {
                     14:        "",
                     15:        "hangup",
                     16:        "interrupt",
                     17:        "quit",
                     18:        "illegal instruction",
                     19:        "trace/BPT",
                     20:        "IOT",
                     21:        "EMT",
                     22:        "floating exception",
                     23:        "killed",
                     24:        "bus error",
                     25:        "memory fault",
                     26:        "bad system call",
                     27:        "broken pipe",
                     28:        "alarm call",
                     29:        "terminated",
                     30:        "urgent condition",
                     31:        "stopped",
                     32:        "stop (tty)",
                     33:        "continue (signal)",
                     34:        "child termination",
                     35:        "stop (tty input)",
                     36:        "stop (tty output)",
                     37:        "input available (signal)",
                     38:        "cpu timelimit",
                     39:        "file sizelimit",
                     40:        "virtual alarm",
                     41:        "profile alarm",
                     42:        "signal 28",
                     43:        "signal 29",
                     44:        "signal 30",
                     45:        "signal 31",
                     46: };
                     47: 
                     48: static char *illinames[] = {
                     49:        "privileged instruction",
                     50:        "reserved operand"
                     51: };
                     52: static char *fpenames[] = {
                     53:        "integer divide by zero",
                     54:        "floating underflow ",
                     55:        "floating overflow",
                     56:        "floating divide by zero",
                     57:        "floating illegal instruction",
                     58:        "floating invalid operation",
                     59:        "floating inexact result",
                     60:        "",
                     61: };
                     62: 
                     63: sigprint()
                     64: {
                     65:        if ((signo>=0) && (signo<sizeof signals/sizeof signals[0]))
                     66:                prints(signals[signo]);
                     67:        switch (signo) {
                     68: 
                     69:        case SIGFPE:
                     70:                if ((sigcode > 0
                     71:                &&  sigcode < sizeof fpenames / sizeof fpenames[0]))
                     72:                        printf(" (%s)", fpenames[sigcode]);
                     73:                break;
                     74: 
                     75:        case SIGILL:
                     76:                if ((sigcode >= 0
                     77:                &&  sigcode < sizeof illinames / sizeof illinames[0]))
                     78:                        printf(" (%s)", illinames[sigcode]);
                     79:                break;
                     80:        }
                     81: }
                     82: 
                     83: printpc()
                     84: {
                     85: 
                     86:        dot = (ADDR)rtow(rget(PC));
                     87:        psymoff((WORD)dot, INSTSP, "?%16t");
                     88:        printins(SYMF|INSTSP);
                     89:        printc(EOR);
                     90: }

unix.superglobalmegacorp.com

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