1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1994-2000.
7 * ---------------------------------------------------------------------------*/
9 #include "PosixSource.h"
11 #include "rts/Bytecodes.h" /* for InstrPtr */
20 #include "Disassembler.h"
23 /* --------------------------------------------------------------------------
24 * local function decls
25 * ------------------------------------------------------------------------*/
27 static void printStdObjPayload( StgClosure *obj );
29 static void reset_table ( int size );
30 static void prepare_table ( void );
31 static void insert ( StgWord value, const char *name );
33 #if 0 /* unused but might be useful sometime */
34 static rtsBool lookup_name ( char *name, StgWord *result );
35 static void enZcode ( char *in, char *out );
37 static char unZcode ( char ch );
38 static void printZcoded ( const char *raw );
40 /* --------------------------------------------------------------------------
42 * ------------------------------------------------------------------------*/
44 void printPtr( StgPtr p )
47 raw = lookupGHCName(p);
55 void printObj( StgClosure *obj )
57 debugBelch("Object "); printPtr((StgPtr)obj); debugBelch(" = ");
62 printStdObjHdr( StgClosure *obj, char* tag )
64 debugBelch("%s(",tag);
65 printPtr((StgPtr)obj->header.info);
67 debugBelch(", %s", obj->header.prof.ccs->cc->label);
72 printStdObjPayload( StgClosure *obj )
75 const StgInfoTable* info;
78 for (i = 0; i < info->layout.payload.ptrs; ++i) {
80 printPtr((StgPtr)obj->payload[i]);
82 for (j = 0; j < info->layout.payload.nptrs; ++j) {
83 debugBelch(", %pd#",obj->payload[i+j]);
89 printThunkPayload( StgThunk *obj )
92 const StgInfoTable* info;
95 for (i = 0; i < info->layout.payload.ptrs; ++i) {
97 printPtr((StgPtr)obj->payload[i]);
99 for (j = 0; j < info->layout.payload.nptrs; ++j) {
100 debugBelch(", %pd#",obj->payload[i+j]);
106 printThunkObject( StgThunk *obj, char* tag )
108 printStdObjHdr( (StgClosure *)obj, tag );
109 printThunkPayload( obj );
113 printClosure( StgClosure *obj )
115 obj = UNTAG_CLOSURE(obj);
118 info = get_itbl(obj);
120 switch ( info->type ) {
122 barf("Invalid object");
125 case CONSTR_1_0: case CONSTR_0_1:
126 case CONSTR_1_1: case CONSTR_0_2: case CONSTR_2_0:
128 case CONSTR_NOCAF_STATIC:
131 StgConInfoTable *con_info = get_con_itbl (obj);
133 debugBelch("%s(", GET_CON_DESC(con_info));
134 for (i = 0; i < info->layout.payload.ptrs; ++i) {
135 if (i != 0) debugBelch(", ");
136 printPtr((StgPtr)obj->payload[i]);
138 for (j = 0; j < info->layout.payload.nptrs; ++j) {
139 if (i != 0 || j != 0) debugBelch(", ");
140 debugBelch("%p#", obj->payload[i+j]);
147 case FUN_1_0: case FUN_0_1:
148 case FUN_1_1: case FUN_0_2: case FUN_2_0:
150 debugBelch("FUN/%d(",itbl_to_fun_itbl(info)->f.arity);
151 printPtr((StgPtr)obj->header.info);
153 debugBelch(", %s", obj->header.prof.ccs->cc->label);
155 printStdObjPayload(obj);
160 printPtr((StgPtr)obj->header.info);
161 printStdObjPayload(obj);
165 case THUNK_1_0: case THUNK_0_1:
166 case THUNK_1_1: case THUNK_0_2: case THUNK_2_0:
168 /* ToDo: will this work for THUNK_STATIC too? */
170 printThunkObject((StgThunk *)obj,GET_PROF_DESC(info));
172 printThunkObject((StgThunk *)obj,"THUNK");
177 printStdObjHdr(obj, "THUNK_SELECTOR");
178 debugBelch(", %p)\n", ((StgSelector *)obj)->selectee);
182 disassemble( (StgBCO*)obj );
187 StgAP* ap = (StgAP*)obj;
189 debugBelch("AP("); printPtr((StgPtr)ap->fun);
190 for (i = 0; i < ap->n_args; ++i) {
192 printPtr((P_)ap->payload[i]);
200 StgPAP* pap = (StgPAP*)obj;
202 debugBelch("PAP/%d(",pap->arity);
203 printPtr((StgPtr)pap->fun);
204 for (i = 0; i < pap->n_args; ++i) {
206 printPtr((StgPtr)pap->payload[i]);
214 StgAP_STACK* ap = (StgAP_STACK*)obj;
216 debugBelch("AP_STACK("); printPtr((StgPtr)ap->fun);
217 for (i = 0; i < ap->size; ++i) {
219 printPtr((P_)ap->payload[i]);
227 printPtr((StgPtr)((StgInd*)obj)->indirectee);
233 printPtr((StgPtr)((StgInd*)obj)->indirectee);
238 debugBelch("IND_STATIC(");
239 printPtr((StgPtr)((StgInd*)obj)->indirectee);
244 debugBelch("BLACKHOLE(");
245 printPtr((StgPtr)((StgInd*)obj)->indirectee);
249 /* Cannot happen -- use default case.
259 StgUpdateFrame* u = (StgUpdateFrame*)obj;
260 debugBelch("UPDATE_FRAME(");
261 printPtr((StgPtr)GET_INFO(u));
263 printPtr((StgPtr)u->updatee);
270 StgCatchFrame* u = (StgCatchFrame*)obj;
271 debugBelch("CATCH_FRAME(");
272 printPtr((StgPtr)GET_INFO(u));
274 printPtr((StgPtr)u->handler);
281 StgStopFrame* u = (StgStopFrame*)obj;
282 debugBelch("STOP_FRAME(");
283 printPtr((StgPtr)GET_INFO(u));
291 debugBelch("ARR_WORDS(\"");
292 for (i=0; i<arr_words_words((StgArrWords *)obj); i++)
293 debugBelch("%lu", (lnat)((StgArrWords *)obj)->payload[i]);
298 case MUT_ARR_PTRS_CLEAN:
299 debugBelch("MUT_ARR_PTRS_CLEAN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
302 case MUT_ARR_PTRS_DIRTY:
303 debugBelch("MUT_ARR_PTRS_DIRTY(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
306 case MUT_ARR_PTRS_FROZEN:
307 debugBelch("MUT_ARR_PTRS_FROZEN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
313 StgMVar* mv = (StgMVar*)obj;
314 debugBelch("MVAR(head=%p, tail=%p, value=%p)\n", mv->head, mv->tail, mv->value);
320 StgMutVar* mv = (StgMutVar*)obj;
321 debugBelch("MUT_VAR_CLEAN(var=%p)\n", mv->var);
327 StgMutVar* mv = (StgMutVar*)obj;
328 debugBelch("MUT_VAR_DIRTY(var=%p)\n", mv->var);
334 debugBelch(" key=%p value=%p finalizer=%p",
335 (StgPtr)(((StgWeak*)obj)->key),
336 (StgPtr)(((StgWeak*)obj)->value),
337 (StgPtr)(((StgWeak*)obj)->finalizer));
339 /* ToDo: chase 'link' ? */
344 debugBelch("%lu (%p)",(unsigned long)(((StgTSO*)obj)->id), (StgTSO*)obj);
349 /* Symptomatic of a problem elsewhere, have it fall-through & fail */
351 debugBelch("EVACUATED(");
352 printClosure((StgEvacuated*)obj->evacuee);
358 //barf("printClosure %d",get_itbl(obj)->type);
359 debugBelch("*** printClosure: unknown type %d ****\n",
360 get_itbl(obj)->type );
361 barf("printClosure %d",get_itbl(obj)->type);
367 void printGraph( StgClosure *obj )
374 printStackObj( StgPtr sp )
376 /*debugBelch("Stack[%d] = ", &stgStack[STACK_SIZE] - sp); */
378 StgClosure* c = (StgClosure*)(*sp);
379 printPtr((StgPtr)*sp);
380 if (c == (StgClosure*)&stg_ctoi_R1p_info) {
381 debugBelch("\t\t\tstg_ctoi_ret_R1p_info\n" );
383 if (c == (StgClosure*)&stg_ctoi_R1n_info) {
384 debugBelch("\t\t\tstg_ctoi_ret_R1n_info\n" );
386 if (c == (StgClosure*)&stg_ctoi_F1_info) {
387 debugBelch("\t\t\tstg_ctoi_ret_F1_info\n" );
389 if (c == (StgClosure*)&stg_ctoi_D1_info) {
390 debugBelch("\t\t\tstg_ctoi_ret_D1_info\n" );
392 if (c == (StgClosure*)&stg_ctoi_V_info) {
393 debugBelch("\t\t\tstg_ctoi_ret_V_info\n" );
395 if (get_itbl(c)->type == BCO) {
396 debugBelch("\t\t\t");
397 debugBelch("BCO(...)\n");
400 debugBelch("\t\t\t");
401 printClosure ( (StgClosure*)(*sp));
410 printSmallBitmap( StgPtr spBottom, StgPtr payload, StgWord bitmap, nat size )
416 for(i = 0; i < size; i++, bitmap >>= 1 ) {
417 debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-(payload+i)), payload+i);
418 if ((bitmap & 1) == 0) {
419 printPtr((P_)payload[i]);
422 debugBelch("Word# %lu\n", (lnat)payload[i]);
428 printLargeBitmap( StgPtr spBottom, StgPtr payload, StgLargeBitmap* large_bitmap, nat size )
434 for (bmp=0; i < size; bmp++) {
435 StgWord bitmap = large_bitmap->bitmap[bmp];
437 for(; i < size && j < BITS_IN(W_); j++, i++, bitmap >>= 1 ) {
438 debugBelch(" stk[%lu] (%p) = ", (lnat)(spBottom-(payload+i)), payload+i);
439 if ((bitmap & 1) == 0) {
440 printPtr((P_)payload[i]);
443 debugBelch("Word# %lu\n", (lnat)payload[i]);
450 printStackChunk( StgPtr sp, StgPtr spBottom )
453 const StgInfoTable *info;
455 ASSERT(sp <= spBottom);
456 for (; sp < spBottom; sp += stack_frame_sizeW((StgClosure *)sp)) {
458 info = get_itbl((StgClosure *)sp);
460 switch (info->type) {
464 printObj((StgClosure*)sp);
468 printObj((StgClosure*)sp);
480 debugBelch("RET_DYN (%p)\n", r);
482 p = (P_)(r->payload);
483 printSmallBitmap(spBottom, sp,
484 RET_DYN_LIVENESS(r->liveness),
485 RET_DYN_BITMAP_SIZE);
486 p += RET_DYN_BITMAP_SIZE + RET_DYN_NONPTR_REGS_SIZE;
488 for (size = RET_DYN_NONPTRS(dyn); size > 0; size--) {
489 debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-p), p);
490 debugBelch("Word# %ld\n", (long)*p);
494 for (size = RET_DYN_PTRS(dyn); size > 0; size--) {
495 debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-p), p);
503 debugBelch("RET_SMALL (%p)\n", info);
504 bitmap = info->layout.bitmap;
505 printSmallBitmap(spBottom, sp+1,
506 BITMAP_BITS(bitmap), BITMAP_SIZE(bitmap));
512 bco = ((StgBCO *)sp[1]);
514 debugBelch("RET_BCO (%p)\n", sp);
515 printLargeBitmap(spBottom, sp+2,
516 BCO_BITMAP(bco), BCO_BITMAP_SIZE(bco));
525 StgFunInfoTable *fun_info;
529 ret_fun = (StgRetFun *)sp;
530 fun_info = get_fun_itbl(ret_fun->fun);
531 size = ret_fun->size;
532 debugBelch("RET_FUN (%p) (type=%d)\n", ret_fun->fun, fun_info->f.fun_type);
533 switch (fun_info->f.fun_type) {
535 printSmallBitmap(spBottom, sp+2,
536 BITMAP_BITS(fun_info->f.b.bitmap),
537 BITMAP_SIZE(fun_info->f.b.bitmap));
540 printLargeBitmap(spBottom, sp+2,
541 GET_FUN_LARGE_BITMAP(fun_info),
542 GET_FUN_LARGE_BITMAP(fun_info)->size);
545 printSmallBitmap(spBottom, sp+2,
546 BITMAP_BITS(stg_arg_bitmaps[fun_info->f.fun_type]),
547 BITMAP_SIZE(stg_arg_bitmaps[fun_info->f.fun_type]));
554 debugBelch("unknown object %d\n", info->type);
555 barf("printStackChunk");
560 void printTSO( StgTSO *tso )
562 printStackChunk( tso->sp, tso->stack+tso->stack_size);
565 /* --------------------------------------------------------------------------
566 * Address printing code
568 * Uses symbol table in (unstripped executable)
569 * ------------------------------------------------------------------------*/
571 /* --------------------------------------------------------------------------
572 * Simple lookup table
574 * Current implementation is pretty dumb!
575 * ------------------------------------------------------------------------*/
582 static nat table_size;
583 static struct entry* table;
586 static nat max_table_size;
588 static void reset_table( int size )
590 max_table_size = size;
592 table = (struct entry *)stgMallocBytes(size * sizeof(struct entry), "Printer.c:reset_table()");
595 static void prepare_table( void )
597 /* Could sort it... */
600 static void insert( StgWord value, const char *name )
602 if ( table_size >= max_table_size ) {
603 barf( "Symbol table overflow\n" );
605 table[table_size].value = value;
606 table[table_size].name = name;
607 table_size = table_size + 1;
612 static rtsBool lookup_name( char *name, StgWord *result )
615 for( i = 0; i < table_size && strcmp(name,table[i].name) != 0; ++i ) {
617 if (i < table_size) {
618 *result = table[i].value;
626 /* Code from somewhere inside GHC (circa 1994)
628 * "std"++xs -> "Zstd"++xs
629 * char_to_c 'Z' = "ZZ"
630 * char_to_c '&' = "Za"
631 * char_to_c '|' = "Zb"
632 * char_to_c ':' = "Zc"
633 * char_to_c '/' = "Zd"
634 * char_to_c '=' = "Ze"
635 * char_to_c '>' = "Zg"
636 * char_to_c '#' = "Zh"
637 * char_to_c '<' = "Zl"
638 * char_to_c '-' = "Zm"
639 * char_to_c '!' = "Zn"
640 * char_to_c '.' = "Zo"
641 * char_to_c '+' = "Zp"
642 * char_to_c '\'' = "Zq"
643 * char_to_c '*' = "Zt"
644 * char_to_c '_' = "Zu"
645 * char_to_c c = "Z" ++ show (ord c)
647 static char unZcode( char ch )
650 case 'a' : return ('&');
651 case 'b' : return ('|');
652 case 'c' : return (':');
653 case 'd' : return ('/');
654 case 'e' : return ('=');
655 case 'g' : return ('>');
656 case 'h' : return ('#');
657 case 'l' : return ('<');
658 case 'm' : return ('-');
659 case 'n' : return ('!');
660 case 'o' : return ('.');
661 case 'p' : return ('+');
662 case 'q' : return ('\'');
663 case 't' : return ('*');
664 case 'u' : return ('_');
666 case '\0' : return ('Z');
667 default : return (ch);
672 /* Precondition: out big enough to handle output (about twice length of in) */
673 static void enZcode( char *in, char *out )
679 for( i = 0; in[i] != '\0'; ++i ) {
754 const char *lookupGHCName( void *addr )
757 for( i = 0; i < table_size && table[i].value != (StgWord) addr; ++i ) {
759 if (i < table_size) {
760 return table[i].name;
766 static void printZcoded( const char *raw )
770 while ( raw[j] != '\0' ) {
772 debugBelch("%c", unZcode(raw[j+1]));
775 debugBelch("%c", unZcode(raw[j+1]));
781 /* --------------------------------------------------------------------------
782 * Symbol table loading
783 * ------------------------------------------------------------------------*/
785 /* Causing linking trouble on Win32 plats, so I'm
786 disabling this for now.
792 /* Fairly ad-hoc piece of code that seems to filter out a lot of
793 * rubbish like the obj-splitting symbols
796 static rtsBool isReal( flagword flags STG_UNUSED, const char *name )
799 /* ToDo: make this work on BFD */
800 int tp = type & N_TYPE;
801 if (tp == N_TEXT || tp == N_DATA) {
802 return (name[0] == '_' && name[1] != '_');
808 (name[0] == 'g' && name[1] == 'c' && name[2] == 'c') ||
809 (name[0] == 'c' && name[1] == 'c' && name[2] == '.')) {
816 extern void DEBUG_LoadSymbols( char *name )
822 abfd = bfd_openr(name, "default");
824 barf("can't open executable %s to get symbol table", name);
826 if (!bfd_check_format_matches (abfd, bfd_object, &matching)) {
832 asymbol **symbol_table;
833 long number_of_symbols;
834 long num_real_syms = 0;
837 storage_needed = bfd_get_symtab_upper_bound (abfd);
839 if (storage_needed < 0) {
840 barf("can't read symbol table");
843 if (storage_needed == 0) {
844 debugBelch("no storage needed");
847 symbol_table = (asymbol **) stgMallocBytes(storage_needed,"DEBUG_LoadSymbols");
849 number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
851 if (number_of_symbols < 0) {
852 barf("can't canonicalise symbol table");
855 for( i = 0; i != number_of_symbols; ++i ) {
857 bfd_get_symbol_info(abfd,symbol_table[i],&info);
858 /*debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name); */
859 if (isReal(info.type, info.name)) {
864 IF_DEBUG(interpreter,
865 debugBelch("Loaded %ld symbols. Of which %ld are real symbols\n",
866 number_of_symbols, num_real_syms)
869 reset_table( num_real_syms );
871 for( i = 0; i != number_of_symbols; ++i ) {
873 bfd_get_symbol_info(abfd,symbol_table[i],&info);
874 if (isReal(info.type, info.name)) {
875 insert( info.value, info.name );
879 stgFree(symbol_table);
884 #else /* HAVE_BFD_H */
886 extern void DEBUG_LoadSymbols( char *name STG_UNUSED )
891 #endif /* HAVE_BFD_H */
893 void findPtr(P_ p, int); /* keep gcc -Wall happy */
898 findPtrBlocks (StgPtr p, bdescr *bd, StgPtr arr[], int arr_size, int i)
901 for (; bd; bd = bd->link) {
903 for (q = bd->start; q < bd->free; q++) {
904 if (UNTAG_CLOSURE((StgClosure*)*q) == (StgClosure *)p) {
906 for (r = bd->start; r < bd->free; r = end) {
907 // skip over zeroed-out slop
909 if (!LOOKS_LIKE_CLOSURE_PTR(r)) {
910 debugBelch("%p found at %p, no closure at %p\n",
914 end = r + closure_sizeW((StgClosure*)r);
916 debugBelch("%p = ", r);
917 printClosure((StgClosure *)r);
923 debugBelch("%p found at %p, closure?", p, q);
935 findPtr(P_ p, int follow)
939 const int arr_size = 1024;
940 StgPtr arr[arr_size];
944 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
945 bd = generations[g].blocks;
946 i = findPtrBlocks(p,bd,arr,arr_size,i);
947 bd = generations[g].large_objects;
948 i = findPtrBlocks(p,bd,arr,arr_size,i);
949 if (i >= arr_size) return;
951 if (follow && i == 1) {
957 /* prettyPrintClosure() is for printing out a closure using the data constructor
958 names found in the info tables. Closures are printed in a fashion that resembles
959 their Haskell representation. Useful during debugging.
961 Todo: support for more closure types, and support for non pointer fields in the
965 void prettyPrintClosure_ (StgClosure *);
967 void prettyPrintClosure (StgClosure *obj)
969 prettyPrintClosure_ (obj);
973 void prettyPrintClosure_ (StgClosure *obj)
976 StgConInfoTable *con_info;
978 /* collapse any indirections */
980 type = get_itbl(obj)->type;
982 while (type == IND ||
983 type == IND_STATIC ||
986 obj = ((StgInd *)obj)->indirectee;
987 type = get_itbl(obj)->type;
990 /* find the info table for this object */
991 info = get_itbl(obj);
993 /* determine what kind of object we have */
996 /* full applications of data constructors */
1004 case CONSTR_NOCAF_STATIC:
1009 /* find the con_info for the constructor */
1010 con_info = get_con_itbl (obj);
1012 /* obtain the name of the constructor */
1013 descriptor = GET_CON_DESC(con_info);
1015 debugBelch ("(%s", descriptor);
1017 /* process the payload of the closure */
1018 /* we don't handle non pointers at the moment */
1019 for (i = 0; i < info->layout.payload.ptrs; i++)
1022 prettyPrintClosure_ ((StgClosure *) obj->payload[i]);
1028 /* if it isn't a constructor then just print the closure type */
1031 debugBelch ("<%s>", info_type(obj));
1037 char *what_next_strs[] = {
1039 [ThreadRunGHC] = "ThreadRunGHC",
1040 [ThreadInterpret] = "ThreadInterpret",
1041 [ThreadKilled] = "ThreadKilled",
1042 [ThreadRelocated] = "ThreadRelocated",
1043 [ThreadComplete] = "ThreadComplete"
1047 void printPtr( StgPtr p )
1049 debugBelch("ptr 0x%p (enable -DDEBUG for more info) " , p );
1052 void printObj( StgClosure *obj )
1054 debugBelch("obj 0x%p (enable -DDEBUG for more info) " , obj );
1060 /* -----------------------------------------------------------------------------
1063 NOTE: must be kept in sync with the closure types in includes/ClosureTypes.h
1064 -------------------------------------------------------------------------- */
1066 char *closure_type_names[] = {
1067 [INVALID_OBJECT] = "INVALID_OBJECT",
1068 [CONSTR] = "CONSTR",
1069 [CONSTR_1_0] = "CONSTR_1_0",
1070 [CONSTR_0_1] = "CONSTR_0_1",
1071 [CONSTR_2_0] = "CONSTR_2_0",
1072 [CONSTR_1_1] = "CONSTR_1_1",
1073 [CONSTR_0_2] = "CONSTR_0_2",
1074 [CONSTR_STATIC] = "CONSTR_STATIC",
1075 [CONSTR_NOCAF_STATIC] = "CONSTR_NOCAF_STATIC",
1077 [FUN_1_0] = "FUN_1_0",
1078 [FUN_0_1] = "FUN_0_1",
1079 [FUN_2_0] = "FUN_2_0",
1080 [FUN_1_1] = "FUN_1_1",
1081 [FUN_0_2] = "FUN_0_2",
1082 [FUN_STATIC] = "FUN_STATIC",
1084 [THUNK_1_0] = "THUNK_1_0",
1085 [THUNK_0_1] = "THUNK_0_1",
1086 [THUNK_2_0] = "THUNK_2_0",
1087 [THUNK_1_1] = "THUNK_1_1",
1088 [THUNK_0_2] = "THUNK_0_2",
1089 [THUNK_STATIC] = "THUNK_STATIC",
1090 [THUNK_SELECTOR] = "THUNK_SELECTOR",
1094 [AP_STACK] = "AP_STACK",
1096 [IND_PERM] = "IND_PERM",
1097 [IND_STATIC] = "IND_STATIC",
1098 [RET_BCO] = "RET_BCO",
1099 [RET_SMALL] = "RET_SMALL",
1100 [RET_BIG] = "RET_BIG",
1101 [RET_DYN] = "RET_DYN",
1102 [RET_FUN] = "RET_FUN",
1103 [UPDATE_FRAME] = "UPDATE_FRAME",
1104 [CATCH_FRAME] = "CATCH_FRAME",
1105 [STOP_FRAME] = "STOP_FRAME",
1106 [BLACKHOLE] = "BLACKHOLE",
1107 [BLOCKING_QUEUE] = "BLOCKING_QUEUE",
1108 [MVAR_CLEAN] = "MVAR_CLEAN",
1109 [MVAR_DIRTY] = "MVAR_DIRTY",
1110 [ARR_WORDS] = "ARR_WORDS",
1111 [MUT_ARR_PTRS_CLEAN] = "MUT_ARR_PTRS_CLEAN",
1112 [MUT_ARR_PTRS_DIRTY] = "MUT_ARR_PTRS_DIRTY",
1113 [MUT_ARR_PTRS_FROZEN0] = "MUT_ARR_PTRS_FROZEN0",
1114 [MUT_ARR_PTRS_FROZEN] = "MUT_ARR_PTRS_FROZEN",
1115 [MUT_VAR_CLEAN] = "MUT_VAR_CLEAN",
1116 [MUT_VAR_DIRTY] = "MUT_VAR_DIRTY",
1119 [MUT_PRIM] = "MUT_PRIM",
1121 [TREC_CHUNK] = "TREC_CHUNK",
1122 [ATOMICALLY_FRAME] = "ATOMICALLY_FRAME",
1123 [CATCH_RETRY_FRAME] = "CATCH_RETRY_FRAME",
1124 [CATCH_STM_FRAME] = "CATCH_STM_FRAME",
1125 [WHITEHOLE] = "WHITEHOLE"
1129 info_type(StgClosure *closure){
1130 return closure_type_names[get_itbl(closure)->type];
1134 info_type_by_ip(StgInfoTable *ip){
1135 return closure_type_names[ip->type];
1139 info_hdr_type(StgClosure *closure, char *res){
1140 strcpy(res,closure_type_names[get_itbl(closure)->type]);