Skip to content

Commit

Permalink
rts/Printer: add closure name entries for small arrays (Fixes #14513)
Browse files Browse the repository at this point in the history
Test Plan: ./validate

Reviewers: bgamari, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14513

Differential Revision: https://phabricator.haskell.org/D4226
  • Loading branch information
takano-akio authored and bgamari committed Nov 23, 2017
1 parent ad57e28 commit 5e35627
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions includes/rts/storage/ClosureTypes.h
Expand Up @@ -15,6 +15,7 @@
* If you add or delete any closure types, don't forget to update the following,
* - the closure flags table in rts/ClosureFlags.c
* - isRetainer in rts/RetainerProfile.c
* - the closure_type_names list in rts/Printer.c
*/

/* Object tag 0 raises an internal error */
Expand Down
11 changes: 10 additions & 1 deletion rts/Printer.c
Expand Up @@ -820,7 +820,8 @@ void printObj( StgClosure *obj )
/* -----------------------------------------------------------------------------
Closure types
NOTE: must be kept in sync with the closure types in includes/ClosureTypes.h
NOTE: must be kept in sync with the closure types in
includes/rts/storage/ClosureTypes.h
-------------------------------------------------------------------------- */

const char *closure_type_names[] = {
Expand Down Expand Up @@ -883,9 +884,17 @@ const char *closure_type_names[] = {
[CATCH_RETRY_FRAME] = "CATCH_RETRY_FRAME",
[CATCH_STM_FRAME] = "CATCH_STM_FRAME",
[WHITEHOLE] = "WHITEHOLE",
[SMALL_MUT_ARR_PTRS_CLEAN] = "SMALL_MUT_ARR_PTRS_CLEAN",
[SMALL_MUT_ARR_PTRS_DIRTY] = "SMALL_MUT_ARR_PTRS_DIRTY",
[SMALL_MUT_ARR_PTRS_FROZEN0] = "SMALL_MUT_ARR_PTRS_FROZEN0",
[SMALL_MUT_ARR_PTRS_FROZEN] = "SMALL_MUT_ARR_PTRS_FROZEN",
[COMPACT_NFDATA] = "COMPACT_NFDATA"
};

#if N_CLOSURE_TYPES != 64
#error Closure types changed: update Printer.c!
#endif

const char *
info_type(const StgClosure *closure){
return closure_type_names[get_itbl(closure)->type];
Expand Down

0 comments on commit 5e35627

Please sign in to comment.