summaryrefslogtreecommitdiff
path: root/rts/Printer.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/Printer.c')
-rw-r--r--rts/Printer.c20
1 files changed, 19 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 )
{