[project @ 2000-08-21 15:27:18 by simonmar]
[ghc-hetmet.git] / ghc / rts / Printer.c
index 541b7c2..a024518 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.25 2000/04/14 15:18:06 sewardj Exp $
+ * $Id: Printer.c,v 1.28 2000/08/15 11:48:06 simonmar Exp $
  *
  * (c) The GHC Team, 1994-2000.
  *
@@ -107,7 +107,7 @@ void printClosure( StgClosure *obj )
             fprintf(stderr,"AP_UPD("); printPtr((StgPtr)ap->fun);
             for (i = 0; i < ap->n_args; ++i) {
                 fprintf(stderr,", ");
-                printPtr(ap->payload[i]);
+                printPtr((P_)ap->payload[i]);
             }
             fprintf(stderr,")\n");
             break;
@@ -196,8 +196,7 @@ void printClosure( StgClosure *obj )
 
     case TSO:
       fprintf(stderr,"TSO("); 
-      fprintf(stderr,"%d (%x)", 
-              stgCast(StgTSO*,obj)->id, stgCast(StgTSO*,obj));
+      fprintf(stderr,"%d (%p)",((StgTSO*)obj)->id, (StgTSO*)obj);
       fprintf(stderr,")\n"); 
       break;
 
@@ -258,6 +257,23 @@ void printClosure( StgClosure *obj )
             break;
         }
 
+#ifdef XMLAMBDA
+/* rows are mutarrays in xmlambda, maybe we should make a new type: ROW */
+    case MUT_ARR_PTRS_FROZEN:
+          {
+            StgWord i;
+            StgMutArrPtrs* p = stgCast(StgMutArrPtrs*,obj);
+
+            fprintf(stderr,"Row<%i>(",p->ptrs);
+            for (i = 0; i < p->ptrs; ++i) {
+                if (i > 0) fprintf(stderr,", ");
+                printPtr((StgPtr)(p->payload[i]));
+            }
+            fprintf(stderr,")\n");
+            break;
+          }
+#endif  
+
     case FUN:
     case FUN_1_0: case FUN_0_1: 
     case FUN_1_1: case FUN_0_2: case FUN_2_0:
@@ -813,8 +829,7 @@ static void printZcoded( const char *raw )
 /* Causing linking trouble on Win32 plats, so I'm
    disabling this for now. 
 */
-/* For now, BFD support is unconditionally disabled -- HWL */
-#if 0 /* HWL */ && defined(HAVE_BFD_H) && !defined(_WIN32)
+#if defined(HAVE_BFD_H) && !defined(_WIN32)
 
 #include <bfd.h>
 
@@ -922,6 +937,8 @@ extern void DEBUG_LoadSymbols( char *name STG_UNUSED )
 
 #include "StoragePriv.h"
 
+void findPtr(P_ p);            /* keep gcc -Wall happy */
+
 void
 findPtr(P_ p)
 {