[commit: ghc] master, wip/andrey/drop-symlink-traversal: rts/Printer: Print forwarding pointers (c19a401)

git at git.haskell.org git at git.haskell.org
Wed Mar 6 21:48:58 UTC 2019


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

On branches: master,wip/andrey/drop-symlink-traversal
Link       : http://ghc.haskell.org/trac/ghc/changeset/c19a401db45148873a7b6ba575384d2e77807647/ghc

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

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

    rts/Printer: Print forwarding pointers


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

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

diff --git a/rts/Printer.c b/rts/Printer.c
index 38335aa..f4d1111 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