In the DEBUG rts, track when CAFs are GC'd
authorSimon Marlow <marlowsd@gmail.com>
Thu, 21 Nov 2013 11:28:13 +0000 (11:28 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 21 Nov 2013 13:27:34 +0000 (13:27 +0000)
commite82fa82933e6984c5b9507a0d857b0c579bd0f46
treec2fc68c44afdf36bb84014a511807567f42fdec3
parentef89860cb51f4d456caf924f9f9075b2b95ccc52
In the DEBUG rts, track when CAFs are GC'd

This resurrects some old code and makes it work again.  The idea is
that we want to get an error message if we ever enter a CAF that has
been GC'd, rather than following its indirection which will likely
cause a segfault.  Without this patch, these bugs are hard to track
down in gdb, because the IND_STATIC code overwrites R1 (the pointer to
the CAF) with its indirectee before jumping into bad memory, so we've
lost the address of the CAF that got GC'd.

Some associated refactoring while I was here.
includes/rts/storage/GC.h
includes/stg/MiscClosures.h
rts/StgMiscClosures.cmm
rts/sm/GC.c
rts/sm/GCAux.c
rts/sm/Storage.c
rts/sm/Storage.h