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);
279 case UNDERFLOW_FRAME:
281 StgUnderflowFrame* u = (StgUnderflowFrame*)obj;
282 debugBelch("UNDERFLOW_FRAME(");
283 printPtr((StgPtr)u->next_chunk);
290 StgStopFrame* u = (StgStopFrame*)obj;
291 debugBelch("STOP_FRAME(");
292 printPtr((StgPtr)GET_INFO(u));
300 debugBelch("ARR_WORDS(\"");
301 for (i=0; i<arr_words_words((StgArrWords *)obj); i++)
302 debugBelch("%lu", (lnat)((StgArrWords *)obj)->payload[i]);
307 case MUT_ARR_PTRS_CLEAN:
308 debugBelch("MUT_ARR_PTRS_CLEAN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
311 case MUT_ARR_PTRS_DIRTY:
312 debugBelch("MUT_ARR_PTRS_DIRTY(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
315 case MUT_ARR_PTRS_FROZEN:
316 debugBelch("MUT_ARR_PTRS_FROZEN(size=%lu)\n", (lnat)((StgMutArrPtrs *)obj)->ptrs);
322 StgMVar* mv = (StgMVar*)obj;
323 debugBelch("MVAR(head=%p, tail=%p, value=%p)\n", mv->head, mv->tail, mv->value);
329 StgMutVar* mv = (StgMutVar*)obj;
330 debugBelch("MUT_VAR_CLEAN(var=%p)\n", mv->var);
336 StgMutVar* mv = (StgMutVar*)obj;
337 debugBelch("MUT_VAR_DIRTY(var=%p)\n", mv->var);
343 debugBelch(" key=%p value=%p finalizer=%p",
344 (StgPtr)(((StgWeak*)obj)->key),
345 (StgPtr)(((StgWeak*)obj)->value),
346 (StgPtr)(((StgWeak*)obj)->finalizer));
348 /* ToDo: chase 'link' ? */
353 debugBelch("%lu (%p)",(unsigned long)(((StgTSO*)obj)->id), (StgTSO*)obj);
358 /* Symptomatic of a problem elsewhere, have it fall-through & fail */
360 debugBelch("EVACUATED(");
361 printClosure((StgEvacuated*)obj->evacuee);
367 //barf("printClosure %d",get_itbl(obj)->type);
368 debugBelch("*** printClosure: unknown type %d ****\n",
369 get_itbl(obj)->type );
370 barf("printClosure %d",get_itbl(obj)->type);
376 void printGraph( StgClosure *obj )
383 printStackObj( StgPtr sp )
385 /*debugBelch("Stack[%d] = ", &stgStack[STACK_SIZE] - sp); */
387 StgClosure* c = (StgClosure*)(*sp);
388 printPtr((StgPtr)*sp);
389 if (c == (StgClosure*)&stg_ctoi_R1p_info) {
390 debugBelch("\t\t\tstg_ctoi_ret_R1p_info\n" );
392 if (c == (StgClosure*)&stg_ctoi_R1n_info) {
393 debugBelch("\t\t\tstg_ctoi_ret_R1n_info\n" );
395 if (c == (StgClosure*)&stg_ctoi_F1_info) {
396 debugBelch("\t\t\tstg_ctoi_ret_F1_info\n" );
398 if (c == (StgClosure*)&stg_ctoi_D1_info) {
399 debugBelch("\t\t\tstg_ctoi_ret_D1_info\n" );
401 if (c == (StgClosure*)&stg_ctoi_V_info) {
402 debugBelch("\t\t\tstg_ctoi_ret_V_info\n" );
404 if (get_itbl(c)->type == BCO) {
405 debugBelch("\t\t\t");
406 debugBelch("BCO(...)\n");
409 debugBelch("\t\t\t");
410 printClosure ( (StgClosure*)(*sp));
419 printSmallBitmap( StgPtr spBottom, StgPtr payload, StgWord bitmap, nat size )
425 for(i = 0; i < size; i++, bitmap >>= 1 ) {
426 debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-(payload+i)), payload+i);
427 if ((bitmap & 1) == 0) {
428 printPtr((P_)payload[i]);
431 debugBelch("Word# %lu\n", (lnat)payload[i]);
437 printLargeBitmap( StgPtr spBottom, StgPtr payload, StgLargeBitmap* large_bitmap, nat size )
443 for (bmp=0; i < size; bmp++) {
444 StgWord bitmap = large_bitmap->bitmap[bmp];
446 for(; i < size && j < BITS_IN(W_); j++, i++, bitmap >>= 1 ) {
447 debugBelch(" stk[%lu] (%p) = ", (lnat)(spBottom-(payload+i)), payload+i);
448 if ((bitmap & 1) == 0) {
449 printPtr((P_)payload[i]);
452 debugBelch("Word# %lu\n", (lnat)payload[i]);
459 printStackChunk( StgPtr sp, StgPtr spBottom )
462 const StgInfoTable *info;
464 ASSERT(sp <= spBottom);
465 for (; sp < spBottom; sp += stack_frame_sizeW((StgClosure *)sp)) {
467 info = get_itbl((StgClosure *)sp);
469 switch (info->type) {
473 case UNDERFLOW_FRAME:
475 printObj((StgClosure*)sp);
487 debugBelch("RET_DYN (%p)\n", r);
489 p = (P_)(r->payload);
490 printSmallBitmap(spBottom, sp,
491 RET_DYN_LIVENESS(r->liveness),
492 RET_DYN_BITMAP_SIZE);
493 p += RET_DYN_BITMAP_SIZE + RET_DYN_NONPTR_REGS_SIZE;
495 for (size = RET_DYN_NONPTRS(dyn); size > 0; size--) {
496 debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-p), p);
497 debugBelch("Word# %ld\n", (long)*p);
501 for (size = RET_DYN_PTRS(dyn); size > 0; size--) {
502 debugBelch(" stk[%ld] (%p) = ", (long)(spBottom-p), p);
510 debugBelch("RET_SMALL (%p)\n", info);
511 bitmap = info->layout.bitmap;
512 printSmallBitmap(spBottom, sp+1,
513 BITMAP_BITS(bitmap), BITMAP_SIZE(bitmap));
519 bco = ((StgBCO *)sp[1]);
521 debugBelch("RET_BCO (%p)\n", sp);
522 printLargeBitmap(spBottom, sp+2,
523 BCO_BITMAP(bco), BCO_BITMAP_SIZE(bco));
532 StgFunInfoTable *fun_info;
536 ret_fun = (StgRetFun *)sp;
537 fun_info = get_fun_itbl(ret_fun->fun);
538 size = ret_fun->size;
539 debugBelch("RET_FUN (%p) (type=%d)\n", ret_fun->fun, fun_info->f.fun_type);
540 switch (fun_info->f.fun_type) {
542 printSmallBitmap(spBottom, sp+2,
543 BITMAP_BITS(fun_info->f.b.bitmap),
544 BITMAP_SIZE(fun_info->f.b.bitmap));
547 printLargeBitmap(spBottom, sp+2,
548 GET_FUN_LARGE_BITMAP(fun_info),
549 GET_FUN_LARGE_BITMAP(fun_info)->size);
552 printSmallBitmap(spBottom, sp+2,
553 BITMAP_BITS(stg_arg_bitmaps[fun_info->f.fun_type]),
554 BITMAP_SIZE(stg_arg_bitmaps[fun_info->f.fun_type]));
561 debugBelch("unknown object %d\n", info->type);
562 barf("printStackChunk");
567 void printTSO( StgTSO *tso )
569 printStackChunk( tso->stackobj->sp,
570 tso->stackobj->stack+tso->stackobj->stack_size);
573 /* --------------------------------------------------------------------------
574 * Address printing code
576 * Uses symbol table in (unstripped executable)
577 * ------------------------------------------------------------------------*/
579 /* --------------------------------------------------------------------------
580 * Simple lookup table
582 * Current implementation is pretty dumb!
583 * ------------------------------------------------------------------------*/
590 static nat table_size;
591 static struct entry* table;
594 static nat max_table_size;
596 static void reset_table( int size )
598 max_table_size = size;
600 table = (struct entry *)stgMallocBytes(size * sizeof(struct entry), "Printer.c:reset_table()");
603 static void prepare_table( void )
605 /* Could sort it... */
608 static void insert( StgWord value, const char *name )
610 if ( table_size >= max_table_size ) {
611 barf( "Symbol table overflow\n" );
613 table[table_size].value = value;
614 table[table_size].name = name;
615 table_size = table_size + 1;
620 static rtsBool lookup_name( char *name, StgWord *result )
623 for( i = 0; i < table_size && strcmp(name,table[i].name) != 0; ++i ) {
625 if (i < table_size) {
626 *result = table[i].value;
634 /* Code from somewhere inside GHC (circa 1994)
636 * "std"++xs -> "Zstd"++xs
637 * char_to_c 'Z' = "ZZ"
638 * char_to_c '&' = "Za"
639 * char_to_c '|' = "Zb"
640 * char_to_c ':' = "Zc"
641 * char_to_c '/' = "Zd"
642 * char_to_c '=' = "Ze"
643 * char_to_c '>' = "Zg"
644 * char_to_c '#' = "Zh"
645 * char_to_c '<' = "Zl"
646 * char_to_c '-' = "Zm"
647 * char_to_c '!' = "Zn"
648 * char_to_c '.' = "Zo"
649 * char_to_c '+' = "Zp"
650 * char_to_c '\'' = "Zq"
651 * char_to_c '*' = "Zt"
652 * char_to_c '_' = "Zu"
653 * char_to_c c = "Z" ++ show (ord c)
655 static char unZcode( char ch )
658 case 'a' : return ('&');
659 case 'b' : return ('|');
660 case 'c' : return (':');
661 case 'd' : return ('/');
662 case 'e' : return ('=');
663 case 'g' : return ('>');
664 case 'h' : return ('#');
665 case 'l' : return ('<');
666 case 'm' : return ('-');
667 case 'n' : return ('!');
668 case 'o' : return ('.');
669 case 'p' : return ('+');
670 case 'q' : return ('\'');
671 case 't' : return ('*');
672 case 'u' : return ('_');
674 case '\0' : return ('Z');
675 default : return (ch);
680 /* Precondition: out big enough to handle output (about twice length of in) */
681 static void enZcode( char *in, char *out )
687 for( i = 0; in[i] != '\0'; ++i ) {
762 const char *lookupGHCName( void *addr )
765 for( i = 0; i < table_size && table[i].value != (StgWord) addr; ++i ) {
767 if (i < table_size) {
768 return table[i].name;
774 static void printZcoded( const char *raw )
778 while ( raw[j] != '\0' ) {
780 debugBelch("%c", unZcode(raw[j+1]));
783 debugBelch("%c", unZcode(raw[j+1]));
789 /* --------------------------------------------------------------------------
790 * Symbol table loading
791 * ------------------------------------------------------------------------*/
793 /* Causing linking trouble on Win32 plats, so I'm
794 disabling this for now.
800 /* Fairly ad-hoc piece of code that seems to filter out a lot of
801 * rubbish like the obj-splitting symbols
804 static rtsBool isReal( flagword flags STG_UNUSED, const char *name )
807 /* ToDo: make this work on BFD */
808 int tp = type & N_TYPE;
809 if (tp == N_TEXT || tp == N_DATA) {
810 return (name[0] == '_' && name[1] != '_');
816 (name[0] == 'g' && name[1] == 'c' && name[2] == 'c') ||
817 (name[0] == 'c' && name[1] == 'c' && name[2] == '.')) {
824 extern void DEBUG_LoadSymbols( char *name )
830 abfd = bfd_openr(name, "default");
832 barf("can't open executable %s to get symbol table", name);
834 if (!bfd_check_format_matches (abfd, bfd_object, &matching)) {
840 asymbol **symbol_table;
841 long number_of_symbols;
842 long num_real_syms = 0;
845 storage_needed = bfd_get_symtab_upper_bound (abfd);
847 if (storage_needed < 0) {
848 barf("can't read symbol table");
851 if (storage_needed == 0) {
852 debugBelch("no storage needed");
855 symbol_table = (asymbol **) stgMallocBytes(storage_needed,"DEBUG_LoadSymbols");
857 number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
859 if (number_of_symbols < 0) {
860 barf("can't canonicalise symbol table");
863 for( i = 0; i != number_of_symbols; ++i ) {
865 bfd_get_symbol_info(abfd,symbol_table[i],&info);
866 /*debugBelch("\t%c\t0x%x \t%s\n",info.type,(nat)info.value,info.name); */
867 if (isReal(info.type, info.name)) {
872 IF_DEBUG(interpreter,
873 debugBelch("Loaded %ld symbols. Of which %ld are real symbols\n",
874 number_of_symbols, num_real_syms)
877 reset_table( num_real_syms );
879 for( i = 0; i != number_of_symbols; ++i ) {
881 bfd_get_symbol_info(abfd,symbol_table[i],&info);
882 if (isReal(info.type, info.name)) {
883 insert( info.value, info.name );
887 stgFree(symbol_table);
892 #else /* HAVE_BFD_H */
894 extern void DEBUG_LoadSymbols( char *name STG_UNUSED )
899 #endif /* HAVE_BFD_H */
901 void findPtr(P_ p, int); /* keep gcc -Wall happy */
906 findPtrBlocks (StgPtr p, bdescr *bd, StgPtr arr[], int arr_size, int i)
909 for (; bd; bd = bd->link) {
911 for (q = bd->start; q < bd->free; q++) {
912 if (UNTAG_CLOSURE((StgClosure*)*q) == (StgClosure *)p) {
914 for (r = bd->start; r < bd->free; r = end) {
915 // skip over zeroed-out slop
917 if (!LOOKS_LIKE_CLOSURE_PTR(r)) {
918 debugBelch("%p found at %p, no closure at %p\n",
922 end = r + closure_sizeW((StgClosure*)r);
924 debugBelch("%p = ", r);
925 printClosure((StgClosure *)r);
931 debugBelch("%p found at %p, closure?", p, q);
943 findPtr(P_ p, int follow)
947 const int arr_size = 1024;
948 StgPtr arr[arr_size];
952 for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
953 bd = generations[g].blocks;
954 i = findPtrBlocks(p,bd,arr,arr_size,i);
955 bd = generations[g].large_objects;
956 i = findPtrBlocks(p,bd,arr,arr_size,i);
957 if (i >= arr_size) return;
959 if (follow && i == 1) {
965 /* prettyPrintClosure() is for printing out a closure using the data constructor
966 names found in the info tables. Closures are printed in a fashion that resembles
967 their Haskell representation. Useful during debugging.
969 Todo: support for more closure types, and support for non pointer fields in the
973 void prettyPrintClosure_ (StgClosure *);
975 void prettyPrintClosure (StgClosure *obj)
977 prettyPrintClosure_ (obj);
981 void prettyPrintClosure_ (StgClosure *obj)
984 StgConInfoTable *con_info;
986 /* collapse any indirections */
988 type = get_itbl(obj)->type;
990 while (type == IND ||
991 type == IND_STATIC ||
994 obj = ((StgInd *)obj)->indirectee;
995 type = get_itbl(obj)->type;
998 /* find the info table for this object */
999 info = get_itbl(obj);
1001 /* determine what kind of object we have */
1004 /* full applications of data constructors */
1012 case CONSTR_NOCAF_STATIC:
1017 /* find the con_info for the constructor */
1018 con_info = get_con_itbl (obj);
1020 /* obtain the name of the constructor */
1021 descriptor = GET_CON_DESC(con_info);
1023 debugBelch ("(%s", descriptor);
1025 /* process the payload of the closure */
1026 /* we don't handle non pointers at the moment */
1027 for (i = 0; i < info->layout.payload.ptrs; i++)
1030 prettyPrintClosure_ ((StgClosure *) obj->payload[i]);
1036 /* if it isn't a constructor then just print the closure type */
1039 debugBelch ("<%s>", info_type(obj));
1045 char *what_next_strs[] = {
1047 [ThreadRunGHC] = "ThreadRunGHC",
1048 [ThreadInterpret] = "ThreadInterpret",
1049 [ThreadKilled] = "ThreadKilled",
1050 [ThreadComplete] = "ThreadComplete"
1054 void printPtr( StgPtr p )
1056 debugBelch("ptr 0x%p (enable -DDEBUG for more info) " , p );
1059 void printObj( StgClosure *obj )
1061 debugBelch("obj 0x%p (enable -DDEBUG for more info) " , obj );
1067 /* -----------------------------------------------------------------------------
1070 NOTE: must be kept in sync with the closure types in includes/ClosureTypes.h
1071 -------------------------------------------------------------------------- */
1073 char *closure_type_names[] = {
1074 [INVALID_OBJECT] = "INVALID_OBJECT",
1075 [CONSTR] = "CONSTR",
1076 [CONSTR_1_0] = "CONSTR_1_0",
1077 [CONSTR_0_1] = "CONSTR_0_1",
1078 [CONSTR_2_0] = "CONSTR_2_0",
1079 [CONSTR_1_1] = "CONSTR_1_1",
1080 [CONSTR_0_2] = "CONSTR_0_2",
1081 [CONSTR_STATIC] = "CONSTR_STATIC",
1082 [CONSTR_NOCAF_STATIC] = "CONSTR_NOCAF_STATIC",
1084 [FUN_1_0] = "FUN_1_0",
1085 [FUN_0_1] = "FUN_0_1",
1086 [FUN_2_0] = "FUN_2_0",
1087 [FUN_1_1] = "FUN_1_1",
1088 [FUN_0_2] = "FUN_0_2",
1089 [FUN_STATIC] = "FUN_STATIC",
1091 [THUNK_1_0] = "THUNK_1_0",
1092 [THUNK_0_1] = "THUNK_0_1",
1093 [THUNK_2_0] = "THUNK_2_0",
1094 [THUNK_1_1] = "THUNK_1_1",
1095 [THUNK_0_2] = "THUNK_0_2",
1096 [THUNK_STATIC] = "THUNK_STATIC",
1097 [THUNK_SELECTOR] = "THUNK_SELECTOR",
1101 [AP_STACK] = "AP_STACK",
1103 [IND_PERM] = "IND_PERM",
1104 [IND_STATIC] = "IND_STATIC",
1105 [RET_BCO] = "RET_BCO",
1106 [RET_SMALL] = "RET_SMALL",
1107 [RET_BIG] = "RET_BIG",
1108 [RET_DYN] = "RET_DYN",
1109 [RET_FUN] = "RET_FUN",
1110 [UPDATE_FRAME] = "UPDATE_FRAME",
1111 [CATCH_FRAME] = "CATCH_FRAME",
1112 [UNDERFLOW_FRAME] = "UNDERFLOW_FRAME",
1113 [STOP_FRAME] = "STOP_FRAME",
1114 [BLACKHOLE] = "BLACKHOLE",
1115 [BLOCKING_QUEUE] = "BLOCKING_QUEUE",
1116 [MVAR_CLEAN] = "MVAR_CLEAN",
1117 [MVAR_DIRTY] = "MVAR_DIRTY",
1118 [ARR_WORDS] = "ARR_WORDS",
1119 [MUT_ARR_PTRS_CLEAN] = "MUT_ARR_PTRS_CLEAN",
1120 [MUT_ARR_PTRS_DIRTY] = "MUT_ARR_PTRS_DIRTY",
1121 [MUT_ARR_PTRS_FROZEN0] = "MUT_ARR_PTRS_FROZEN0",
1122 [MUT_ARR_PTRS_FROZEN] = "MUT_ARR_PTRS_FROZEN",
1123 [MUT_VAR_CLEAN] = "MUT_VAR_CLEAN",
1124 [MUT_VAR_DIRTY] = "MUT_VAR_DIRTY",
1127 [MUT_PRIM] = "MUT_PRIM",
1130 [TREC_CHUNK] = "TREC_CHUNK",
1131 [ATOMICALLY_FRAME] = "ATOMICALLY_FRAME",
1132 [CATCH_RETRY_FRAME] = "CATCH_RETRY_FRAME",
1133 [CATCH_STM_FRAME] = "CATCH_STM_FRAME",
1134 [WHITEHOLE] = "WHITEHOLE"
1138 info_type(StgClosure *closure){
1139 return closure_type_names[get_itbl(closure)->type];
1143 info_type_by_ip(StgInfoTable *ip){
1144 return closure_type_names[ip->type];
1148 info_hdr_type(StgClosure *closure, char *res){
1149 strcpy(res,closure_type_names[get_itbl(closure)->type]);