DebugView.st
branchjv
changeset 16571 cf319f2e56d0
parent 16445 6bc184e74f9c
parent 16535 71fe67678cae
child 16596 f111c3082dd1
equal deleted inserted replaced
16570:dc5e958a20dc 16571:cf319f2e56d0
  3722 setLabelFor:aMessage in:aProcess
  3722 setLabelFor:aMessage in:aProcess
  3723     |l lines processNameOrNil pidOrNil osPidString|
  3723     |l lines processNameOrNil pidOrNil osPidString|
  3724 
  3724 
  3725     lines := aMessage asStringCollection.
  3725     lines := aMessage asStringCollection.
  3726     lines size > 1 ifTrue:[
  3726     lines size > 1 ifTrue:[
  3727 	l := lines first
  3727         l := lines first
  3728     ] ifFalse:[
  3728     ] ifFalse:[
  3729 	l := aMessage.
  3729         l := aMessage.
  3730     ].
  3730     ].
  3731 
  3731 
  3732     l := l , ' ('.
  3732     l := l , ' ('.
  3733     Error handle:[:ex |
  3733     Error handle:[:ex |
  3734 	l := l , '???'
  3734         l := l , '???'
  3735     ] do:[
  3735     ] do:[
  3736 	processNameOrNil := aProcess name.
  3736         processNameOrNil := aProcess name.
  3737 	processNameOrNil notNil ifTrue:[
  3737         processNameOrNil notNil ifTrue:[
  3738 	    l := l , (processNameOrNil contractTo:20) , ''.
  3738             l := l , (processNameOrNil contractTo:20) , ''.
  3739 	].
  3739         ].
  3740 	pidOrNil := aProcess id printString.
  3740         pidOrNil := aProcess id printString.
  3741 	l := l , '[' , pidOrNil , ']'.
  3741         l := l , '[' , pidOrNil , ']'.
  3742     ].
  3742     ].
  3743     l := l , ')'.
  3743     l := l , ')'.
  3744     self label:l.
  3744     self label:l.
  3745 
  3745 
  3746     ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[
  3746     ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[
  3747 	osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'.
  3747         osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'.
  3748     ].
  3748     ].
  3749 
  3749 
  3750     exceptionInfoLabel notNil ifTrue:[
  3750     exceptionInfoLabel notNil ifTrue:[
  3751 	exceptionInfoLabel
  3751         exceptionInfoLabel
  3752 	    label:(resources
  3752             label:(resources
  3753 		    string:'%1 in process %2 [%3]%4'
  3753                     string:'%1 in process %2 [%3]%4'
  3754 		    with:(lines first colorizeAllWith:Color red)
  3754                     with:(lines first withColor:#red)
  3755 		    with:(processNameOrNil ? '')
  3755                     with:(processNameOrNil ? '')
  3756 		    with:(pidOrNil ? '')
  3756                     with:(pidOrNil ? '')
  3757 		    with:(osPidString ? ''))
  3757                     with:(osPidString ? ''))
  3758     ].
  3758     ].
  3759 
  3759 
  3760     "Modified: / 06-07-2006 / 12:43:19 / cg"
  3760     "Modified: / 06-07-2006 / 12:43:19 / cg"
  3761 ! !
  3761 ! !
  3762 
  3762 
  7379 
  7379 
  7380 !DebugView methodsFor:'private-context handling'!
  7380 !DebugView methodsFor:'private-context handling'!
  7381 
  7381 
  7382 contextListEntryFor:aContext
  7382 contextListEntryFor:aContext
  7383     ^ Error
  7383     ^ Error
  7384 	handle:[:ex | '???' ]
  7384         handle:[:ex | '???' ]
  7385 	do:[
  7385         do:[
  7386 	    |s|
  7386             |s|
  7387 
  7387 
  7388 	    aContext selector == #doIt ifTrue:[
  7388             aContext selector == #doIt ifTrue:[
  7389 		aContext receiver isNil ifTrue:[
  7389                 aContext receiver isNil ifTrue:[
  7390 		    s := 'doIt' allBold
  7390                     s := 'doIt' allBold
  7391 		]
  7391                 ]
  7392 	    ].
  7392             ].
  7393 
  7393 
  7394 	    s := Text streamContents:[:s | aContext printOn:s ].
  7394             s := Text streamContents:[:s | aContext printOn:s ].
  7395 	    RememberedCallChain notNil ifTrue:[
  7395             RememberedCallChain notNil ifTrue:[
  7396 		(RememberedCallChain includesIdentical:aContext) ifTrue:[
  7396                 (RememberedCallChain includesIdentical:aContext) ifTrue:[
  7397 		    s := s colorizeAllWith:(Color red).
  7397                     s := s withColor:#red.
  7398 		].
  7398                 ].
  7399 	    ].
  7399             ].
  7400 	    s
  7400             s
  7401 	].
  7401         ].
  7402 
  7402 
  7403     "Created: / 21-05-2007 / 13:30:24 / cg"
  7403     "Created: / 21-05-2007 / 13:30:24 / cg"
  7404 !
  7404 !
  7405 
  7405 
  7406 is:aHomeContext inCallingChainOf:aContext
  7406 is:aHomeContext inCallingChainOf:aContext
  9274                         ]
  9274                         ]
  9275                     ].
  9275                     ].
  9276 
  9276 
  9277 "/                code ~= (codeView contents) ifTrue:[
  9277 "/                code ~= (codeView contents) ifTrue:[
  9278                     cannotAcceptDueToOutdatedClass ifTrue:[
  9278                     cannotAcceptDueToOutdatedClass ifTrue:[
  9279                         codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' colorizeAllWith:Color red),Character cr,Character cr,code asString).
  9279                         codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' withColor:Color red),Character cr,Character cr,code asString).
  9280                     ] ifFalse:[
  9280                     ] ifFalse:[
  9281                         codeView setContents:code.
  9281                         codeView setContents:code.
  9282                     ].
  9282                     ].
  9283 "/                ].
  9283 "/                ].
  9284                 ].
  9284                 ].
  9438 
  9438 
  9439 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'!
  9439 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'!
  9440 
  9440 
  9441 printConditionOn:aStream
  9441 printConditionOn:aStream
  9442     ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[
  9442     ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[
  9443 	aStream nextPutAll:(' if called from %1 >> %2'
  9443         aStream nextPutAll:(' if called from %1  %2'
  9444 				bindWith:ignoredSendingClassAndSelectors first first
  9444                                 bindWith:ignoredSendingClassAndSelectors first first
  9445 				with:ignoredSendingClassAndSelectors first second).
  9445                                 with:ignoredSendingClassAndSelectors first second).
  9446 	^ self.
  9446         ^ self.
  9447     ].
  9447     ].
  9448     ignoredProcesses notEmptyOrNil ifTrue:[
  9448     ignoredProcesses notEmptyOrNil ifTrue:[
  9449 	aStream nextPutAll:(' in %1 processes (%2)'
  9449         aStream nextPutAll:(' in %1 processes (%2)'
  9450 				bindWith:ignoredProcesses size
  9450                                 bindWith:ignoredProcesses size
  9451 				with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  9451                                 with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  9452 	^ self.
  9452         ^ self.
  9453     ].
  9453     ].
  9454     ignoredReceiverClasses notNil ifTrue:[
  9454     ignoredReceiverClasses notNil ifTrue:[
  9455 	aStream nextPutAll:(' for %1 classes (%2)'
  9455         aStream nextPutAll:(' for %1 classes (%2)'
  9456 			    bindWith:ignoredReceiverClasses size
  9456                             bindWith:ignoredReceiverClasses size
  9457 			    with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  9457                             with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  9458 	^ self.
  9458         ^ self.
  9459     ].
  9459     ].
  9460     ignoreUntilShiftKeyPressed == true ifTrue:[
  9460     ignoreUntilShiftKeyPressed == true ifTrue:[
  9461 	aStream nextPutAll:' until shiftKey pressed'.
  9461         aStream nextPutAll:' until shiftKey pressed'.
  9462 	^ self.
  9462         ^ self.
  9463     ].
  9463     ].
  9464     ignoreEndTime notNil ifTrue:[
  9464     ignoreEndTime notNil ifTrue:[
  9465 	aStream nextPutAll:' until '.
  9465         aStream nextPutAll:' until '.
  9466 	ignoreEndTime printOn:aStream.
  9466         ignoreEndTime printOn:aStream.
  9467 	^ self.
  9467         ^ self.
  9468     ].
  9468     ].
  9469     (ignoreCount notNil) ifTrue:[
  9469     (ignoreCount notNil) ifTrue:[
  9470 	(ignoreCount > 0) ifTrue:[
  9470         (ignoreCount > 0) ifTrue:[
  9471 	    aStream nextPutAll:' for '.
  9471             aStream nextPutAll:' for '.
  9472 	    ignoreCount printOn:aStream.
  9472             ignoreCount printOn:aStream.
  9473 	    ^ self.
  9473             ^ self.
  9474 	].
  9474         ].
  9475 	(ignoreCount < 0) ifTrue:[
  9475         (ignoreCount < 0) ifTrue:[
  9476 	    aStream nextPutAll:' forEver'.
  9476             aStream nextPutAll:' forEver'.
  9477 	    ^ self.
  9477             ^ self.
  9478 	].
  9478         ].
  9479 	aStream nextPutAll:' no longer'.
  9479         aStream nextPutAll:' no longer'.
  9480     ].
  9480     ].
  9481 ! !
  9481 ! !
  9482 
  9482 
  9483 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'!
  9483 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'!
  9484 
  9484