[m-dev.] trivial diff: remove univ before browsing DD args

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Thu Jan 18 05:51:12 AEDT 2001


Hi,

I'll commit this on the main branch.

Cheers,
Mark.

Estimated hours taken: 0.3

browser/declarative_user.m:
	Remove the enclosing univ before browsing arguments in the
	declarative debugger.  This was the original intention.

tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/browse_arg.m:
tests/debugger/declarative/browse_arg.inp:
tests/debugger/declarative/browse_arg.exp:
	A test case for this feature.

Index: browser/declarative_user.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_user.m,v
retrieving revision 1.12
diff -u -r1.12 declarative_user.m
--- browser/declarative_user.m	2000/10/27 08:38:49	1.12
+++ browser/declarative_user.m	2001/01/17 17:29:33
@@ -162,7 +162,8 @@
 		{ list__index1(Args, ArgNum, MaybeArg) },
 		{ MaybeArg = yes(Arg) }
 	->
-		browse(Arg, User0^instr, User0^outstr, User0^browser, Browser),
+		browse(univ_value(Arg), User0^instr, User0^outstr,
+			User0^browser, Browser),
 		{ User = User0^browser := Browser }
 	;
 		io__write_string(User^outstr, "Invalid argument number\n"),
Index: tests/debugger/declarative/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/declarative/Mmakefile,v
retrieving revision 1.24
diff -u -r1.24 Mmakefile
--- tests/debugger/declarative/Mmakefile	2001/01/07 03:05:37	1.24
+++ tests/debugger/declarative/Mmakefile	2001/01/17 17:30:02
@@ -23,6 +23,7 @@
 	args			\
 	backtrack		\
 	big			\
+	browse_arg		\
 	comp_gen		\
 	deep_warning		\
 	family			\
@@ -104,6 +105,9 @@
 
 big.out: big big.inp
 	$(MDB) ./big < big.inp > big.out 2>&1
+
+browse_arg.out: browse_arg browse_arg.inp
+	$(MDB) ./browse_arg < browse_arg.inp > browse_arg.out 2>&1
 
 comp_gen.out: comp_gen comp_gen.inp
 	$(MDB) ./comp_gen < comp_gen.inp > comp_gen.out 2>&1
Index: tests/debugger/declarative/browse_arg.exp
===================================================================
RCS file: browse_arg.exp
diff -N browse_arg.exp
--- /dev/null	Wed Nov 15 09:24:47 2000
+++ browse_arg.exp	Thu Jan 18 04:30:02 2001
@@ -0,0 +1,27 @@
+       1:      1  1 CALL pred browse_arg:main/2-0 (det) browse_arg.m:7
+mdb> echo on
+Command echo enabled.
+mdb> register --quiet
+mdb> break p
+ 0: + stop  interface pred browse_arg:p/2-0 (det)
+mdb> continue
+       2:      2  2 CALL pred browse_arg:p/2-0 (det) browse_arg.m:19 (browse_arg.m:8)
+mdb> finish
+       3:      2  2 EXIT pred browse_arg:p/2-0 (det) browse_arg.m:19 (browse_arg.m:8)
+mdb> dd
+p(1, baz(1, bar))
+Valid? browse 2
+browser> ls
+baz
+1-1
+2-bar
+
+browser> quit
+p(1, baz(1, bar))
+Valid? no
+Found incorrect contour:
+p(1, baz(1, bar))
+Is this a bug? yes
+       3:      2  2 EXIT pred browse_arg:p/2-0 (det) browse_arg.m:19 (browse_arg.m:8)
+mdb> continue
+baz(1, bar)
Index: tests/debugger/declarative/browse_arg.inp
===================================================================
RCS file: browse_arg.inp
diff -N browse_arg.inp
--- /dev/null	Wed Nov 15 09:24:47 2000
+++ browse_arg.inp	Thu Jan 18 04:30:02 2001
@@ -0,0 +1,12 @@
+echo on
+register --quiet
+break p
+continue
+finish
+dd
+browse 2
+ls
+quit
+no
+yes
+continue
Index: tests/debugger/declarative/browse_arg.m
===================================================================
RCS file: browse_arg.m
diff -N browse_arg.m
--- /dev/null	Wed Nov 15 09:24:47 2000
+++ browse_arg.m	Thu Jan 18 04:30:02 2001
@@ -0,0 +1,20 @@
+:- module browse_arg.
+:- interface.
+:- import_module io.
+:- pred main(io__state::di, io__state::uo) is det.
+:- implementation.
+
+main -->
+	{ p(1, X) },
+	io__write(X),
+	io__nl.
+
+:- type foo
+	--->	bar
+	;	baz(int, foo).
+
+:- pred p(int, foo).
+:- mode p(in, out) is det.
+
+p(N, baz(N, bar)).
+
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list