DBD TITLE 'DMSDBD (CMS) VM/370 - RELEASE 6' 00001000 SPACE 2 00002000 *. 00003000 * 00004000 * MODULE NAME - 00005000 * 00006000 *| DMSDBD 00007000 * 00008000 * FUNCTION - 00009000 * 00010000 *| DMSDBD ENABLES A USER TO DUMP HIS VIRTUAL CORE FROM 00011000 * WITHIN AN EXECUTING PROGRAM. 00012000 * 00013000 * ATTRIBUTES - 00014000 * 00015000 * REENTRANT, NUCLEUS RESIDENT, CALLED VIA BALR 14,15 00016000 * 00017000 * 00018000 * ENTRY POINTS - 00019000 * 00020000 *| DMSDBD 00021000 * 00022000 * ENTRY CONDITIONS - 00023000 * 00024000 * REGISTER 1 POINTS TO THE FOLLOWING 'PLIST'. 00025000 * 00026000 * DUMPLIST DC A(GPRS) ADDRESS OF REG SAVE AREA (0-15) 00027000 * DC A(LOWCORE) ADDRESS OF LOWCORE SAVE AREA 00028000 * DC A(BEGIN) STARTING DUMP LOCATION (IN HEX) 00029000 * DC A(END) ENDING DUMP LOCATION (IN HEX) 00030000 * DC A(FREGS) A(FLOATING POINT REG. SAVE AREA) 00031000 * DC A(DUMPTITLE) ADDRESS OF DUMPTITLE 00032000 * 00033000 * REGISTER 0 CONTAINS THE PSW LOCATION REQUESTED FOR THE 00034000 * DUMP. 00035000 * 00036000 * EXIT CONDITIONS - 00037000 * 00038000 * THERE ARE NO ERROR CODES SUPPLIED BY DEBDUMP. 00039000 * 00040000 * CALLS TO OTHER ROUTINES - 00041000 * 00042000 * NONE 00043000 * 00044000 * EXTERNAL REFERENCES - 00045000 * 00046000 * NUCON - NUCLEUS AREA CONSTANTS AND VARIABLES 00047000 * DBGSECT - DEBDUMP AND DEBUG STORAGE AREA 00048000 * 00049000 * TABLES / WORKAREAS - 00050000 * 00051000 * TBL1, TBL2 - TRANSLATE TABLE 00052000 * 00053000 * REGISTER USAGE - 00054000 * 00055000 * GPR0 = DISPLACEMENT OF PSW FROM A(LOWCORE) 00056000 *| GPR1 = A(USER'S PARAMETER LIST) 00057000 *| GPR4, GPR5, GPR6, GPR8, GPR10, GPR11 = WORK REGS. 00058000 * GPR3 = A(DBGSECT) 00059000 * GPR7 = V(PRINTER1) 00060000 *| GPR12, GPR13 = UNUSED 00061000 * GPR14 = RETURN ADDRESS 00062000 *| GPR15 = BASE REGISTER 00063000 * 00064000 * NOTES - 00065000 * 00066000 * NONE 00067000 * 00068000 * OPERATION - 00069000 * 00070000 *| DMSDBD FIRST OBTAINS THE ADDRESS OF DUMPTITLE AND 00071000 * SENDS THE TITLE TO THE VIRTUAL PRINTER. IT THEN 00072000 * OBTAINS THE ADDRESSES OF THE GENERAL-PURPOSE REGISTER 00073000 * SAVE AREA, THE FLOATING-POINT REGISTER SAVE AREA, THE 00074000 * PSW REQUESTED IN REGISTER 0, THE CSW AND THE CAW. THE 00075000 * CONTENTS OF THE SAVE AREAS ARE SENT TO THE VIRTUAL 00076000 * PRINTER WITH APPROPRIATE HEADINGS. 00077000 * 00078000 * THE ADDRESS OF LOWCORE IS THEN OBTAINED. IF THIS 00079000 *| STARTING LOCATION IS LESS THEN X'A0' THAT PORTION OR 00080000 *| ALL OF LOWCORE FROM 0 TO X'A0' UP TO AND INCLUDING THE 00081000 * ENDING DUMPING LOCATION IS SENT TO THE VIRTUAL PRINTER. 00082000 * THE PRINTER IS CLOSED AFTER THE LAST LINE IS DUMPED. 00083000 * CONTROL IS PASSED BACK TO THE CALLER PROGRAM. 00084000 *. 00085000 EJECT 00086000 DMSDBD START 0 00087000 USING *,R15 BASE REGISTER 00088000 SPACE 1 00089000 USING NUCON,R0 ACCESS NUCLEUS AREA CONSTANTS 00090000 USING DBDPLIST,R1 ACCESS PLIST SYMBOLICALLY 00091000 SPACE 1 00092000 USING DMSDBD,R15 BASE REGISTER 00093000 ST R3,CPULOG SAVE REGISTER 3 00094000 L R3,=V(DBGSECT) ACCESS DEBUG STORAGE 00095000 USING DBGSECT,R3 00096000 STM R2,R11,ARGS SAVE THE REGISTERS 00097000 MVC ARGS+4(4),CPULOG SAVE THE ORIGINAL REGISTER 3 00098000 SPACE 1 00099000 * 00100000 * NEED PRINTER ADDRESS IN R7 00101000 * 00102000 L R7,ADEVTAB A(DEVICE TABLE) 00103000 USING DEVTAB,R7 DESCRIPTION OF DEVICE TABLE 00104000 LH R7,PRINTER1 A(PRINTER) 00105000 DROP R7 00106000 * 00107000 NI DBGSWTCH,255-DBDEXIT CLEAR DUMP EXIT FLAG 00108000 MVI LINE,C' ' BLANK DBGOUT LINE 00109000 MVC LINE+1,LINE THE REST OF IT 00110000 * 00111000 MVI SAVE1,4 4 PRINTER LINES FOR THE TITLE 00112000 L R6,AGPRS GET A(REG SAVE AREA) 00113000 LA R8,CCWPRINT GET IT WHILE WE CAN 00114000 ST R8,CAW 00115000 L R8,ATITLE GET ADDRESS OF DUMPTITLE 00116000 ST R8,CCWPRINT 00117000 MVI CCWPRINT,EJECT NEW PAGE 00118000 BAL R11,DUMPIO GO I/O IT 00119000 MVI CCWPRINT,SP3 DOUBLE SPACE AFTER TITLE 00120000 BAL R11,DUMPIO EXECUTE DUMP DBGOUT 00121000 LA R8,DBGOUT PUT BUFFER ADDRESS INTO R8 00122000 ST R8,CCWPRINT 00123000 MVC LINE(9),=CL9' GR 0-7' 00124000 MVI CCWPRINT+7,X'62' PRINT ONLY 96 BYTES 00125000 MVI CCWPRINT,SP1 SINGLE SPACE 00126000 BAL R10,FRMLIN 00127000 MVI LINE+6,C'8' RESET LINE HEADER 00128000 MVI LINE+8,C'F' 00129000 MVI CCWPRINT,SP2 00130000 BAL R10,FRMLIN 00131000 L R6,AFPRS GET V(ADDRESS OF FPR SAVE) 00132000 MVC LINE(9),=CL9' FPREGS' 00133000 MVC LASTLINE(32),0 FILL IT WITH SOMETHING 00134000 MVI CCWPRINT,SP2 DOUBLE SPACE 00135000 BAL R10,FRMLIN 00136000 EJECT 00137000 * 00138000 * CODE TO PRINT 'PSW' 'CSW' AND 'CAW' WITH DUMP 00139000 * 00140000 L R10,ALOC SET UP LOWCORE ADDRESS TEMP. 00141000 MVI DBGOUT,C' ' 00142000 MVC DBGOUT+1(132),DBGOUT CLEAR BUFFER 00143000 MVC DBGOUT+11(4),=CL4'PSW=' 00144000 AR R10,R0 R0=V(APPR. PSW UPON DEBUG ENTRY) TR 00145000 UNPK DBGOUT+17(9),0(5,R10) GET PSW 00146000 TR DBGOUT+17(8),TBL1-240 00147000 MVI DBGOUT+25,X'40' BLANK OUT THE GARBAGE BYTE @VA09674 00147500 UNPK DBGOUT+26(9),4(5,R10) 00148000 TR DBGOUT+26(8),TBL1-240 00149000 MVI DBGOUT+34,X'40' BLANK OUT THE GARBAGE BYTE @VA09674 00149500 SR R10,R0 00150000 MVC DBGOUT+37(4),=CL4'CSW=' 00151000 UNPK DBGOUT+43(9),64(5,R10) GET CSW 00152000 TR DBGOUT+43(8),TBL1-240 00153000 MVI DBGOUT+51,X'40' BLANK OUT THE GARBAGE BYTE @VA09674 00153500 UNPK DBGOUT+52(9),68(5,R10) 00154000 TR DBGOUT+52(8),TBL1-240 00155000 MVI DBGOUT+60,X'40' BLANK OUT THE GARBAGE BYTE @VA09674 00155500 MVC DBGOUT+63(4),=CL4'CAW=' 00156000 UNPK DBGOUT+69(9),72(5,R10) GET CAW 00157000 TR DBGOUT+69(8),TBL1-240 00158000 MVI DBGOUT+77,X'40' BLANK OUT THE GARBAGE BYTE @VA09674 00158500 MVI CCWPRINT,SP2 00159000 LR R10,R11 00160000 BAL R11,DUMPIO 00161000 LR R11,R10 00162000 MVI DBGOUT,C' ' 00163000 MVC DBGOUT+1(132),DBGOUT CLEAR BUFFER 00164000 LA R11,1(,R11) INCREMENT LINE COUNTER FOR SP2 00165000 STC R11,SAVE1 SAVE IT 00166000 EJECT 00167000 * 00168000 * DUMP LOWCORE LOCATIONS 00169000 * 00170000 MVI CCWPRINT+7,X'85' RESTORE FULL L NE PRINT 00171000 MVI CCWPRINT,SP1 RETURN TO SINGLE SPACING 00172000 MVC LINE(9),=CL9' 000000' SET LINE IDENTIFICATION 00173000 L R6,AFIRST GET FIRST DUMPING LOCATION 00174000 N R6,EVENOFF 00175000 ST R6,AFIRST TRUNCATED TO EVEN-HEX TENTHS 00176000 L R10,ALOC START AT VIRTUAL ZERO 00177000 LA R4,DMPLOW POINTER INTO DUMPING PATHS 00178000 LA R5,X'A0' TEST IF GREATER THAN LOWER CORE 00179000 CR R6,R5 IS FIRSTLOC LT X'A0'? 00180000 BNL DOK NO, START AT FIRSTLOC P0482 00181000 ST R5,AFIRST SET FIRSTLOC = X'A0' 00182000 SR R5,R5 FIRSTLOC IS BWT ZERO-X'A0' 00183000 DMPLOW1 CR R6,R5 00184000 BNE DMPLOW2 NOT YET. 00185000 DMPLOW1A AR R6,R10 GET LOCATION OF VIRTUALLY SAVED LOC 00186000 L R5,AFINAL SET AFINAL FOR COMPARES P0482 00187000 AH R5,=X'00C0' P0482 00188000 ST R5,AFINAL P0482 00189000 BR R4 00190000 DMPLOW2 LA R4,LTWENTY-LZERO(R4) INCR. DUMP POINTER P0482 00191000 LA R5,32(,R5) INCREMENT COMPARISION POITNER 00192000 B DMPLOW1 00193000 DONE L R5,AFINAL RESET FINAL ADDRESS P0482 00194000 SH R5,=X'00C0' P0482 00195000 ST R5,AFINAL P0482 00196000 B DONE1 EXIT P0482 00197000 DMPLOW EQU * DUMP SAVED LOW CORE LOCATIONS 00198000 LZERO MVI LINE+7,C'0' 00199000 BAL R10,FRMLIN 00200000 C R6,AFINAL END OF REQUEST P0482 00201000 BNL DONE BRANCH IF YES P0482 00202000 LTWENTY MVI LINE+7,C'2' 00203000 BAL R10,FRMLIN 00204000 C R6,AFINAL END OF REQUEST P0482 00205000 BNL DONE YES P0482 00206000 LFORTY MVI LINE+7,C'4' 00207000 BAL R10,FRMLIN 00208000 C R6,AFINAL END OF REQUEST P0482 00209000 BNL DONE YES P0482 00210000 LSIXTY MVI LINE+7,C'6' 00211000 BAL R10,FRMLIN 00212000 C R6,AFINAL END OF REQUEST P0482 00213000 BNL DONE YES P0482 00214000 LEIGHTY MVI LINE+7,C'8' 00215000 BAL R10,FRMLIN 00216000 MVI CCWPRINT,SP1 00217000 L R6,AFIRST GET FIRST DUMPING CORE LOCATION 00218000 L R5,AFINAL RESET FINAL ADDRESS P0482 00219000 SH R5,=X'00C0' P0482 00220000 ST R5,AFINAL P0482 00221000 NEXTLINE EQU * DUMP FROM ACTUAL CORE LOCATIONS 00222000 C R6,AFINAL AT END OF DUMP AREA ? 00223000 BL DOK NOPE. CONTINUE VOMITTING CORE 00224000 DONE1 OI DBGSWTCH,DBDEXIT SIGNAL DUMP RETURN P0482 00225000 MVI CCWPRINT,CLOSEPRT CLOSE OUT PRINTER FILE 00226000 B DUMPIO EXECUTE 00227000 DOK EQU * WRITEOUT CORE LOCATIONS 00228000 LA R5,OUTRNGE GET RETURN ADDRESS IN CASE A @VM03020 00228100 OI DBGFLAGS,DBGRECUR PROGRAM CHECK OCCURS. @VM03020 00228200 CLC LASTLINE(32),0(R6) IS LAST LINE SAME AS CURRENT 00229000 BNE ST6 NO 00230000 NI DBGFLAGS,255-DBGRECUR CLEAR RECURSION FLAG. @VM03020 00230100 LA R6,32(,R6) INCREASE LOC CTR BY 32 00231000 TM DBGSWTCH,DBDDMSG PRINT DUPLICATE MESSAGE ? 00232000 BO NEXTLINE NO. ALREADY PRINT IT 00233000 OI DBGSWTCH,DBDDMSG SIGNAL DUPLICATE PRINTED LINE 00234000 MVI LINE,C' ' CLEAR LINE BUFFER 00235000 MVC LINE+1(132),LINE 00236000 MVC LINE+20(L'DUPMSG),DUPMSG MOVE IN MESSAGE 00237000 MVI CCWPRINT,SP1 VERIFY SINGLE SPACE 00238000 BAL R11,DUMPIO 00239000 IC R11,SAVE1 COUNT THE LINE 00240000 LA R11,1(,R11) 00241000 STC R11,SAVE1 SAVE THE LINE COUNT 00242000 B NEXTLINE 00243000 * LINE HEADER 00244000 ST6 EQU * 00245000 NI DBGFLAGS,255-DBGRECUR CLEAR RECURSION FLAG. @VM03020 00245100 NI DBGSWTCH,255-DBDDMSG CLEAR DUPLICATE MSG INDICATOR 00246000 MVC LASTLINE(32),0(R6) SAVE LINE TO BE PRINTR 00247000 ST R6,DEC 00248000 UNPK LINE+3(7),DEC+1(4) 00249000 TR LINE+3(6),TBL1-240 00250000 MVI LINE+9,C' ' 00251000 BAL R10,FRMLIN 00252000 B NEXTLINE 00253000 SPACE 2 00253100 OUTRNGE A R6,F4096 BUMP TO NEXT PAGE IN STORAGE @VM03020 00253200 SRL R6,12 NOW ROUND TO A @VM03020 00253300 SLL R6,12 FULL PAGE BOUNDARY. @VM03020 00253400 ICM R5,B'1000',0(R6) IS THIS ADDRESS VALID ? @VM03020 00253500 B ST6 IF HERE, ADDRESS IS GOOD. @VM03020 00253600 EJECT 00254000 * 00255000 * PRINTER CHANNEL COMMAND INITIATOR 00256000 * 00257000 DUMPIO EQU * WRITEOUT CORE 00258000 SIO 0(R7) GO PRINT IT 00259000 BC 1,NOTOP MESSAGE IF NOT AVAILABLE @VA05073 00260100 BC 2,DUMPIO REPEAT IF BUSY @VA05073 00260200 TIO 0(R7) GIVE IT A CHANCE TO FINISH 00261000 BC 7,*-4 00262000 TM DBGSWTCH,DBDEXIT EXIT SIGNALLED ? 00263000 BO GETOUT IF EQUAL YES, GET OUT. 00264000 BR R11 NO, GO BACK FOR MORE. 00265000 GETOUT EQU * 00266000 LM R2,R11,ARGS RESTORE REGISTERS 00267000 BR R14 BACK TO CALLER 00268000 SPACE 1 00268100 NOTOP EQU * @VA05073 00268200 LR R2,R15 SAVE ADDRESSABILITY OVER SVC @VA05073 00268300 LR R4,R14 SAVE CALLER'S ADDRESS @VA09007 00268350 DMSERR TEXT='PRINTER (...) NOT ATTACHED',SUB=(HEX,(7)),NUM=113X00268400 ,LET=S,CSECT=DBG,TYPCALL=BALR @VA09007 00268500 LR R15,R2 RESTORE ADDRESSABILITY @VA05073 00268600 LR R14,R4 RESTORE CALLER'S ADDRESS @VA09007 00268650 B GETOUT EXIT @VA05073 00268700 EJECT 00269000 * 00270000 * CORE LOCATION PRINTOUT IN "HEX= 00271000 * 00272000 FRMLIN DS 0H 00273000 LA R4,LINE1 00274000 LA R5,LINE1A 00275000 LA R2,2 00276000 * TRANSLATE LINE DATE 00277000 A1 LA R11,4 00278000 A2 L R9,0(,R6) 00279000 ST R9,DEC 00280000 LA R6,4(,R6) 00281000 UNPK 0(9,R4),DEC(5) 00282000 TR 0(8,R4),TBL1-240 00283000 MVC 8(2,R4),BLANKS 00284000 LA R4,10(,R4) 00285000 ST R9,0(,R5) 00286000 TR 0(4,R5),TBL2 00287000 LA R5,4(,R5) 00288000 BCT R11,A2 00289000 MVC 0(4,R4),BLANKS 00290000 LA R4,4(,R4) 00291000 BCT R2,A1 00292000 MVI LINE1B,C'*' SET UP PRETTY INTERPRETATIONS 00293000 MVI LINE1C,C'*' 00294000 A4 BAL R11,DUMPIO 00295000 IC R11,SAVE1 INCREMENT PRINT LINE COUNTER 00296000 LA R11,1(,R11) 00297000 STC R11,SAVE1 SAVE IT 00298000 CLI SAVE1,55 MAX OF 55 LINES TO PAGE 00299000 BCR 4,R10 NOPE. 00300000 MVI CCWPRINT,EJECT YES. GET TO NEW PAGE 00301000 BAL R11,DUMPIO 00302000 MVI SAVE1,0 RESET LINE COUNTER 00303000 MVI CCWPRINT,SP1 RESET CCW 00304000 BR R10 00305000 * 00306000 EJECT 00307000 * 00308000 * CONSTANTS 00309000 * 00310000 SPACE 1 00311000 DS 0F 00312000 F4096 DC F'4096' FULL PAGE CONSTANT @VM03020 00312100 EVENOFF DC X'FFFFFFE0' HIGHER UPPER 00313000 SP1 EQU X'09' PRINT SPACE ONE LINE 00314000 SP2 EQU X'11' PRINT SPACE 2 LINES 00315000 SP3 EQU X'19' PRINT SPACE 3 LINES 00316000 EJECT EQU X'8B' EJECT PAGE 00317000 CLOSEPRT EQU X'C0' ILLEGAL CCW TO CLOSE PRINTER 00318000 BLANKS DC 4X'40' 00319000 DUPMSG DC C'*** DUPLICATE CORE LOCATIONS ***' 00320000 TBL1 DC C'0123456789ABCDEF' 00321000 TBL2 DS 0X 00322000 DC 64C'.' 00323000 DC C' ' 00324000 DC 15C'.' 00325000 DC C'&&' 00326000 DC 10C'.' 00327000 DC C'$*.;.-/' 00328000 DC 9C'.' 00329000 DC C',%' 00330000 DC 14C'.' 00331000 DC C' ' 00332000 DC 4C'.' 00333000 DC C'ABCDEFGHI' 00334000 DC 7C'.' 00335000 DC C'JKLMNOPQR' 00336000 DC 8C'.' 00337000 DC C'STUVWXYZ' 00338000 DC 23C'.' 00339000 DC C'ABCDEFGHI' 00340000 DC 7C'.' 00341000 DC C'JKLMNOPQR' 00342000 DC 8C'.' 00343000 DC C'STUVWXYZ' 00344000 DC 6C'.' 00345000 DC C'0123456789' 00346000 DC 6C'.' 00347000 LTORG 00348000 EJECT 00349000 DBDPLIST DSECT 00350000 AGPRS DS A A(REG. 0-15 SAVE AREA) 00351000 ALOC DS A A(LOWCORE SAVE AREA) 00352000 AFIRST DS A A(START DUMP) 00353000 AFINAL DS A A(END OF DUMP) 00354000 AFPRS DS A A(FLOATING POINT REG. SAVE AREA) 00355000 ATITLE DS A A(DUMP TITLE) 00356000 EJECT 00357000 DBGSECT 00358000 NUCON 00359000 REGEQU 00360000 EQUATES 00361000 DEVTAB 00362000 END 00363000