[m-dev.] diff: flush MR_mdb_out

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Nov 1 15:03:16 AEDT 2000


trace/mercury_trace_internal.c:
	Flush MR_mdb_out at the start of each command.

Zoltan.

cvs diff: Diffing .
Index: mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.85
diff -u -b -r1.85 mercury_trace_internal.c
--- mercury_trace_internal.c	2000/10/27 08:38:57	1.85
+++ mercury_trace_internal.c	2000/11/01 04:00:00
@@ -567,6 +567,15 @@
 	layout = event_info->MR_event_sll;
 	saved_regs = event_info->MR_saved_regs;
 
+	/*
+	** The code for many commands calls getopt, and getopt may print to
+	** stderr. We flush MR_mdb_out here to make sure that all normal output
+	** so far (including the echoed command, if echoing is turned on) gets
+	** output first.
+	*/
+
+	fflush(MR_mdb_out);
+
 	if (streq(words[0], "step")) {
 		int	n;
 
--------------------------------------------------------------------------
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