MessageTracer.st
branchjv
changeset 3960 3343243e9f6e
parent 3945 a88ffaab8d67
parent 3956 8c01ea3b86fc
child 4101 89c4e9964f3a
--- a/MessageTracer.st	Fri Mar 04 15:45:32 2016 +0000
+++ b/MessageTracer.st	Mon Mar 21 06:42:17 2016 +0100
@@ -538,7 +538,7 @@
     "evaluate aBlock sending trace information to stdout.
      Return the value of the block."
 
-     ^ self trace:aBlock on:Stderr
+     ^ self trace:aBlock on:Processor activeProcess stderr
 
     "
      MessageTracer trace:[#(6 5 4 3 2 1) sort]
@@ -563,7 +563,7 @@
      Return the value of the block.
      The trace information is more detailed."
 
-     ^ self traceFull:aBlock on:Stderr
+     ^ self traceFull:aBlock on:Processor activeProcess stderr
 
     "
      MessageTracer traceFull:[#(6 5 4 3 2 1) sort]
@@ -589,7 +589,7 @@
      Return the value of the block.
      The trace information is more detailed."
 
-     ^ self traceFullIndented:aBlock on:Stderr
+     ^ self traceFullIndented:aBlock on:Processor activeProcess stderr
 
     "
      MessageTracer traceFullIndented:[ #(6 5 4 3 2 1) sort ]
@@ -614,7 +614,7 @@
     "evaluate aBlock sending trace information to stdout.
      Return the value of the block."
 
-     ^ self traceIndented:aBlock on:Stderr
+     ^ self traceIndented:aBlock on:Processor activeProcess stderr
 
     "
      MessageTracer traceIndented:[ #(6 5 4 3 2 1) sort ]
@@ -1686,7 +1686,7 @@
     "arrange for a trace message to be output on Stderr, when a message with aSelector is
      sent to instances of aClass (or subclass instances). Use untraceClass to remove this."
 
-    self traceClass:aClass selector:aSelector on:Stderr
+    self traceClass:aClass selector:aSelector on:Processor activeProcess stderr
 
     "
      MessageTracer traceClass:Integer selector:#factorial.
@@ -1730,7 +1730,7 @@
      when aMethod is executed. Traces both entry and exit.
      Use unwrapMethod to remove this."
 
-    ^ self traceMethod:aMethod on:Stderr
+    ^ self traceMethod:aMethod on:Processor activeProcess stderr
 
     "
      MessageTracer traceMethod:(Integer compiledMethodAt:#factorial).
@@ -1828,7 +1828,7 @@
      when aMethod is executed. Only entry is traced.
      Use unwrapMethod to remove this."
 
-    ^ self traceMethodEntry:aMethod on:Stderr
+    ^ self traceMethodEntry:aMethod on:Processor activeProcess stderr
 
     "
      MessageTracer traceMethodEntry:(Integer compiledMethodAt:#factorial).
@@ -1894,7 +1894,7 @@
      Only the sender is traced on entry.
      Use untraceMethod to remove this trace."
 
-    ^ self traceMethodFull:aMethod on:Stderr
+    ^ self traceMethodFull:aMethod on:Processor activeProcess stderr
 
     "Created: 15.12.1995 / 18:19:31 / cg"
     "Modified: 22.10.1996 / 17:39:28 / cg"
@@ -1920,7 +1920,7 @@
      Only the sender is traced on entry.
      Use untraceMethod to remove this trace."
 
-    ^ self traceMethodSender:aMethod on:Stderr
+    ^ self traceMethodSender:aMethod on:Processor activeProcess stderr
 !
 
 traceMethodSender:aMethod on:aStream
@@ -2692,7 +2692,7 @@
      Use untrap to remove this trace.
      The current implementation does not allow integers or nil to be traced."
 
-    self trace:anObject selector:aSelector on:Stderr
+    self trace:anObject selector:aSelector on:Processor activeProcess stderr
 
     "
      |p|
@@ -2758,7 +2758,7 @@
      Use untrap:/untrace: to remove this trace.
      The current implementation does not allow integers or nil to be traced."
 
-    self trace:anObject selectors:aCollectionOfSelectors on:Stderr
+    self trace:anObject selectors:aCollectionOfSelectors on:Processor activeProcess stderr
 
     "
      |p|
@@ -2841,7 +2841,7 @@
 traceAll:anObject
     "trace all messages which are understood by anObject"
 
-    self traceAll:anObject on:Stderr
+    self traceAll:anObject on:Processor activeProcess stderr
 
     "
      trace all (implemented) messages sent to Display
@@ -2859,7 +2859,7 @@
 traceAll:anObject from:aClass
     "trace all messages defined in aClass sent to anObject"
 
-    self traceAll:anObject from:aClass on:Stderr
+    self traceAll:anObject from:aClass on:Processor activeProcess stderr
 
     "
      trace all methods in Display, which are implemented
@@ -2924,7 +2924,7 @@
      The current implementation does not allow integers or nil to be traced."
 
     self
-	traceEntry:anObject selectors:aCollectionOfSelectors on:Stderr
+        traceEntry:anObject selectors:aCollectionOfSelectors on:Processor activeProcess stderr
 
     "
      |p|
@@ -2954,7 +2954,7 @@
      Use untrap to remove this trace.
      The current implementation does not allow integers or nil to be traced."
 
-    ^ self traceSender:anObject selector:aSelector on:Stderr
+    ^ self traceSender:anObject selector:aSelector on:Processor activeProcess stderr
 
     "
      |p|
@@ -3445,11 +3445,11 @@
 !
 
 printEntryFull:aContext
-    self printEntryFull:aContext level:0 on:Stderr
+    self printEntryFull:aContext level:0 on:Processor activeProcess stderr
 !
 
 printEntryFull:aContext level:lvl
-    self printEntryFull:aContext level:lvl on:Stderr
+    self printEntryFull:aContext level:lvl on:Processor activeProcess stderr
 !
 
 printEntryFull:aContext level:lvl on:aStream
@@ -3494,11 +3494,11 @@
 !
 
 printExit:aContext with:retVal
-    self printExit:aContext with:retVal level:0 on:Stderr
+    self printExit:aContext with:retVal level:0 on:Processor activeProcess stderr
 !
 
 printExit:aContext with:retVal level:lvl
-    self printExit:aContext with:retVal level:lvl on:Stderr
+    self printExit:aContext with:retVal level:lvl on:Processor activeProcess stderr
 !
 
 printExit:aContext with:retVal level:lvl on:aStream
@@ -3818,56 +3818,56 @@
     StepInterruptPending := nil.
     con := senderContext := thisContext sender.
     ignore := false.
-    outStream := output ? Stderr.
+    outStream := output notNil ifTrue:[output] ifFalse:[Processor activeProcess stderr].
 
     con receiver == Processor ifTrue:[
-	(sel := con selector) == #threadSwitch: ifTrue:[
-	    ignore := true.
-	].
-	sel == #timerInterrupt ifTrue:[
-	    ignore := true.
-	]
+        (sel := con selector) == #threadSwitch: ifTrue:[
+            ignore := true.
+        ].
+        sel == #timerInterrupt ifTrue:[
+            ignore := true.
+        ]
     ].
 
     con lineNumber == 1 ifFalse:[
-	ignore := true
+        ignore := true
     ].
 
     ignore ifFalse:[
-	con markForInterruptOnUnwind.
-
-	((r := con receiver) ~~ self
-	and:[r ~~ tracedBlock]) ifTrue:[
-	    traceDetail == #fullIndent ifTrue:[
-		[con notNil
-		and:[(r := con receiver) ~~ self
-		and:[r ~~ tracedBlock]]] whileTrue:[
-		    '  ' printOn:outStream.
-		    con := con sender.
-		].
-		con := senderContext.
-		self class printFull:con on:outStream withSender:false.
-	    ] ifFalse:[
-		traceDetail == #indent ifTrue:[
-		    [con notNil
-		    and:[(r := con receiver) ~~ self
-		    and:[r ~~ tracedBlock]]] whileTrue:[
-			'  ' printOn:outStream.
-			con := con sender.
-		    ].
-		    con := senderContext.
-		    con printOn:outStream.
-		    outStream cr.
-		] ifFalse:[
-		    traceDetail == true ifTrue:[
-			self class printFull:con on:outStream withSender:true.
-		    ] ifFalse:[
-			con printOn:outStream.
-			outStream cr.
-		    ]
-		]
-	    ].
-	].
+        con markForInterruptOnUnwind.
+
+        ((r := con receiver) ~~ self
+        and:[r ~~ tracedBlock]) ifTrue:[
+            traceDetail == #fullIndent ifTrue:[
+                [con notNil
+                and:[(r := con receiver) ~~ self
+                and:[r ~~ tracedBlock]]] whileTrue:[
+                    '  ' printOn:outStream.
+                    con := con sender.
+                ].
+                con := senderContext.
+                self class printFull:con on:outStream withSender:false.
+            ] ifFalse:[
+                traceDetail == #indent ifTrue:[
+                    [con notNil
+                    and:[(r := con receiver) ~~ self
+                    and:[r ~~ tracedBlock]]] whileTrue:[
+                        '  ' printOn:outStream.
+                        con := con sender.
+                    ].
+                    con := senderContext.
+                    con printOn:outStream.
+                    outStream cr.
+                ] ifFalse:[
+                    traceDetail == true ifTrue:[
+                        self class printFull:con on:outStream withSender:true.
+                    ] ifFalse:[
+                        con printOn:outStream.
+                        outStream cr.
+                    ]
+                ]
+            ].
+        ].
     ].
 
     ObjectMemory flushInlineCaches.