static char sccsid
[] = "@(#)print.c 4.5 7/23/82";
"p1lr", P1LR
, &pcb
.pcb_p1lr
,
"p1br", P1BR
, &pcb
.pcb_p1br
,
"p0lr", P0LR
, &pcb
.pcb_p0lr
,
"p0br", P0BR
, &pcb
.pcb_p0br
,
"ksp", KSP
, &pcb
.pcb_ksp
,
"esp", ESP
, &pcb
.pcb_esp
,
"ssp", SSP
, &pcb
.pcb_ssp
,
"psl", PSL
, &pcb
.pcb_psl
,
"usp", USP
, &pcb
.pcb_usp
,
"r11", R11
, &pcb
.pcb_r11
,
"r10", R10
, &pcb
.pcb_r10
,
"input available (signal)",
/* general printing routines ($) */
INT narg
, i
, stat
, name
, limit
;
register struct nlist
*sp
;
IF cntflg
==0 THEN cntval
= -1; FI
THEN WHILE
readchar() != EOR
THEN REP file
[index
++]=lastc
;
IF index
>=63 THEN
error(LONGFIL
); FI
THEN infile
=open(Ifile
,0);
ELSE
lseek(infile
, 0L, 0);
THEN infile
=0; error(NOTOPEN
);
THEN outfile
=creat(file
,0644);
ELSE
lseek(outfile
,0L,2);
printf("not debugging kernel\n");
int pte
= access(RD
, dot
, DSP
, 0);
masterpcbb
= (pte
&PG_PFNUM
)*512;
if (adrval
<2 || adrval
>16) {printf("must have 2 <= radix <= 16"); break;}
printf("radix=%d base ten",radix
=adrval
);
case 'q': case 'Q': case '%':
maxpos
=(adrflg
?adrval
:MAXPOS
);
maxoff
=(adrflg
?adrval
:MAXOFF
);
THEN
printc((i
<=9 ? '0' : 'a'-10) + i
);
printf(" = %X\n",var
[i
]);
printmap("? map",&txtmap
);
printmap("/ map",&datmap
);
THEN
printf("pcs id = %d\n",pid
);
ELSE
prints("no process\n");
word
=get(adrval
+6,DSP
)&0xFFFF;
THEN
/* 'calls', can figure out argp */
argp
=adrval
+20+((word
>>14)&3); word
&= 0xFFF;
WHILE word DO IF word
&1 THEN argp
+=4; FI word
>>=1; OD
ELSE
/* 'callg', can't tell where argp is */ argp
=frame
;
callpc
=get(frame
+16,DSP
);
ELSE argp
= *(ADDR
*)(((ADDR
)&u
)+AP
);
frame
= *(ADDR
*)(((ADDR
)&u
)+FP
);
callpc
= *(ADDR
*)(((ADDR
)&u
)+PC
);
if (callpc
> 0x80000000 - 0x200 * UPAGES
) {
!strcmp(cursym
->n_un
.n_name
, "start"))
name
= cursym
->n_un
.n_name
;
narg
= get(argp
,DSP
); IF narg
&~0xFF THEN narg
=0; FI
LOOP IF narg
==0 THEN
break; FI
printf("%R", get(argp
+= 4, DSP
));
IF
--narg
!=0 THEN
printc(','); FI
printf(") from %X\n",callpc
); /* jkf mod */
THEN WHILE
localsym(frame
,argp
)
DO word
=get(localval
,DSP
);
printf("%8t%s:%10t", cursym
->n_un
.n_name
);
IF errflg THEN
prints("?\n"); errflg
=0; ELSE
printf("%R\n",word
); FI
callpc
=get(frame
+64, DSP
);
callpc
=get(frame
+16, DSP
);
frame
=get(frame
+12, DSP
)&EVEN
;
IF frame
==0 ORF (!adrflg ANDF
!INSTACK(frame
))
for (sp
= symtab
; sp
< esymtab
; sp
++) {
if (sp
->n_type
==(N_DATA
|N_EXT
) ORF sp
->n_type
==(N_BSS
|N_EXT
))
printf("%s:%12t%R\n", sp
->n_un
.n_name
, get(sp
->n_value
,DSP
));
error("No algol 68 on VAX");
printf("breakpoints\ncount%8tbkpt%24tcommand\n");
for (bkptr
=bkpthead
; bkptr
; bkptr
=bkptr
->nxtbkpt
)
printf("%-8.8d",bkptr
->count
);
psymoff(leng(bkptr
->loc
),ISYM
,"%24t");
WHILE
*comptr DO
printc(*comptr
++); OD
printf("%s%12t`%s'\n",s
,(file
<0 ? "-" : (file
==fcor
? corfil
: symfil
)));
printf("b1 = %-16R",amap
->b1
);
printf("e1 = %-16R",amap
->e1
);
printf("f1 = %-16R",amap
->f1
);
printf("\nb2 = %-16R",amap
->b2
);
printf("e2 = %-16R",amap
->e2
);
printf("f2 = %-16R",amap
->f2
);
FOR p
=reglist
; p
< ®list
[24]; p
++
DO v
= kcore
? *p
->rkern
: *(ADDR
*)(((ADDR
)&u
)+p
->roffs
);
printf("%s%6t%R %16t", p
->rname
, v
);
valpr(v
,(p
->roffs
==PC
?ISYM
:DSYM
));
FOR p
=reglist
; p
< ®list
[24]; p
++
DO
IF (regnxt
=readchar()) != *regptr
++
int i
= kcore
? (int)p
->rkern
: p
->roffs
;
dot
= *(ADDR
*)(((ADDR
)&u
)+PC
);
psymoff(dot
,ISYM
,":%16t"); printins(0,ISP
,chkget(dot
,ISP
));
"reserved addressing fault",
"priviliged instruction fault",
"integer divide by zero trap",
"floating overflow trap",
"floating/decimal divide by zero trap",
"floating underflow trap",
"subscript out of range trap",
"floating overflow fault",
"floating divide by zero fault",
"floating undeflow fault"
IF (signo
>=0) ANDF (signo
<sizeof signals
/sizeof signals
[0])
THEN
prints(signals
[signo
]); FI
sigcode
< sizeof fpenames
/ sizeof fpenames
[0]) THEN
prints(" ("); prints(fpenames
[sigcode
]); prints(")");
sigcode
< sizeof illinames
/ sizeof illinames
[0]) THEN
prints(" ("); prints(illinames
[sigcode
]); prints(")");