[project @ 2001-04-01 05:56:29 by chak]
[ghc-hetmet.git] / ghc / rts / Printer.c
index b163389..c173a93 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.34 2001/01/29 17:23:41 simonmar Exp $
+ * $Id: Printer.c,v 1.38 2001/03/22 03:51:10 hwloidl Exp $
  *
  * (c) The GHC Team, 1994-2000.
  *
 
 #include "Printer.h"
 
+#if defined(GRAN) || defined(PAR)
 // HWL: explicit fixed header size to make debugging easier
 int fixed_hs = FIXED_HS, itbl_sz = sizeofW(StgInfoTable), 
     uf_sz=sizeofW(StgUpdateFrame), sf_sz=sizeofW(StgSeqFrame); 
+#endif
 
 /* --------------------------------------------------------------------------
  * local function decls
@@ -45,24 +47,11 @@ static void    printZcoded   ( const char *raw );
  * Printer
  * ------------------------------------------------------------------------*/
 
-#ifdef INTERPRETER
-char* lookupHugsItblName ( void* itbl );
-#endif
-
 void printPtr( StgPtr p )
 {
-#ifdef INTERPRETER
-    char* str;
-#endif
     const char *raw;
     if (lookupGHCName( p, &raw )) {
         printZcoded(raw);
-#ifdef INTERPRETER
-    } else if ((raw = lookupHugsName(p)) != 0) {
-        fprintf(stderr, "%s", raw);
-    } else if ((str = lookupHugsItblName(p)) != 0) {
-        fprintf(stderr, "%p=%s", p, str);
-#endif
     } else {
         fprintf(stderr, "%p", p);
     }
@@ -95,11 +84,9 @@ void printClosure( StgClosure *obj )
     switch ( get_itbl(obj)->type ) {
     case INVALID_OBJECT:
             barf("Invalid object");
-#ifdef GHCI
     case BCO:
             disassemble( (StgBCO*)obj );
             break;
-#endif
 
     case AP_UPD:
         {
@@ -189,6 +176,14 @@ void printClosure( StgClosure *obj )
       fprintf(stderr,")\n"); 
       break;
 
+#ifdef DIST      
+    case REMOTE_REF:
+      fprintf(stderr,"REMOTE_REF("); 
+      printGA((globalAddr *)stgCast(StgFetchMe*,obj)->ga);
+      fprintf(stderr,")\n"); 
+      break;
+#endif
+  
     case FETCH_ME_BQ:
       fprintf(stderr,"FETCH_ME_BQ("); 
       // printGA((globalAddr *)stgCast(StgFetchMe*,obj)->ga);
@@ -358,7 +353,6 @@ StgPtr printStackObj( StgPtr sp )
     } else {
         StgClosure* c = (StgClosure*)(*sp);
         printPtr((StgPtr)*sp);
-#ifdef GHCI
         if (c == (StgClosure*)&stg_ctoi_ret_R1p_info) {
            fprintf(stderr, "\t\t\tstg_ctoi_ret_R1p_info\n" );
        } else
@@ -371,7 +365,9 @@ StgPtr printStackObj( StgPtr sp )
         if (c == (StgClosure*)&stg_ctoi_ret_D1_info) {
            fprintf(stderr, "\t\t\tstg_ctoi_ret_D1_info\n" );
        } else
-#endif
+        if (c == (StgClosure*)&stg_ctoi_ret_V_info) {
+           fprintf(stderr, "\t\t\tstg_ctoi_ret_V_info\n" );
+       } else
         if (get_itbl(c)->type == BCO) {
            fprintf(stderr, "\t\t\t");
            fprintf(stderr, "BCO(...)\n"); 
@@ -566,7 +562,8 @@ static char *closure_type_names[] = {
   "FETCH_ME_BQ",                /* 62 */
   "RBH",                        /* 63 */
   "EVACUATED",                  /* 64 */
-  "N_CLOSURE_TYPES"            /* 65 */
+  "REMOTE_REF",                 /* 65 */
+  "N_CLOSURE_TYPES"            /* 66 */
 };
 
 char *
@@ -806,7 +803,7 @@ static void printZcoded( const char *raw )
 /* Causing linking trouble on Win32 plats, so I'm
    disabling this for now. 
 */
-#if defined(HAVE_BFD_H) && !defined(_WIN32)
+#if defined(HAVE_BFD_H) && !defined(_WIN32) && !defined(PAR) && !defined(GRAN)
 
 #include <bfd.h>