CAC-2017-01-02

Pascal debugging

./dps8 pascal.ini

./pascal.expect

Error:  fault_tag_1 by >user_dir_dir>SysAdmin>Repair>test|12 (line 3)
(while in operator return_zero)
referencing stack_4|0 (in process dir)
Ascii data where pointer expected.

lrn
   234 >process_dir_dir>!BLbBQBWbBBBBBB>stack_4
   332 >unb>bound_pascal_runtime_
   356 >unb>pascal
   473 >user_dir_dir>SysAdmin>Repair>test

Picking up where I left off in http://ringzero.wikidot.com/wiki:cac-2016-08-21

WATCH [7293934044] write  61741207 000000440040 (Write)
0276:001773 600307255100

   276 >system_library_1>bound_multics_bce_

pbm >system_library_1>bound_multics_bce_
command_processor_                   0  20102      0      0    100    232
find_command_                    20102   3414      0    316    332    136

offset 01773 in command_processor_

ac x >ldd>sl1>s>bound_multics_bce_.s command_processor_.pl1

pl1 command_processor_ -ot -list

                                                            STATEMENT 1 ON LINE 528
               arg_list.has_command_name = "1"b;

001772  aa   400000 2350 07   lda       131072,dl
001773  aa  6 00307 2551 00   orsa      pr6|199             arg_list.has_command_name

Confused;  added to doAppend:

if (cpu.PPR.PSR > 0140 && cpu.TPR.TSR == 0234 && address == 0) sim_printf ("hit IC %05o:%06o\n", cpu.PPR.PSR, cpu.PPR.IC);

This should catch '(while in operator return_zero) referencing stack_4|0 (in process dir)' but isn't.

   257 >sl1>bound_library_wired_

Trying tracing segno = 0257 while running test....
log oscar set debug debug.log
log oscar dbgsegno 0257
log oscar set cpu debug=trace
log oscar set cpu debug=core
log oscar set cpu debug=fault
log oscar set cpu debug=regdumpaqi
log oscar set cpu debug=final

No luck; very confused....

Add a printf to the F1 fault check....

F1 00332:  2350

The F1 fault occurs in seg 332:

   332 >unb>bound_pascal_runtime_

This is NOT in pl1_operators, as the error message claims....

pbm >unb>bound_pascal_runtime_

it is in pascal_operators....

ac x >ldd>unb>source>bound_pascal_runtime_.s pascal_operators_.alm

                                  2964  "                   return zero operator
                                  2965  "                   --------------------
                                  2966  "
                                  2967  "         calling sequence:
                                  2968  "                   tsp3      0|87
                                  2969  "
                                  2970  "         Sets to zero return code if any (last arg must be integer)
                                  2971  "

    002337                        2972  return_zero:
    002337  aa  6 00032 3515 20   2973            epp1      6|stack_frame.arg_ptr,*
    002340  aa  1 00001 2341 00   2974            szn       1|1
    002341  aa  3 00000 6001 00   2975            tze       3|0
    002342  aa  1 00000 2371 00   2976            ldaq      1|0
    002343  aa   000000 6210 02   2977            eax1      0,qu
    002344  aa   000001 7360 00   2978            qls       1
    002345  aa   000012 3750 07   2979            ana       8+2,dl
    002346  aa   000002 6000 04   2980            tze       +2,ic
    002347  aa   000002 0760 03   2981            adq       2,du
    002350  aa  1 00000 2351 22   2982            lda       1|0,qu*

One speculates the the last arg is not an integer....

Tracing the actual program....

   473 >user_dir_dir>SysAdmin>Repair>test

log oscar set debug debug.log
log oscar dbgsegno 0473
log oscar set cpu debug=trace
log oscar set cpu debug=core
log oscar set cpu debug=fault
log oscar set cpu debug=regdumpaqi
log oscar set cpu debug=final

DBG(75340583937)> CPU0 TRACE: call6 PPR.PRR 4
DBG(75340583939)> CPU0 TRACE: 00473:000002 4 000000371404 (EPP5 000000,IC) 000000 371(1) 0 0 0 04
DBG(75340583941)> CPU0 TRACE: 00473:000003 4 700050352120 (EPP2 PR7|50,N*) 700050 352(0) 1 0 1 00
DBG(75340583943)> CPU0 TRACE: 00473:000004 4 200010352120 (EPP2 PR2|10,N*) 200010 352(0) 1 0 1 00
DBG(75340583945)> CPU0 TRACE: 00473:000005 4 560000236007 (LDQ 560000,DL) 560000 236(0) 0 0 0 07
DBG(75340583947)> CPU0 TRACE: 00473:000006 4 000140627000 (EAX7 000140) 000140 627(0) 0 0 0 00
DBG(75340583949)> CPU0 TRACE: 00473:000007 4 200117273100 (TSP3 PR2|117) 200117 273(0) 1 0 0 00
DBG(75340583997)> CPU0 TRACE: 00473:000012 4 000127273100 (TSP3 PR0|127) 000127 273(0) 1 0 0 00

                                                            STATEMENT 1 ON LINE 1
          program test
000000  ta     000016000000
000001  da     000022300000
000002  aa   000000 3714 04   epp5      0,ic                000002 = 000000371404
000003  aa  7 00050 3521 20   epp2      pr7|40,*
000004  aa  2 00010 3521 20   epp2      pr2|8,*
000005  aa   560000 2360 07   ldq       188416,dl
000006  aa   000140 6270 00   eax7      96
000007  aa  2 00117 2731 00   tsp3      pr2|79              MAIN_entry
000010  aa     000000000000
000011  ls     000010000134
                                                            STATEMENT 1 ON LINE 3
          .
000012  aa  0 00127 2731 00   tsp3      pr0|87              return_zero
                                                            STATEMENT 1 ON LINE 3  (CONT.)
000013  ia  4 00010 3521 00   epp2      pr4|8
000014  aa  0 00050 7101 00   tra       pr0|40              ext_return

entry_operators_begin:
"
"                   entry operators for MAIN and exportable procedures
"                   --------------------------------------------------
"
"         assumed that:     (Multics convention)
"                   PR0 -> parameter list
"                   PR6 -> stack frame of the calling procedure
"                   PR7 -> stack header
"
"         calling sequence:
"                   epp5      0,ic                entry point addr
"                   epp2      7|stack_header.trans_op_tv_ptr   MUST BE SECOND WORD (for TRACE)
"                   epp2      2|8,*               to get ptr to pascal operators
"                   ldq       [PASCAL execution flags],dl
"                   eax7      [stack_frame size in words (n * 16)]
"                   tsp3      2|{op number}

"                   return zero operator
"                   --------------------
"
"         calling sequence:
"                   tsp3      0|87
"
"         Sets to zero return code if any (last arg must be integer)
"
return_zero:
          epp1      6|stack_frame.arg_ptr,*
          szn       1|1
          tze       3|0
          ldaq      1|0
          eax1      0,qu
          qls       1
          ana       8+2,dl
          tze       +2,ic
          adq       2,du
          lda       1|0,qu*

gtss

gtss
GTSS 4JS3 (4.0)
*10 print "foo"
*list

Error:  no_write_permission condition by !BBBKLCbxwQXzHF.temp.0321|326 (in process dir)
referencing >system_library_unbundled>gtss_fast_library_>0|2540

DBG(182256001)> CPU0 TRACE: 00321:162747 4 040100100400 (MLR 040100) 040100 100(1) 0 0 0 00
ins  040100100400
fill 040 
t 0
mf2 100 AR, not RL, not ID, rtype n
mf1: 0  not AR, not RL, not ID, rtype n

op 1: 000000000000
address 0  CN 0 9 bit 0 words
op 2 600112000764
address 6|112 CN 0 9 bit 0764 words

"Fill with blanks"

Wrong instruction...

TRACE: 00321:000000|000326 4 000140100540 (MLR PR0|140,F1) 000140 100(1) 0 0 0 00

ins: 000140100540
mf1: 140: AR, RL, 0
fill 000
T 0
mf2: 140: AR, RL, 0

op 1: 000000000001
Address 0:0, CN 0, 9 bit, length AU 

op 2: 100000000001
Address 1:0, CN 0, 9 bit, length AU

PR0/ap: SNR=00234 RNR=4 WORDNO=002550 BITNO:00
PR1/ab: SNR=00317 RNR=4 WORDNO=002547 BITNO:00

pr0 is pointing to stack 4
pr1 is pointing into >system_library_unbundled>gtss_fast_library_>0
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License