Commit d1712dbd authored by Arash Rouhani's avatar Arash Rouhani Committed by Austin Seipp

In rts/Printer.c, print exact UPDATE_FRAME type

When printing an update frame in printClosure(), it will not print
the unspecific UPDATE_FRAME, instead it prints BH_UPDATE_FRAME,
NORMAL_UPDATE_FRAME or MARKED_UPDATE_FRAME.
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 778b48af
......@@ -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 )
{
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment