📄 mktests
字号:
execution completed, exit code is 06 'endcat'echo tests/mod/call.inrm -f tests/mod/call.incat > tests/mod/call.in <<'endcat'stop at 15runcall p1()call p2(3)call p3("blah", 3)call fprintf(IO_OUTPUT, "mainlocal = %d", mainlocal)print mainlocalcall callcall call()call p1(3)call p2("blah")'endcat'echo tests/mod/call.modrm -f tests/mod/call.modcat > tests/mod/call.mod <<'endcat'(* * Test program for dbx call command. *)module main;from io import writef, output;var global : integer;procedure startup ;var mainlocal : integer;begin global := 2; mainlocal := 19; p1(); p2(mainlocal); p3("test", 3);end startup;procedure p1 ();begin writef(output, "in p1\n"); global := 4;end p1;procedure p2 (frommain : integer);begin writef(output, "in p2(%d)\n", frommain); global := 9;end p2;procedure p3 (s : array of char; i : integer);begin writef(output, "in p3(%s, %d)\n", s, i); global := 10;end p3;begin startup;end main.'endcat'echo tests/mod/call.outrm -f tests/mod/call.outcat > tests/mod/call.out <<'endcat'reading symbolic information ...[1] stop at "call.mod":15in p1in p2(3)in p3(blah, 3)mainlocal = 0[1] stopped in startup at line 15 in file "call.mod" 15 mainlocal := 19;p1 returns successfullyp2 returns successfullyp3 returns successfullyfprintf returns successfully0 call call ^ syntax error"call" not call-abletoo many parameters in call to p1type mismatch for frommain in call to p2'endcat'echo tests/mod/reals.modrm -f tests/mod/reals.modcat > tests/mod/reals.mod <<'endcat'(* * Test of reals and longreals. *)module main;var x : longreal; y : real;procedure f (x : real) : longreal;begin return longfloat(3.14*x);end f;begin y := 3.0; x := f(y);end main.'endcat'echo tests/mod/reals.inrm -f tests/mod/reals.incat > tests/mod/reals.in <<'endcat'print 3+4print 3.5+4.5stop in _initrunnextstepprint yprint y + 2print 3.5*ystop in fcontwherecont'endcat'echo tests/mod/reals.outrm -f tests/mod/reals.outcat > tests/mod/reals.out <<'endcat'reading symbolic information ...7 8.0 [1] stop in _init[1] stopped in _init at 0x6a0000006a pushl 12(ap)stopped in _init at line 16 in file "reals.mod" 16 y := 3.0;stopped in _init at line 17 in file "reals.mod" 17 x := f(y);3.0 5.0 10.5 [3] stop in f[3] stopped in f at line 10 in file "reals.mod" 10 procedure f (x : real) : longreal;f(x = 3.0), line 10 in "reals.mod"_init(0x1, 0x7fffed74, 0x7fffed7c), line 17 in "reals.mod"execution completed, exit code is 0'endcat'echo tests/mod/assign.modrm -f tests/mod/assign.modcat > tests/mod/assign.mod <<'endcat'module main;from io import Writef, output;var a : array[1..100] of char;begin a := "blah"; Writef(output, "%s", a);end main.'endcat'echo tests/mod/assign.inrm -f tests/mod/assign.incat > tests/mod/assign.in <<'endcat'stop at 6runprint aset a[1] = 'x'print aset a = "xyzzy"print acontprint a'endcat'echo tests/mod/assign.outrm -f tests/mod/assign.outcat > tests/mod/assign.out <<'endcat'reading symbolic information ...[1] stop at "assign.mod":6xyzzy[1] stopped in _init at line 6 in file "assign.mod" 6 Writef(output, "%s", a);'blah' 'xlah' 'xyzzy' execution completed, exit code is 0'xyzzy' 'endcat'echo tests/mod/recur.modrm -f tests/mod/recur.modcat > tests/mod/recur.mod <<'endcat'module main;from io import Writef, output;procedure r (n : integer);begin Writef(output, "blah\n"); if n > 0 then r(n - 1); Writef(output, "blah2\n"); end;end r;begin r(5);end main.'endcat'echo tests/mod/stkcmds.inrm -f tests/mod/stkcmds.incat > tests/mod/stkcmds.in <<'endcat'stop in p2runcontwherefuncprint iupfuncprint iupfuncprint iupfuncprint iupfuncupdownfuncdownfuncdownfuncdownfuncdownreturnfunc; returnfunc; returnfunc; returnfunc; returnfunc; returnfunc; returnfunc; returnfunc; return'endcat'echo tests/mod/recur.inrm -f tests/mod/recur.incat > tests/mod/recur.in <<'endcat'stop at 15runstepnextnextnextcont'endcat'echo tests/mod/recur.outrm -f tests/mod/recur.outcat > tests/mod/recur.out <<'endcat'reading symbolic information ...[1] stop at "recur.mod":15[1] stopped in _init at line 15 in file "recur.mod" 15 r(5);stopped in r at line 7 in file "recur.mod" 7 Writef(output, "blah\n");stopped in r at line 8 in file "recur.mod" 8 if n > 0 thenstopped in r at line 9 in file "recur.mod" 9 r(n - 1);blahblahblahblahblahblahblah2blah2blah2blah2blah2stopped in r at line 10 in file "recur.mod" 10 Writef(output, "blah2\n");execution completed, exit code is 0'endcat'echo tests/mod/jsb.inrm -f tests/mod/jsb.incat > tests/mod/jsb.in <<'endcat'stop in prunwhereprint globalcont'endcat'echo tests/mod/stkcmds.outrm -f tests/mod/stkcmds.outcat > tests/mod/stkcmds.out <<'endcat'reading symbolic information ...[1] stop in p2[1] stopped in p2 at line 5 in file "stkcmds.mod" 5 procedure p2 (i : integer);[1] stopped in p2 at line 5 in file "stkcmds.mod" 5 procedure p2 (i : integer);p2(i = 3), line 5 in "stkcmds.mod"p2(i = 2), line 8 in "stkcmds.mod"p1(i = 1), line 14 in "stkcmds.mod"_init(0x1, 0x7fffed74, 0x7fffed7c), line 19 in "stkcmds.mod"p23 p22 p11 _init0 .not that many levels_initp1p2p2not that many levels[1] stopped in p2 at line 5 in file "stkcmds.mod" 5 procedure p2 (i : integer);p2[1] stopped in p2 at line 5 in file "stkcmds.mod" 5 procedure p2 (i : integer);p2stopped in p2 at line 8 in file "stkcmds.mod" 8 p2(i+1);p2stopped in p2 at line 8 in file "stkcmds.mod" 8 p2(i+1);p2stopped in p2 at line 8 in file "stkcmds.mod" 8 p2(i+1);p2stopped in p2 at line 8 in file "stkcmds.mod" 8 p2(i+1);p2stopped in p1 at line 14 in file "stkcmds.mod" 14 p2(i+1);p1stopped in _init at line 19 in file "stkcmds.mod" 19 p1(i+1);_initexecution completed, exit code is 0'endcat'chmod 775 tests/{cc,mod}/checkecho x - arrays.insed 's/^X//' >tests/mod/arrays.in <<+E+O+F+Xwhatis main.p.aXstop at 12XrunXprint aXprint a[3], a[4], a[5]XstepXstepXwhereXprint b, c+E+O+F+echo x - assign.insed 's/^X//' >tests/mod/assign.in <<+E+O+F+Xstop at 6XrunXprint aXset a[1] = 'x'Xprint aXset a = "xyzzy"Xprint aXcontXprint a+E+O+F+echo x - call.insed 's/^X//' >tests/mod/call.in <<+E+O+F+Xstop at 15XrunXcall p1()Xcall p2(3)Xcall p3("blah", 3)Xcall fprintf(IO_OUTPUT, "mainlocal = %d", mainlocal)Xprint mainlocalXcall callXcall call()Xcall p1(3)Xcall p2("blah")+E+O+F+echo x - imports.insed 's/^X//' >tests/mod/imports.in <<+E+O+F+Xwhereis vXwhereis pXwhatis main.pXwhatis main.TXwhatis main.OTXwhatis imported.pXstop in imported.BlahXrunXwhere+E+O+F+echo x - jsb.insed 's/^X//' >tests/mod/jsb.in <<+E+O+F+Xstop in main.pXrunXwhereXprint globalXcont+E+O+F+echo x - nested.insed 's/^X//' >tests/mod/nested.in <<+E+O+F+Xwhereis iXwhereis jXstop at 18XrunXprint i, j, main.i, p.i, p.jXstepXprint i, j, main.iXcontXprint main.i+E+O+F+echo x - procvars.insed 's/^X//' >tests/mod/procvars.in <<+E+O+F+Xwhatis main.q.tXstop in main.pXstop in main.qXrunXstepXstepXprint tXcontXwhereXstepXstepXprint j+E+O+F+echo x - reals.insed 's/^X//' >tests/mod/reals.in <<+E+O+F+Xprint 3+4Xprint 3.5+4.5Xstop in _initXrunXnextXstepXprint yXprint y + 2Xprint 3.5*yXstop in fXcontXwhereXcont+E+O+F+echo x - records.insed 's/^X//' >tests/mod/records.in <<+E+O+F+Xwhatis RecXwhatis main.rXrunXprint main.rXprint main.r.realValue, main.r.subrange, main.r.intValue, main.r.charValue+E+O+F+echo x - recur.insed 's/^X//' >tests/mod/recur.in <<+E+O+F+Xstop at 15XrunXstepXnextXnextXnextXcont+E+O+F+echo x - sets.insed 's/^X//' >tests/mod/sets.in <<+E+O+F+Xwhatis ColorXwhatis ColorSetXstop in sets.pXrunXstepXwhereXstepXprint sets.sXstepXstepXwhereXprint sets.s+E+O+F+echo x - stkcmds.insed 's/^X//' >tests/mod/stkcmds.in <<+E+O+F+Xstop in p2XrunXcontXwhereXfuncXprint iXupXfuncXprint iXupXfuncXprint iXupXfuncXprint iXupXfuncXupXdownXfuncXdownXfuncXdownXfuncXdownXfuncXdownXreturnXfunc; returnXfunc; returnXfunc; returnXfunc; returnXfunc; returnXfunc; returnXfunc; returnXfunc; return+E+O+F+echo x - arrays.outsed 's/^X//' >tests/mod/arrays.out <<+E+O+F+Xreading symbolic information ...X(var parameter) a : array[integer] of integer;X[1] stop at "arrays.mod":12X[1] stopped in main.p at line 12 in file "arrays.mod"X 12 a[3] := i;X(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) X4 5 6 Xstopped in main.p at line 13 in file "arrays.mod"X 13 a[4] := j;Xstopped in _init at line 21 in file "arrays.mod"X 21 b[BLUE] := 3;X_init(0x1, 0x7fffee34, 0x7fffee3c), line 21 in "arrays.mod"X(0, 0, 0) RED X+E+O+F+echo x - assign.outsed 's/^X//' >tests/mod/assign.out <<+E+O+F+Xreading symbolic information ...X[1] stop at "assign.mod":6Xxyzzy[1] stopped in _init at line 6 in file "assign.mod"X 6 Writef(output, "%s", a);X'blah' X'xlah' X'xyzzy' XXexecution completed, exit code is 0X'xyzzy' X+E+O+F+echo x - call.outsed 's/^X//' >tests/mod/call.out <<+E+O+F+Xreading symbolic information ...X[1] stop at "call.mod":15Xin p1Xin p2(3)Xin p3(blah, 3)Xmainlocal = 0[1] stopped in startup at line 15 in file "call.mod"X 15 mainlocal := 19;XXp1 returns successfullyXXp2 returns successfullyXXp3 returns successfullyXXfprintf returns successfullyX0 Xcall callX ^ syntax errorX"call" not call-ableXtoo many parameters in call to p1Xtype mismatch for frommain in call to p2X+E+O+F+echo x - imports.outsed 's/^X//' >tests/mod/imports.out <<+E+O+F+Xreading symbolic information ...Ximported.vXmem.MEMORY_DEALLOCATE.p mem.MEMORY_ALLOCATE.p mem.modmalloc.p mem.Storage_DEALLOCATE.p mem.Storage_ALLOCATE.p imported.p main.pXvar p : main.T;Xtype T = recordX a : integer;X b : integer;Xend;Xtype OT = integer;Xvar p : integer;X[1] stop in BlahX[1] stopped in Blah at line 8 in file "imported.mod"X 8 procedure Blah;XBlah, line 8 in "imported.mod"X_init(0x1, 0x7fffee34, 0x7fffee3c), line 16 in "imports.mod"X+E+O+F+echo x - jsb.outsed 's/^X//' >tests/mod/jsb.out <<+E+O+F+Xreading symbolic information ...X[1] stop in main.pXin p(3, blah, 4)X[1] stopped in main.p at line 7 in file "jsb.mod"X 7 procedure p (i : integer; s : array of char; j : integer);Xp(i = 3, s = 'blah', j = 4), line 7 in "jsb.mod"X_init(0x1, 0x7fffee38, 0x7fffee40), line 15 in "jsb.mod"X3 XXexecution completed, exit code is 0X+E+O+F+echo x - nested.outsed 's/^X//' >tests/mod/nested.out <<+E+O+F+Xreading symbolic information ...Xmain.p.i main.p.nestedp.i main.iXmain.p.j main.p.nestedp.jX[1] stop at "nested.mod":18X[1] stopped in nestedp at line 18 in file "nested.mod"X 18 j := i;X6 4 3 3 4 Xstopped in main.p at line 24 in file "nested.mod"X 24 i := j;X3 6 3 XXexecution completed, exit code is 0X6 X+E+O+F+echo x - procvars.outsed 's/^X//' >tests/mod/procvars.out <<+E+O+F+Xreading symbolic information ...Xvar t : (class 23);X[1] stop in main.pX[2] stop in main.qX[2] stopped in main.q at line 12 in file "procvars.mod"X 12 procedure q ;Xstopped in main.q at line 17 in file "procvars.mod"X 17 t := p;Xstopped in main.q at line 18 in file "procvars.mod"X 18 t(j);Xp X[1] stopped in main.p at line 7 in file "procvars.mod"X 7 procedure p (var i : integer);Xp(i = 0), line 7 in "procvars.mod"Xq, line 18 in "procvars.mod"X_init(0x1, 0x7fffee30, 0x7fffee38), line 23 in "procvars.mod"Xstopped in main.p at line 9 in file "procvars.mod"X 9 i := 3;Xstopped in main.q at line 19 in file "procvars.mod"X 19 j := j + 1;X3 X+E+O+F+echo x - reals.outsed 's/^X//' >tests/mod/reals.out <<+E+O+F+Xreading symbolic information ...X7 X8.0 X[1] stop in _initX[1] stopped in _init at 0x6aX0000006a pushl 12(ap)Xstopped in _init at line 16 in file "reals.mod"X 16 y := 3.0;Xstopped in _init at line 17 in file "reals.mod"X 17 x := f(y);X3.0 X5.0 X10.5 X[3] stop in fX[3] stopped in f at line 10 in file "reals.mod"X 10 procedure f (x : real) : longreal;Xf(x = 3.0), line 10 in "reals.mod"X_init(0x1, 0x7fffee34, 0x7fffee3c), line 17 in "reals.mod"XXexecution completed, exit code is 0X+E+O+F+echo x - records.outsed 's/^X//' >tests/mod/records.out <<+E+O+F+Xreading symbolic information ...Xtype Rec = recordX charValue : char;X intValue : integer;X subrange : 0..1000;X realValue : real;Xend;Xvar r : Rec;XXexecution completed, exit code is 0X(charValue = 'c', intValue = 3, subrange = 10, realValue = 3.4) X3.4 10 3 'c' X+E+O+F+echo x - recur.outsed 's/^X//' >tests/mod/recur.out <<+E+O+F+Xreading symbolic information ...X[1] stop at "recur.mod":15X[1] stopped in _init at line 15 in file "recur.mod"X 15 r(5);Xstopped in main.r at line 7 in file "recur.mod"X 7 Writef(output, "blah\n");Xstopped in main.r at line 8 in file "recur.mod"X 8 if n > 0 thenXstopped in main.r at line 9 in file "recur.mod"X 9 r(n - 1);XblahXblahXblahXblahXblahXblahXblah2Xblah2Xblah2Xblah2Xblah2Xstopped in main.r at line 10 in file "recur.mod"X 10 Writef(output, "blah2\n");XXexecution completed, exit code is 0X+E+O+F+echo x - sets.outsed 's/^X//' >tests/mod/sets.out <<+E+O+F+Xreading symbolic information ...Xtype Color = (RED, BLUE, GREEN);Xtype ColorSet = set of Color;X[1] stop in sets.pX[1] stopped in sets.p at line 8 in file "sets.mod"X 8 procedure p (var s : ColorSet);Xstopped in sets.p at line 10 in file "sets.mod"X 10 s := ColorSet{RED, BLUE};Xp(s = {}), line 10 in "sets.mod"X_init(0x1, 0x7fffee34, 0x7fffee3c), line 14 in "sets.mod"Xstopped in _init at line 15 in file "sets.mod"X 15 if BLUE in s thenX{RED, BLUE} Xstopped in _init at line 16 in file "sets.mod"X 16 s := s - ColorSet{BLUE};XXexecution completed, exit code is 0Xexit(0x0) at 0x200eX_init(0x1, 0x7fffee34, 0x7fffee3c), line 16 in "sets.mod"X{RED} X+E+O+F+echo x - stkcmds.outsed 's/^X//' >tests/mod/stkcmds.out <<+E+O+F+Xreading symbolic information ...X[1] stop in p2X[1] stopped in p2 at line 5 in file "stkcmds.mod"X 5 procedure p2 (i : integer);X[1] stopped in p2 at line 5 in file "stkcmds.mod"X 5 procedure p2 (i : integer);Xp2(i = 3), line 5 in "stkcmds.mod"Xp2(i = 2), line 8 in "stkcmds.mod"Xp1(i = 1), line 14 in "stkcmds.mod"X_init(0x1, 0x7fffee34, 0x7fffee3c), line 19 in "stkcmds.mod"Xp2X3 Xp2X2 Xp1X1 X_initX0 X.Xnot that many levelsX_initXp1Xp2Xp2Xnot that many levelsX[1] stopped in p2 at line 5 in file "stkcmds.mod"X 5 procedure p2 (i : integer);Xp2X[1] stopped in p2 at line 5 in file "stkcmds.mod"X 5 procedure p2 (i : integer);Xp2Xstopped in p2 at line 8 in file "stkcmds.mod"X 8 p2(i+1);Xp2Xstopped in p2 at line 8 in file "stkcmds.mod"X 8 p2(i+1);Xp2Xstopped in p2 at line 8 in file "stkcmds.mod"X 8 p2(i+1);Xp2Xstopped in p2 at line 8 in file "stkcmds.mod"X 8 p2(i+1);Xp2Xstopped in p1 at line 14 in file "stkcmds.mod"X 14 p2(i+1);Xp1Xstopped in _init at line 19 in file "stkcmds.mod"X 19 p1(i+1);X_initXXexecution completed, exit code is 0X+E+O+F+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -