Factor stack chunk printing out of printTSO
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Tue, 29 May 2018 07:36:16 +0000 (10:36 +0300)
committerÖmer Sinan Ağacan <omeragacan@gmail.com>
Tue, 29 May 2018 07:36:16 +0000 (10:36 +0300)
Makes it possible to print STACK (StgStack) objects easily in gdb

rts/Printer.c

index d184423..46a2076 100644 (file)
@@ -624,10 +624,14 @@ printStackChunk( StgPtr sp, StgPtr spBottom )
     }
 }
 
+static void printStack( StgStack *stack )
+{
+    printStackChunk( stack->sp, stack->stack + stack->stack_size );
+}
+
 void printTSO( StgTSO *tso )
 {
-    printStackChunk( tso->stackobj->sp,
-                     tso->stackobj->stack+tso->stackobj->stack_size);
+    printStack( tso->stackobj );
 }
 
 /* --------------------------------------------------------------------------