[m-rev.] Re: [m-dev.] for review: user-friendly representation of streams

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Sep 25 19:33:37 AEST 2002


On 25-Sep-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> The small change is that the printing of the query message about EOF in mdb
> can now be switched off.

Shown below is just the small change, which I have extracted from the
big diff that you posted.

Here's my comments on this change:

- MR_trace_ask_about_eof is initialized to true, and is never set to
  false anywhere.  So I don't see how this change accomplishes
  anything.
- The comment "It it normally set to true, but code it can
  be set to disable the query." is not grammatically correct.
- The modification to mercury_trace_internal.c is not mentioned in the
  log message.

----------

runtime/mercury_trace_base.[ch]:
	Add a global for controlling whether we get a message from mdb about
	EOF.

Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.47
diff -u -b -r1.47 mercury_trace_base.c
--- runtime/mercury_trace_base.c	11 Sep 2002 07:20:28 -0000	1.47
+++ runtime/mercury_trace_base.c	13 Sep 2002 03:56:20 -0000
@@ -52,6 +52,8 @@
 MR_bool		MR_trace_unhide_events = MR_FALSE;
 MR_bool		MR_trace_have_unhid_events = MR_FALSE;
 
+MR_bool		MR_trace_ask_about_eof = MR_TRUE;
+
 /*
 ** I/O tabling is documented in library/table_builtin.m
 */
Index: runtime/mercury_trace_base.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.h,v
retrieving revision 1.27
diff -u -b -r1.27 mercury_trace_base.h
--- runtime/mercury_trace_base.h	11 Sep 2002 07:20:28 -0000	1.27
+++ runtime/mercury_trace_base.h	13 Sep 2002 03:55:43 -0000
@@ -230,6 +230,14 @@
 extern	MR_bool		MR_trace_have_unhid_events;
 
 /*
+** MR_trace_ask_about_eof controls whether the debugger asks "are you sure"
+** before terminating the program on receipt of an EOF on MR_mdb_in. It it
+** normally set to true, but code it can be set to disable the query.
+*/
+
+extern	MR_bool		MR_trace_ask_about_eof;
+
+/*
 ** The details of I/O tabling are documented in library/table_builtin.m.
 */
 
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.140
diff -u -b -r1.140 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	15 Sep 2002 10:06:02 -0000	1.140
+++ trace/mercury_trace_internal.c	24 Sep 2002 08:27:13 -0000
@@ -4666,7 +4690,13 @@
 		** We arrange things so we don't have to treat this case
 		** specially in the command interpreter.
 		*/
+		if (MR_trace_ask_about_eof) {
 		line = MR_copy_string("quit");
+		} else {
+			line = MR_copy_string("quit -y");
+			/* terminate the line containing the last prompt */
+			fprintf(mdb_out, "\n");
+		}
 		return line;
 	}
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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