diff -r 18aeca3a1bac -r 883f79e7b2a6 Context.st --- a/Context.st Tue Mar 14 20:37:04 2017 +0100 +++ b/Context.st Wed Mar 15 14:22:07 2017 +0100 @@ -1749,6 +1749,12 @@ ! displayArgsOn:aStream + self displayArgsOn:aStream withCRs:false indent:0 + + "Modified: / 15-03-2017 / 14:13:38 / cg" +! + +displayArgsOn:aStream withCRs:withCRs indent:i | n "{ Class: SmallInteger }" s | @@ -1761,11 +1767,40 @@ s := s contractTo:100. ]. + aStream spaces:i. aStream nextPutAll:s asString string. - index ~~ n ifTrue:[ aStream space ]. + withCRs ifTrue:[ + aStream cr. + ] ifFalse:[ + index ~~ n ifTrue:[ aStream space ]. + ]. ]. - "Modified: / 07-03-2012 / 13:09:17 / cg" + "Created: / 15-03-2017 / 14:13:33 / cg" +! + +displayLocalsOn:aStream withCRs:withCRs indent:i + | n "{ Class: SmallInteger }" + s | + + n := self argumentCount. + n+1 to:self size do:[:index | + Error handle:[:ex | + s := '*Error in localString*'. + ] do:[ + s := self argStringFor:(self at:index). + s := s contractTo:100. + ]. + aStream spaces:i. + aStream nextPutAll:s asString string. + withCRs ifTrue:[ + aStream cr + ] ifFalse:[ + index ~~ n ifTrue:[ aStream space ]. + ]. + ]. + + "Created: / 15-03-2017 / 14:13:23 / cg" ! displayOn:aGCOrStream @@ -1789,13 +1824,14 @@ fullPrintAllOn:aStream "print a full walkback (incl arguments) starting at the receiver" - self withAllSendersDo:[:con | con fullPrintOn:aStream. aStream cr]. + self fullPrintAllOn:aStream withVariables:false " thisContext fullPrintAllOn:Transcript " - "Created: 15.1.1997 / 18:09:05 / cg" + "Created: / 15-01-1997 / 18:09:05 / cg" + "Modified: / 15-03-2017 / 14:16:12 / cg" ! fullPrintAllOn:aStream throughContextForWhich:aBlock @@ -1822,6 +1858,18 @@ " ! +fullPrintAllOn:aStream withVariables:withVariables + "print a full walkback (incl arguments) starting at the receiver" + + self withAllSendersDo:[:con | con fullPrintOn:aStream withVariables:withVariables. aStream cr]. + + " + thisContext fullPrintAllOn:Transcript withVariables:true + " + + "Created: / 15-03-2017 / 14:14:41 / cg" +! + fullPrintAllString "return a string containing the full walkback (incl. arguments)" @@ -1841,14 +1889,30 @@ fullPrintOn:aStream "append a verbose description (incl. arguments) of the receiver onto aStream" + self fullPrintOn:aStream withVariables:false + + " + thisContext fullPrintOn:Transcript + thisContext sender fullPrintOn:Transcript + " + + "Created: / 15-01-1997 / 18:09:06 / cg" + "Modified (comment): / 15-03-2017 / 14:08:51 / cg" +! + +fullPrintOn:aStream withVariables:withVariables + "append a verbose description (incl. arguments) of the receiver onto aStream" + self printReceiverOn:aStream. aStream nextPutAll:' >> '. self selector printOn:aStream. "show as string (as symbol looks too ugly in browser ...)" "/ self selector storeOn:aStream. "show as symbol" - self size ~~ 0 ifTrue: [ - aStream space. - self displayArgsOn:aStream + withVariables ifFalse:[ + self size ~~ 0 ifTrue: [ + aStream space. + self displayArgsOn:aStream + ]. ]. aStream nextPutAll:' {'. self identityHash printOn:aStream. @@ -1858,12 +1922,24 @@ self lineNumber printOn:aStream. aStream nextPut:$]. - " - thisContext fullPrintOn:Transcript + withVariables ifTrue:[ + self size ~~ 0 ifTrue: [ + self argumentCount ~~ 0 ifTrue:[ + aStream cr; nextPutAll:' Args:'; cr. + self displayArgsOn:aStream withCRs:true indent:4. + ]. + self size > self argumentCount ifTrue:[ + aStream cr; nextPutAll:' Locals:'; cr. + self displayLocalsOn:aStream withCRs:true indent:4. + ]. + ]. + ]. + " - - "Modified: 20.5.1996 / 10:27:14 / cg" - "Created: 15.1.1997 / 18:09:06 / cg" + thisContext fullPrintOn:Transcript withVariables:true + " + + "Created: / 15-03-2017 / 13:24:16 / cg" ! fullPrintString