diff options
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Printer.c | 20 | ||||
-rw-r--r-- | rts/Printer.h | 1 |
2 files changed, 20 insertions, 1 deletions
diff --git a/rts/Printer.c b/rts/Printer.c index db2e7be8c8..ca9ca496b5 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -263,7 +263,7 @@ printClosure( StgClosure *obj ) case UPDATE_FRAME: { StgUpdateFrame* u = (StgUpdateFrame*)obj; - debugBelch("UPDATE_FRAME("); + debugBelch("%s(", info_update_frame(obj)); printPtr((StgPtr)GET_INFO((StgClosure *)u)); debugBelch(","); printPtr((StgPtr)u->updatee); @@ -389,6 +389,24 @@ printClosure( StgClosure *obj ) } } +// If you know you have an UPDATE_FRAME, but want to know exactly which. +char *info_update_frame(StgClosure *closure) { + // Note: We intentionally don't take the info table pointer as + // an argument. As it will be confusing whether one should pass + // it pointing to the code or struct members when compiling with + // TABLES_NEXT_TO_CODE. + const StgInfoTable *info = closure->header.info; + if (info == &stg_upd_frame_info) { + return "NORMAL_UPDATE_FRAME"; + } else if (info == &stg_bh_upd_frame_info) { + return "BH_UPDATE_FRAME"; + } else if (info == &stg_marked_upd_frame_info) { + return "MARKED_UPDATE_FRAME"; + } else { + return "ERROR: Not an update frame!!!"; + } +} + /* void printGraph( StgClosure *obj ) { diff --git a/rts/Printer.h b/rts/Printer.h index 7b51ce55b5..0dae896414 100644 --- a/rts/Printer.h +++ b/rts/Printer.h @@ -19,6 +19,7 @@ extern char * closure_type_names[]; void info_hdr_type ( StgClosure *closure, char *res ); char * info_type ( StgClosure *closure ); char * info_type_by_ip ( StgInfoTable *ip ); +char * info_update_frame ( StgClosure *closure ); #ifdef DEBUG extern void prettyPrintClosure (StgClosure *obj); |