diff options
author | Arash Rouhani <rarash@student.chalmers.se> | 2013-12-26 14:57:35 +0100 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-01-15 10:36:59 -0600 |
commit | d1712dbd2b4c5d23a60d8a369e17045a397bf4f5 (patch) | |
tree | 26b6b65da729b6e941a59f5f90222cfbb501e40f /rts/Printer.c | |
parent | 778b48afc36e2b0eb44387e2a36947ac0c6ddd95 (diff) | |
download | haskell-d1712dbd2b4c5d23a60d8a369e17045a397bf4f5.tar.gz |
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: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'rts/Printer.c')
-rw-r--r-- | rts/Printer.c | 20 |
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 ) { |