From b11847c39ed844569e9199bebeb6b4976586fad6 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Mon, 24 Nov 1997 20:54:57 +0000
Subject: [PATCH] [project @ 1997-11-24 20:54:02 by sof] ForeignObj debug
 output to stderr

---
 ghc/runtime/storage/SMevac.lc |  8 ++++----
 ghc/runtime/storage/SMextn.lc | 18 +++++++++---------
 ghc/runtime/storage/SMscan.lc | 16 ++++++++--------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/ghc/runtime/storage/SMevac.lc b/ghc/runtime/storage/SMevac.lc
index dce5642f9585..1de18642f2d4 100644
--- a/ghc/runtime/storage/SMevac.lc
+++ b/ghc/runtime/storage/SMevac.lc
@@ -563,8 +563,8 @@ EVAC_FN(ForeignObj)
 
 #if defined(DEBUG)
     if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-      printf("DEBUG: Evacuating ForeignObj(%x)=<%x,_,%x,%x>", evac, evac[0], evac[2], evac[3]);
-      printf(" Data = %x, Finaliser= %x, Next = %x\n", 
+      fprintf(stderr,"DEBUG: Evacuating ForeignObj(%x)=<%x,_,%x,%x>", evac, evac[0], evac[2], evac[3]);
+      fprintf(stderr," Data = %x, Finaliser= %x, Next = %x\n", 
 	     ForeignObj_CLOSURE_DATA(evac), 
 	     ForeignObj_CLOSURE_FINALISER(evac), 
 	     ForeignObj_CLOSURE_LINK(evac) );
@@ -580,8 +580,8 @@ EVAC_FN(ForeignObj)
 
 #if defined(DEBUG)
     if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-      printf("DEBUG: Evacuated  ForeignObj(%x)=<%x,_,%x,%x>", ToHp, ToHp[0], ToHp[2], ToHp[3]);
-      printf(" Data = %x, Finaliser = %x, Next = %x\n", 
+      fprintf(stderr,"DEBUG: Evacuated  ForeignObj(%x)=<%x,_,%x,%x>", ToHp, ToHp[0], ToHp[2], ToHp[3]);
+      fprintf(stderr," Data = %x, Finaliser = %x, Next = %x\n", 
 	     ForeignObj_CLOSURE_DATA(ToHp), 
 	     ForeignObj_CLOSURE_FINALISER(ToHp), 
 	     ForeignObj_CLOSURE_LINK(ToHp));
diff --git a/ghc/runtime/storage/SMextn.lc b/ghc/runtime/storage/SMextn.lc
index 481fe7bb86b9..556e9a15f44e 100644
--- a/ghc/runtime/storage/SMextn.lc
+++ b/ghc/runtime/storage/SMextn.lc
@@ -64,7 +64,7 @@ TrashMem(from, to)
 /* assertion overly strong - if free_mem == 0, sm->hp == sm->hplim */
 /*  ASSERT( from <= to ); */
     if (RTSflags.GcFlags.trace)
-	printf("Trashing from 0x%lx to 0x%lx inclusive\n", (W_) from, (W_) to);
+	fprintf(stderr,"Trashing from 0x%lx to 0x%lx inclusive\n", (W_) from, (W_) to);
     while (from <= to) {
 	*from++ = DEALLOCATED_TRASH;
     }
@@ -161,11 +161,11 @@ Trace_ForeignObj( FOptr )
   P_ FOptr;
 {
   if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-    printf("DEBUG: ForeignObj(%0x)=<%0x,%0x,%0x,%0x>\n", (W_) FOptr, (W_) FOptr[0], (W_) FOptr[1], (W_) FOptr[2], (W_) FOptr[3]);
-    printf(" Data = %0x, Finaliser = %0x, Next = %0x\n", 
-	(W_) ForeignObj_CLOSURE_DATA(FOptr), 
-	(W_) ForeignObj_CLOSURE_FINALISER(FOptr), 
-	(W_) ForeignObj_CLOSURE_LINK(FOptr) );
+    fprintf(stderr,"DEBUG: ForeignObj(%0x)=<%0x,%0x,%0x,%0x>\n", (W_) FOptr, (W_) FOptr[0], (W_) FOptr[1], (W_) FOptr[2], (W_) FOptr[3]);
+    fprintf(stderr," Data = %0x, Finaliser = %0x, Next = %0x\n", 
+            (W_) ForeignObj_CLOSURE_DATA(FOptr), 
+	    (W_) ForeignObj_CLOSURE_FINALISER(FOptr), 
+	    (W_) ForeignObj_CLOSURE_LINK(FOptr) );
   }
 }
 
@@ -173,7 +173,7 @@ void
 Trace_FOdies()
 {
   if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-    printf(" dying\n");
+    fprintf(stderr, " dying\n");
   }
 }
 
@@ -181,7 +181,7 @@ void
 Trace_FOlives()
 {
   if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) { 
-    printf(" lived to tell the tale\n"); 
+    fprintf(stderr," lived to tell the tale\n"); 
   }
 }
 
@@ -190,7 +190,7 @@ Trace_FOforwarded( FOPtr, newAddress )
   P_ FOPtr, newAddress;
 {
   if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-    printf(" forwarded to %lx\n", (W_) newAddress);
+    fprintf(stderr, " forwarded to %lx\n", (W_) newAddress);
   }
 }
 
diff --git a/ghc/runtime/storage/SMscan.lc b/ghc/runtime/storage/SMscan.lc
index 5c6b489982a0..dbfd5234732b 100644
--- a/ghc/runtime/storage/SMscan.lc
+++ b/ghc/runtime/storage/SMscan.lc
@@ -1157,11 +1157,11 @@ _ScanMove_ForeignObj(STG_NO_ARGS) {
 
 #if defined(DEBUG)
     if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-      printf("Moving ForeignObj(%x)=<%x,%x,%x>", Scan, Scan[0], Scan[1], Scan[2]);
-      printf(" Data = %x, Finaliser = %x, Next = %x\n", 
-	     ForeignObj_CLOSURE_DATA(Scan), 
-	     ForeignObj_CLOSURE_FINALISER(Scan), 
-	     ForeignObj_CLOSURE_LINK(Scan) );
+      fprintf(stderr,"Moving ForeignObj(%x)=<%x,%x,%x>", Scan, Scan[0], Scan[1], Scan[2]);
+      fprintf(stderr," Data = %x, Finaliser = %x, Next = %x\n", 
+	      ForeignObj_CLOSURE_DATA(Scan), 
+	      ForeignObj_CLOSURE_FINALISER(Scan), 
+	      ForeignObj_CLOSURE_LINK(Scan) );
     }
 #endif
 
@@ -1171,12 +1171,12 @@ _ScanMove_ForeignObj(STG_NO_ARGS) {
 
 #if defined(DEBUG)
     if (RTSflags.GcFlags.trace & DEBUG_TRACE_FOREIGNOBJS) {
-      printf("Moved ForeignObj(%x)=<%x,_,%x,%x,%x>", New, New[0], New[1], New[2], New[3]);
-      printf(" Data = %x, Finaliser = %x, Next = %x", 
+      fprintf(stderr,"Moved ForeignObj(%x)=<%x,_,%x,%x,%x>", New, New[0], New[1], New[2], New[3]);
+      fprintf(stderr," Data = %x, Finaliser = %x, Next = %x", 
 	     ForeignObj_CLOSURE_DATA(New), 
 	     ForeignObj_CLOSURE_FINALISER(New), 
 	     ForeignObj_CLOSURE_LINK(New) );
-      printf(", NewForeignObjList = %x\n", NewForeignObjList );
+      fprintf(stderr,", NewForeignObjList = %x\n", NewForeignObjList );
     }
 #endif
 
-- 
GitLab