[m-rev.] for review: fix some debugger tests

Ian MacLarty maclarty at csse.unimelb.edu.au
Tue Jan 5 12:57:59 AEDT 2010


Estimated hours taken: 1
Branches: main

Fix some tests that fail in the decldebug grades.

tests/debugger/Mmakefile:
    Don't run the tailrec1 test in decldebug grades, as the tail
    recursion optimisation isn't supported in those grades.

tests/debugger/loopcheck.exp3:
    Update an event number.  Presumably this changed because of
    changes to the standard library.

tests/debugger/declarative/condition_bug.exp:
tests/debugger/declarative/condition_bug.inp:
    Break on stream.put/4 instead of io.write_string/4.

    Don't expect contexts for put method calls.

tests/debugger/declarative/condition_bug.m:
    Remove a comment that doesn't seem to apply anymore.
    
tests/debugger/declarative/solns.exp3:
tests/debugger/declarative/solns.inp3:
    Fix the input and expected output for this test in the
    decldebug grade.

Index: tests/debugger/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.144
diff -u -r1.144 Mmakefile
--- tests/debugger/Mmakefile	23 Dec 2008 01:37:58 -0000	1.144
+++ tests/debugger/Mmakefile	5 Jan 2010 01:50:09 -0000
@@ -184,13 +184,21 @@
 # stack layouts (which are required for tracing).
 
 ifneq "$(findstring profdeep,$(GRADE))" ""
-    # Eventually, this should be DEBUGGER_PROGS=$(ALL_NONRETRY_PROGS).
+    # Eventually, this should be DEBUGGER_PROGS0=$(ALL_NONRETRY_PROGS).
     # However, the code that is required to switch off the profiling
     # primitives in Mercury code invoked by the debugger (e.g. for
     # browsing) has not yet been implemented.
-    DEBUGGER_PROGS=
+    DEBUGGER_PROGS0=
 else
-    DEBUGGER_PROGS=$(ALL_NONRETRY_PROGS) $(ALL_RETRY_PROGS)
+    DEBUGGER_PROGS0=$(ALL_NONRETRY_PROGS) $(ALL_RETRY_PROGS)
+endif
+
+# The tail call optimisation isn't supported in decldebug grades,
+# so we don't run the tailrec1 test in those grades.
+ifneq "$(findstring decldebug,$(GRADE))" ""
+    DEBUGGER_PROGS=$(subst tailrec1,,$(DEBUGGER_PROGS0))
+else
+    DEBUGGER_PROGS=$(DEBUGGER_PROGS0)
 endif
 
 ifneq "$(filter hl% java% il% erlang%,$(GRADE))" ""
Index: tests/debugger/loopcheck.exp3
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/loopcheck.exp3,v
retrieving revision 1.8
diff -u -r1.8 loopcheck.exp3
--- tests/debugger/loopcheck.exp3	29 May 2007 09:14:46 -0000	1.8
+++ tests/debugger/loopcheck.exp3	5 Jan 2010 01:50:09 -0000
@@ -22,5 +22,5 @@
 mdb> continue
 Uncaught Mercury exception:
 Software Error: detected infinite recursion in pred loopcheck.loop/1
-Last trace event was event #334.
+Last trace event was event #91.
 Last trace event before the unhandled exception was event #8.
Index: tests/debugger/declarative/condition_bug.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/condition_bug.exp,v
retrieving revision 1.5
diff -u -r1.5 condition_bug.exp
--- tests/debugger/declarative/condition_bug.exp	6 Dec 2006 03:44:59 -0000	1.5
+++ tests/debugger/declarative/condition_bug.exp	5 Jan 2010 01:50:10 -0000
@@ -4,22 +4,22 @@
 mdb> untrust 0
 mdb> table_io start
 I/O tabling started.
-mdb> break io.write_string/4
- 0: + stop  interface pred io.write_string/4-0 (det)
-mdb> condition Message = "english"
- 0: + stop  interface pred io.write_string/4-0 (det)
-            Message = "english"
+mdb> break stream.put/4
+ 0: + stop  interface pred stream.put/4-0 (det)
+mdb> condition 2 = "english"
+ 0: + stop  interface pred stream.put/4-0 (det)
+            2 = "english"
 mdb> continue
 <?xml version="1.0"?>
 <translations>
 	<word>
-		<      E2:     C2 CALL pred io.write_string/4-0 (det) io.m:NNNN (term_to_xml.m:NNNN)
+		<      E2:     C2 CALL pred stream.put/4-0 (det) (term_to_xml.m:NNNN)
 mdb> finish
-english      E3:     C2 EXIT pred io.write_string/4-0 (det) io.m:NNNN (term_to_xml.m:NNNN)
+english      E3:     C2 EXIT pred stream.put/4-0 (det) (term_to_xml.m:NNNN)
 mdb> dd
-write_string("english", _, _)
+put(stream(1, output, preopen, stdout), "english", _, state(c_pointer(0x1)))
 1 tabled IO action:
-write_string("english")
+write_string_2(stream(1, output, preopen, stdout), "english")
 Valid? browse 2
 browser> track
 >critical</english>
@@ -41,5 +41,5 @@
 to the subterm in the atom is 2/1/3/1/1.
 dd> quit
 Diagnosis aborted.
-      E3:     C2 EXIT pred io.write_string/3-0 (det) io.m:NNNN (term_to_xml.m:NNNN)
+      E3:     C2 EXIT pred stream.put/4-0 (det) (term_to_xml.m:NNNN)
 mdb> quit -y
Index: tests/debugger/declarative/condition_bug.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/condition_bug.inp,v
retrieving revision 1.2
diff -u -r1.2 condition_bug.inp
--- tests/debugger/declarative/condition_bug.inp	6 Dec 2006 03:44:59 -0000	1.2
+++ tests/debugger/declarative/condition_bug.inp	5 Jan 2010 01:50:10 -0000
@@ -2,8 +2,8 @@
 echo on
 untrust 0
 table_io start
-break io.write_string/4
-condition Message = "english"
+break stream.put/4
+condition 2 = "english"
 continue
 finish
 dd
Index: tests/debugger/declarative/condition_bug.m
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/condition_bug.m,v
retrieving revision 1.3
diff -u -r1.3 condition_bug.m
--- tests/debugger/declarative/condition_bug.m	6 Dec 2006 03:44:59 -0000	1.3
+++ tests/debugger/declarative/condition_bug.m	5 Jan 2010 01:50:10 -0000
@@ -41,21 +41,3 @@
 		elem("english", [], [data(English)]),
 	 	elem("dutch", [], [data(Dutch)])])
 	| translation_pairs_to_xml(Rest)].
-
-% This test case currently does not work. The symptom is an abort from the
-% declarative debugger with a message about not being to perform a retry
-% because the value of an input argument is missing. This arises at a call
-% to list/foldl/4 with mode di/uo for the accumulator pair. The debugger
-% erroneously believes the accumulator at that call to be a string, when in
-% fact it is an I/O state.
-%
-% The problem arises at the call to write_xml_doc/4 in write_xml_doc/3.
-% The arity 3 version of this predicate has an I/O state pair as its last two
-% arguments, whereas the arity 4 has the signature
-%
-% :- pred write_xml_doc(Stream::in, T::in, State::di, State::uo)
-%   is det <= (xmlable(T), stream.writer(Stream, string, State)).
-%
-% It seems the debugger is picking the typeinfo for string out of the second
-% typeclass_info instead of the typeinfo for State, and thus it shows the type
-% of the third argument of write_xml_doc/4 as string, not I/O state.
Index: tests/debugger/declarative/solns.exp3
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/solns.exp3,v
retrieving revision 1.2
diff -u -r1.2 solns.exp3
--- tests/debugger/declarative/solns.exp3	5 Feb 2007 08:31:58 -0000	1.2
+++ tests/debugger/declarative/solns.exp3	5 Jan 2010 01:50:10 -0000
@@ -1,28 +1,20 @@
        1:      1  1 CALL pred solns.main/2-0 (det) solns.m:8
-mdb> mdb> Contexts will not be printed.
 mdb> echo on
 Command echo enabled.
-mdb> trust int
-Trusting module int
-mdb> trust list
-Trusting module list
-mdb> trust std_util
-Trusting module std_util
+mdb> register --quiet
 mdb> break p
  0: + stop  interface pred solns.p/2-0 (det)
 mdb> continue
-       2:      2  2 CALL pred solns.p/2-0 (det)
+       2:      2  2 CALL pred solns.p/2-0 (det) solns.m:15 (solns.m:9)
 mdb> finish
-     237:      2  2 EXIT pred solns.p/2-0 (det)
+     216:      2  2 EXIT pred solns.p/2-0 (det) solns.m:15 (solns.m:9)
 mdb> dd -d 3 -n 7
 p(1, [1, 2, 3])
 Valid? no
 q(1, 1)
 Valid? yes
 q(1, 2)
-Valid? yesy
-Unknown command, 'h' for help.
-dd> yes
+Valid? yes
 q(1, 3)
 Valid? yes
 Call q(1, _)
@@ -35,5 +27,5 @@
 solutions(q(1), [1, 2, 3])
 p(1, [1, 2, 3])
 Is this a bug? yes
-     237:      2  2 EXIT pred solns.p/2-0 (det)
+     216:      2  2 EXIT pred solns.p/2-0 (det) solns.m:15 (solns.m:9)
 mdb> quit -y
Index: tests/debugger/declarative/solns.inp3
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/solns.inp3,v
retrieving revision 1.1
diff -u -r1.1 solns.inp3
--- tests/debugger/declarative/solns.inp3	24 Mar 2006 04:40:56 -0000	1.1
+++ tests/debugger/declarative/solns.inp3	5 Jan 2010 01:50:10 -0000
@@ -1,16 +1,11 @@
-register --quiet
-context none
 echo on
-trust int
-trust list
-trust std_util
+register --quiet
 break p
 continue
 finish
 dd -d 3 -n 7
 no
 yes
-yesy
 yes
 yes
 yes
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list