DebugView.st
changeset 9314 e58b9abd145a
parent 9308 0222c2bba7d5
child 9337 425ff4481f8b
equal deleted inserted replaced
9313:44795fcbf414 9314:e58b9abd145a
  2004     interval := pos to:pos.
  2004     interval := pos to:pos.
  2005 
  2005 
  2006     self 
  2006     self 
  2007         withNodeValueAtInterval:interval 
  2007         withNodeValueAtInterval:interval 
  2008         do:[:value :description |
  2008         do:[:value :description |
  2009             |valueClassString valueString|
  2009             |valueClassOrSizeString valueString|
  2010 
  2010 
  2011             valueClassString := valueString := ''.
  2011             valueClassOrSizeString := valueString := ''.
  2012 
  2012 
  2013             "/ some heuristics as when to show the class name (a purely subjective preference)
  2013             "/ some heuristics as when to show the class name (a purely subjective preference)
  2014             value isString ifTrue:[
  2014             value isString ifTrue:[
  2015                 value isText ifTrue:[
  2015                 value isText ifTrue:[
  2016                     valueString := '"',(value contractTo:80),'"'.
  2016                     valueString := '"',(value contractTo:80),'"'.
  2021                 (value isBoolean 
  2021                 (value isBoolean 
  2022                 or:[ value isInteger 
  2022                 or:[ value isInteger 
  2023                 or:[ value isSymbol ]]) ifTrue:[
  2023                 or:[ value isSymbol ]]) ifTrue:[
  2024                     valueString := value printString.
  2024                     valueString := value printString.
  2025                 ] ifFalse:[
  2025                 ] ifFalse:[
  2026                     valueClassString := ' (',value class name,')'.
  2026                     valueClassOrSizeString := ' (',value class name,')'.
       
  2027 
       
  2028                     (value isArray
       
  2029                     or:[ value isOrderedCollection ]) ifTrue:[
       
  2030                         valueClassOrSizeString := ' (size=',value size printString,')'.
       
  2031                     ].
       
  2032 
  2027                     Error handle:[:ex |
  2033                     Error handle:[:ex |
  2028                         valueString := '??? (',ex description,')'
  2034                         valueString := '??? (',ex description,')'
  2029                     ] do:[
  2035                     ] do:[
  2030                         [
  2036                         [
  2031                             valueString := value printString contractTo:80.
  2037                             valueString := value printString contractTo:80.
  2032                         ] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30.
  2038                         ] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30.
  2033                     ]
  2039                     ]
  2034                 ]
  2040                 ]
  2035             ].
  2041             ].
  2036             description isEmptyOrNil ifTrue:[
  2042             description isEmptyOrNil ifTrue:[
  2037                 s := valueString , valueClassString
  2043                 s := valueString , valueClassOrSizeString
  2038             ] ifFalse:[
  2044             ] ifFalse:[
  2039                 s := description , ': ', valueString, valueClassString
  2045                 s := description , ': ', valueString, valueClassOrSizeString
  2040             ].
  2046             ].
  2041         ].
  2047         ].
  2042     "/ Transcript showCR:s.
  2048     "/ Transcript showCR:s.
  2043     ^ s
  2049     ^ s
  2044 !
  2050 !
  4887 
  4893 
  4888 "/interval printCR.
  4894 "/interval printCR.
  4889     Error 
  4895     Error 
  4890         handle:[:ex | ] 
  4896         handle:[:ex | ] 
  4891         do:[ node := self findNodeForInterval:interval ].
  4897         do:[ node := self findNodeForInterval:interval ].
  4892 "/node printCR.
  4898 
  4893     node isNil ifTrue:[ ^ self ].
  4899     node isNil ifTrue:[ ^ self ].
  4894     node isVariable ifFalse:[ 
  4900     node isVariable ifFalse:[ 
  4895         "/ Transcript showCR:node.
  4901         "/ Transcript showCR:node.
  4896         ^ self 
  4902         ^ self 
  4897     ].
  4903     ].
  6840 ! !
  6846 ! !
  6841 
  6847 
  6842 !DebugView class methodsFor:'documentation'!
  6848 !DebugView class methodsFor:'documentation'!
  6843 
  6849 
  6844 version
  6850 version
  6845     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.493 2009-12-09 18:07:08 cg Exp $'
  6851     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.494 2009-12-11 15:12:15 cg Exp $'
  6846 !
  6852 !
  6847 
  6853 
  6848 version_CVS
  6854 version_CVS
  6849     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.493 2009-12-09 18:07:08 cg Exp $'
  6855     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.494 2009-12-11 15:12:15 cg Exp $'
  6850 ! !
  6856 ! !
  6851 
  6857 
  6852 DebugView initialize!
  6858 DebugView initialize!