[commit: ghc] wip/nonmoving-gc: rts/Printer: Print forwarding pointers (ad8da70)

git at git.haskell.org git at git.haskell.org
Wed Feb 6 14:09:34 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nonmoving-gc
Link       : http://ghc.haskell.org/trac/ghc/changeset/ad8da7093ab48089b2509cd87319940ffcfa08ab/ghc

>---------------------------------------------------------------

commit ad8da7093ab48089b2509cd87319940ffcfa08ab
Author: Ömer Sinan Ağacan <omer at well-typed.com>
Date:   Tue Feb 5 00:39:03 2019 -0500

    rts/Printer: Print forwarding pointers


>---------------------------------------------------------------

ad8da7093ab48089b2509cd87319940ffcfa08ab
 rts/Printer.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/rts/Printer.c b/rts/Printer.c
index 2f93ba8..e9659ac 100644
--- a/rts/Printer.c
+++ b/rts/Printer.c
@@ -111,10 +111,15 @@ printThunkObject( StgThunk *obj, char* tag )
 void
 printClosure( const StgClosure *obj )
 {
-    const StgInfoTable *info;
-
+    debugBelch("%p: ", obj);
     obj = UNTAG_CONST_CLOSURE(obj);
-    info = get_itbl(obj);
+    const StgInfoTable* info = get_itbl(obj);
+
+    while (IS_FORWARDING_PTR(info)) {
+        obj = (StgClosure*)UN_FORWARDING_PTR(obj);
+        debugBelch("(forwarding to %p) ", (void*)obj);
+        info = get_itbl(obj);
+    }
 
     switch ( info->type ) {
     case INVALID_OBJECT:



More information about the ghc-commits mailing list