diff: test case for --generate-trace
Fergus Henderson
fjh at cs.mu.OZ.AU
Sun Jan 25 19:43:58 AEDT 1998
Estimated hours taken: 0.5
tests/misc_tests/Mmakefile:
tests/misc_tests/debugger_test.m:
tests/misc_tests/debugger_test.inp:
tests/misc_tests/debugger_test.exp:
Add a test case for the `--generate-trace' debugger
(debugger_test.m is a copy of samples/interpreter.m).
cvs diff tests/misc_tests/Mmakefile tests/misc_tests/debugger_test.exp tests/misc_tests/debugger_test.inp tests/misc_tests/debugger_test.m
Index: tests/misc_tests/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/misc_tests/Mmakefile,v
retrieving revision 1.1
diff -u -r1.1 Mmakefile
--- Mmakefile 1997/09/29 18:05:08 1.1
+++ Mmakefile 1998/01/25 08:36:47
@@ -7,11 +7,17 @@
#-----------------------------------------------------------------------------#
mdemangle_test.out: mdemangle_test.inp
- mdemangle < mdemangle_test.inp > mdemangle_test.out
+ mdemangle < mdemangle_test.inp > mdemangle_test.out 2>&1
+
+debugger_test.out: debugger_test debugger_test.inp
+ debugger_test debugger_test.m < debugger_test.inp \
+ > debugger_test.out 2>&1
#-----------------------------------------------------------------------------#
-PROGS=
+PROGS= debugger_test
+
+MCFLAGS-debugger_test = --generate-trace
#-----------------------------------------------------------------------------#
Index: tests/misc_tests/debugger_test.exp
===================================================================
RCS file: debugger_test.exp
diff -N debugger_test.exp
--- /dev/null Sun Jan 25 19:30:19 1998
+++ debugger_test.exp Sun Jan 25 19:36:13 1998
@@ -0,0 +1,1304 @@
+ 1: 1 1 CALL DET debugger_test:main/2-0
+trace command [a|c|d|j|n|s] valid commands are:
+ a: abort the current execution.
+ c: continue to end, not printing the trace.
+ d: continue to end, printing the trace.
+ n: go to the next trace event.
+ s: skip the current call, not printing trace.
+ j: jump to end of current call, printing trace.
+trace command [a|c|d|j|n|s] Pure Prolog Interpreter.
+
+ 2: 1 1 ELSE DET debugger_test:main/2-0 c4;e;
+trace command [a|c|d|j|n|s] 3: 2 2 CALL DET debugger_test:database_init/1-0
+trace command [a|c|d|j|n|s] 4: 2 2 EXIT DET debugger_test:database_init/1-0
+trace command [a|c|d|j|n|s] 5: 3 2 CALL DET debugger_test:consult_list/5-0
+trace command [a|c|d|j|n|s] 6: 3 2 SWTC DET debugger_test:consult_list/5-0 s1;
+trace command [a|c|d|j|n|s] 7: 4 3 CALL DET debugger_test:consult/5-0
+trace command [a|c|d|j|n|s] Consulting file `debugger_test.m'...
+ 8: 4 3 THEN DET debugger_test:consult/5-0 c7;t;
+trace command [a|c|d|j|n|s] 9: 5 4 CALL DET debugger_test:consult_until_eof/4-0
+trace command [a|c|d|j|n|s] 10: 6 5 CALL DET debugger_test:consult_until_eof_2/5-0
+trace command [a|c|d|j|n|s] 11: 6 5 SWTC DET debugger_test:consult_until_eof_2/5-0 s3;
+trace command [a|c|d|j|n|s] 12: 7 6 CALL DET debugger_test:database_assert_clause/4-0
+trace command [a|c|d|j|n|s] 13: 7 6 ELSE DET debugger_test:database_assert_clause/4-0 e;
+trace command [a|c|d|j|n|s] 14: 7 6 EXIT DET debugger_test:database_assert_clause/4-0
+trace command [a|c|d|j|n|s] 15: 8 6 CALL DET debugger_test:consult_until_eof/4-0
+trace command [a|c|d|j|n|s] 16: 9 7 CALL DET debugger_test:consult_until_eof_2/5-0
+trace command [a|c|d|j|n|s] 17: 9 7 SWTC DET debugger_test:consult_until_eof_2/5-0 s3;
+trace command [a|c|d|j|n|s] 18: 10 8 CALL DET debugger_test:database_assert_clause/4-0
+trace command [a|c|d|j|n|s] 19: 10 8 ELSE DET debugger_test:database_assert_clause/4-0 e;
+trace command [a|c|d|j|n|s] 20: 10 8 EXIT DET debugger_test:database_assert_clause/4-0
+trace command [a|c|d|j|n|s] 21: 11 8 CALL DET debugger_test:consult_until_eof/4-0
+trace command [a|c|d|j|n|s] 681: 11 8 EXIT DET debugger_test:consult_until_eof/4-0
+trace command [a|c|d|j|n|s] 682: 9 7 EXIT DET debugger_test:consult_until_eof_2/5-0
+trace command [a|c|d|j|n|s] 683: 8 6 EXIT DET debugger_test:consult_until_eof/4-0
+trace command [a|c|d|j|n|s] valid commands are:
+ a: abort the current execution.
+ c: continue to end, not printing the trace.
+ d: continue to end, printing the trace.
+ n: go to the next trace event.
+ s: skip the current call, not printing trace.
+ j: jump to end of current call, printing trace.
+trace command [a|c|d|j|n|s] 684: 6 5 EXIT DET debugger_test:consult_until_eof_2/5-0
+trace command [a|c|d|j|n|s] 685: 5 4 EXIT DET debugger_test:consult_until_eof/4-0
+trace command [a|c|d|j|n|s] 686: 4 3 EXIT DET debugger_test:consult/5-0
+trace command [a|c|d|j|n|s] 687: 259 3 CALL DET debugger_test:consult_list/5-0
+trace command [a|c|d|j|n|s] 688: 259 3 SWTC DET debugger_test:consult_list/5-0 s2;
+ 689: 259 3 EXIT DET debugger_test:consult_list/5-0
+trace command [a|c|d|j|n|s] 690: 3 2 EXIT DET debugger_test:consult_list/5-0
+trace command [a|c|d|j|n|s] 691: 260 2 CALL DET debugger_test:main_loop/3-0
+trace command [a|c|d|j|n|s] ?- 692: 261 3 CALL DET debugger_test:main_loop_2/4-0
+trace command [a|c|d|j|n|s] 693: 261 3 SWTC DET debugger_test:main_loop_2/4-0 s3;
+trace command [a|c|d|j|n|s] 694: 262 4 CALL NON debugger_test:solve/4-0
+trace command [a|c|d|j|n|s] 695: 262 4 DISJ NON debugger_test:solve/4-0 d1;
+trace command [a|c|d|j|n|s] 696: 262 4 DISJ NON debugger_test:solve/4-0 d2;
+trace command [a|c|d|j|n|s] 697: 262 4 DISJ NON debugger_test:solve/4-0 d3;
+trace command [a|c|d|j|n|s] 698: 262 4 DISJ NON debugger_test:solve/4-0 d4;
+trace command [a|c|d|j|n|s] 699: 263 5 CALL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 700: 263 5 SWTC SEMI debugger_test:unify/4-0 s2;
+ 701: 263 5 SWTC SEMI debugger_test:unify/4-0 s2;c2;s1;
+ 702: 263 5 ELSE SEMI debugger_test:unify/4-0 s2;c2;s1;c2;e;
+ 703: 264 6 CALL SEMI debugger_test:occurs_list/3-0
+ 704: 264 6 FAIL SEMI debugger_test:occurs_list/3-0
+ 705: 263 5 EXIT SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 706: 262 4 EXIT NON debugger_test:solve/4-0
+trace command [a|c|d|j|n|s] 707: 262 4 DISJ NON debugger_test:solve/4-0 d5;
+trace command [a|c|d|j|n|s] 708: 265 5 CALL NON debugger_test:database_lookup_clause/5-0
+trace command [a|c|d|j|n|s] 709: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
+trace command [a|c|d|j|n|s] 710: 266 5 CALL DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 711: 266 5 EXIT DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 712: 267 5 CALL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 713: 267 5 SWTC SEMI debugger_test:unify/4-0 s1;
+ 714: 267 5 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+ 715: 267 5 FAIL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 716: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
+trace command [a|c|d|j|n|s] 717: 268 5 CALL DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 718: 268 5 EXIT DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 719: 269 5 CALL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 720: 269 5 SWTC SEMI debugger_test:unify/4-0 s1;
+trace command [a|c|d|j|n|s] 721: 269 5 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+trace command [a|c|d|j|n|s] 722: 269 5 FAIL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 723: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
+trace command [a|c|d|j|n|s] 724: 270 5 CALL DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 725: 270 5 EXIT DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 726: 271 5 CALL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 727: 271 5 SWTC SEMI debugger_test:unify/4-0 s1;
+trace command [a|c|d|j|n|s] 728: 271 5 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+trace command [a|c|d|j|n|s] 729: 271 5 FAIL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 730: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
+trace command [a|c|d|j|n|s] 731: 272 5 CALL DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 732: 272 5 EXIT DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 733: 273 5 CALL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 734: 273 5 SWTC SEMI debugger_test:unify/4-0 s1;
+trace command [a|c|d|j|n|s] 735: 273 5 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+trace command [a|c|d|j|n|s] 736: 273 5 FAIL SEMI debugger_test:unify/4-0
+trace command [a|c|d|j|n|s] 737: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
+trace command [a|c|d|j|n|s] 738: 274 5 CALL DET debugger_test:rename_apart/5-0
+trace command [a|c|d|j|n|s] 739: 274 5 EXIT DET debugger_test:rename_apart/5-0
+ 740: 275 5 CALL SEMI debugger_test:unify/4-0
+ 741: 275 5 SWTC SEMI debugger_test:unify/4-0 s1;
+ 742: 275 5 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+ 743: 275 5 FAIL SEMI debugger_test:unify/4-0
+ 744: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
+ 745: 276 5 CALL DET debugger_test:rename_apart/5-0
+ 746: 276 5 EXIT DET debugger_test:rename_apart/5-0
+ 747: 277 5 CALL SEMI debugger_test:unify/4-0
+ 748: 277 5 SWTC SEMI debugger_test:unify/4-0 s1;
+ 749: 277 5 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+ 750: 277 5 FAIL SEMI debugger_test:unify/4-0
+ 751: 265 5 EXIT NON debugger_test:database_lookup_clause/5-0
... [boring bits elided] ...
+ 1920: 613 7 SWTC SEMI debugger_test:unify/4-0 s1;
+ 1921: 613 7 SWTC SEMI debugger_test:unify/4-0 s1;c2;s1;
+ 1922: 613 7 FAIL SEMI debugger_test:unify/4-0
+ 1923: 439 6 FAIL NON debugger_test:solve/4-0
+ 1924: 614 6 CALL DET debugger_test:write_solutions/4-0
+ 1925: 614 6 ELSE DET debugger_test:write_solutions/4-0 e;
+ 1926: 615 7 CALL DET debugger_test:write_solutions_2/4-0
+ 1927: 615 7 SWTC DET debugger_test:write_solutions_2/4-0 s1;
+f(a) = f(a).
+ 1928: 616 8 CALL DET debugger_test:write_solutions_2/4-0
+ 1929: 616 8 SWTC DET debugger_test:write_solutions_2/4-0 s2;
+ 1930: 616 8 EXIT DET debugger_test:write_solutions_2/4-0
+ 1931: 615 7 EXIT DET debugger_test:write_solutions_2/4-0
+Yes.
+ 1932: 614 6 EXIT DET debugger_test:write_solutions/4-0
+ 1933: 617 6 CALL DET debugger_test:main_loop/3-0
+?- 1934: 618 7 CALL DET debugger_test:main_loop_2/4-0
+ 1935: 618 7 SWTC DET debugger_test:main_loop_2/4-0 s1;
+ 1936: 618 7 EXIT DET debugger_test:main_loop_2/4-0
+ 1937: 617 6 EXIT DET debugger_test:main_loop/3-0
+ 1938: 438 5 EXIT DET debugger_test:main_loop_2/4-0
+ 1939: 437 4 EXIT DET debugger_test:main_loop/3-0
+ 1940: 261 3 EXIT DET debugger_test:main_loop_2/4-0
+ 1941: 260 2 EXIT DET debugger_test:main_loop/3-0
+ 1942: 1 1 EXIT DET debugger_test:main/2-0
Index: tests/misc_tests/debugger_test.inp
===================================================================
RCS file: debugger_test.inp
diff -N debugger_test.inp
--- /dev/null Sun Jan 25 19:30:19 1998
+++ debugger_test.inp Sun Jan 25 19:29:47 1998
@@ -0,0 +1,74 @@
+h
+n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+s
+
+
+h
+n
+
+
+
+j
+
+
+
+F = 1.
+
+
+
+
+
+
+j
+
+
+
+j
+
+j
+
+j
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+d
+f(a) = f(X).
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list