[m-rev.] for review: printing higher order values and typeinfos in the debugger

Mark Brown dougl at cs.mu.OZ.AU
Tue Mar 5 06:18:07 AEDT 2002


On 22-Feb-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> For review by anyone, but I would like Mark to check whether I missed any
> places where the browser uses io__write or io__write_univ to print terms
> from the program.

There were a couple of other places that printed terms.  Some of these
are fixed in the diff below (which I will commit when the tests finish),
and the remainder are in "testing" code which probably doesn't need to be
updated.

Cheers,
Mark.

Estimated hours taken: 0.2
Branches: main

browser/declarative_user.m:
	Call the cc_multi version of io__write.

library/io.m:
	Add a cc_multi mode for io__write_list/6.

NEWS:
	Mention the change to io.m.

Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.245
diff -u -r1.245 NEWS
--- NEWS	24 Feb 2002 11:53:16 -0000	1.245
+++ NEWS	4 Mar 2002 18:47:04 -0000
@@ -80,6 +80,7 @@
   `io__current_binary_input_stream', and `io__current_binary_output_stream'.
 * We've added a predicate to io.m to return the last modification time
   of a file: `io__file_modification_time'.
+* We've added cc_multi modes to io__write_list/5 and io__write_list/6.
 
 * We've added four functions to list.m for mapping functions over
   corresponding members of lists: list__map_corresponding/3,
Index: browser/declarative_user.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/declarative_user.m,v
retrieving revision 1.15
diff -u -r1.15 declarative_user.m
--- browser/declarative_user.m	28 Jan 2002 07:20:09 -0000	1.15
+++ browser/declarative_user.m	4 Mar 2002 19:03:29 -0000
@@ -47,7 +47,7 @@
 :- implementation.
 :- import_module mdb__browser_info, mdb__browse, mdb__util.
 :- import_module mdb__declarative_execution, mdb__program_representation.
-:- import_module std_util, char, string, bool, int.
+:- import_module std_util, char, string, bool, int, deconstruct.
 
 :- type user_state
 	--->	user(
@@ -351,7 +351,7 @@
 write_decl_question(unexpected_exception(Call, Exception), User) -->
 	write_decl_atom(User, "Call ", Call),
 	io__write_string(User^outstr, "Throws "),
-	io__print(User^outstr, Exception),
+	io__write(User^outstr, include_details_cc, univ_value(Exception)),
 	io__nl(User^outstr).
 
 :- pred write_decl_bug(decl_bug::in, user_state::in,
@@ -371,7 +371,8 @@
 		{ EBug = unhandled_exception(Atom, Exception, _) },
 		io__write_string(User^outstr, "Found unhandled exception:\n"),
 		write_decl_atom(User, "", Atom),
-		io__write(User^outstr, univ_value(Exception)),
+		io__write(User^outstr, include_details_cc,
+				univ_value(Exception)),
 		io__nl(User^outstr)
 	).
 
@@ -456,7 +457,7 @@
 
 :- pred write_decl_atom_direct(io__output_stream, decl_atom,
 		io__state, io__state).
-:- mode write_decl_atom_direct(in, in, di, uo) is det.
+:- mode write_decl_atom_direct(in, in, di, uo) is cc_multi.
 
 write_decl_atom_direct(OutStr, atom(PredOrFunc, Functor, Args)) -->
 	io__write_string(OutStr, Functor),
@@ -484,10 +485,10 @@
 
 :- pred write_decl_atom_arg(io__output_stream, maybe(univ),
 		io__state, io__state).
-:- mode write_decl_atom_arg(in, in, di, uo) is det.
+:- mode write_decl_atom_arg(in, in, di, uo) is cc_multi.
 
 write_decl_atom_arg(OutStr, yes(Arg)) -->
-	io__print(OutStr, Arg).
+	io__write(OutStr, include_details_cc, univ_value(Arg)).
 write_decl_atom_arg(OutStr, no) -->
 	io__write_char(OutStr, '_').
 
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.245
diff -u -r1.245 io.m
--- library/io.m	25 Feb 2002 09:37:42 -0000	1.245
+++ library/io.m	4 Mar 2002 18:36:27 -0000
@@ -470,6 +470,8 @@
 :- pred io__write_list(io__output_stream, list(T), string, 
 	pred(T, io__state, io__state), io__state, io__state).
 :- mode io__write_list(in, in, in, pred(in, di, uo) is det, di, uo) is det.
+:- mode io__write_list(in, in, in, pred(in, di, uo) is cc_multi, di, uo)
+	is cc_multi.
 	% io__write_list(Stream, List, Separator, OutputPred, IO0, IO)
 	% applies OutputPred to each element of List, printing Separator
 	% between each element. Outputs to Stream.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list