DebugView.st
branchjv
changeset 15566 184cea584be5
parent 13750 0846f23cae65
parent 15497 c05f957c8150
child 15658 43b2d989bf0a
equal deleted inserted replaced
13752:25c2a13f00c5 15566:184cea584be5
     1 "
     1 "
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     3               All Rights Reserved
     3 	      All Rights Reserved
     4 
     4 
     5  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
     6  only in accordance with the terms of that license and with the
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libtool' }"
    12 "{ Package: 'stx:libtool' }"
    13 
    13 
       
    14 "{ NameSpace: Smalltalk }"
       
    15 
    14 StandardSystemView subclass:#DebugView
    16 StandardSystemView subclass:#DebugView
    15 	instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
    17 	instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
    16 		receiverInspector contextInspector contextArray selectedContext
    18 		receiverInspector contextInspector contextArray selectedContext
    17 		catchBlock grabber mayProceed traceView tracing bigStep
    19 		catchBlock grabber mayProceed traceView tracing bigStep
    18 		skipLineNr steppedContextAddress abortButton terminateButton
    20 		skipLineNr abortButton terminateButton continueButton stepButton
    19 		continueButton stepButton nextButton nextOverButton nextOutButton
    21 		nextButton nextOverButton nextOutButton sendButton returnButton
    20 		sendButton returnButton restartButton exclusive inspecting
    22 		restartButton exclusive inspecting nChainShown inspectedProcess
    21 		nChainShown inspectedProcess updateProcess stopButton
    23 		updateProcess updateButton defineButton monitorToggle stepping
    22 		updateButton defineButton monitorToggle stepping
    24 		steppedContextLineno actualContext inWrap stackInspector
    23 		steppedContextLineno stepForReturn actualContext inWrap
    25 		steppedContext wrapperContext firstContext stepHow cachable
    24 		stackInspector steppedContext wrapperContext verboseBacktrace
    26 		currentMethod ignoreBreakpoints stepUntilEntering
    25 		firstContext stepHow cachable currentMethod ignoreBreakpoints
    27 		lastStepUntilEntering lastSelectionInReceiverInspector
    26 		stepUntilEntering lastStepUntilEntering
    28 		lastSelectionInContextInspector canShowMore reportButton
    27 		lastSelectionInReceiverInspector lastSelectionInContextInspector
    29 		setOfHiddenCallingSelectors isStoppedAtHaltOrBreakPoint
    28 		canShowMore exitAbort reportButton setOfHiddenCallingSelectors
    30 		exceptionInfoLabel methodCodeToggle
    29 		isStoppedAtHaltOrBreakPoint exceptionInfoLabel methodCodeToggle
       
    30 		methodCodeToggleSelectionHolder
    31 		methodCodeToggleSelectionHolder
    31 		isStoppedAtBreakPointWithParameter breakPointParameter
    32 		isStoppedAtBreakPointWithParameter breakPointParameter
    32 		hideSupportCode contextInfoLabel resendButton
    33 		hideSupportCode contextInfoLabel resendButton
    33 		gotoDialogOpenerButton isStoppedInModalDialog selectorToDefine
    34 		gotoDialogOpenerButton isStoppedInModalDialog selectorToDefine
    34 		classToDefineIn'
    35 		classToDefineIn gotoApplicationActionMethodButton
       
    36 		isStoppedInApplicationAction isStoppedAtStatementBreakpoint
       
    37 		verboseBacktraceHolder'
    35 	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
    38 	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
    36 		DebuggingDebugger DebuggingDebugger2
    39 		DebuggingDebugger DebuggingDebugger2 DebuggingContextWalk
    37 		DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts
    40 		DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts
    38 		ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration
    41 		ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration
    39 		LastExtent LastOrigin RememberedCallChain DebuggingDebugger3
    42 		LastExtent LastOrigin RememberedCallChain DebuggingDebugger3
    40 		NumberOfDebuggers'
    43 		NumberOfDebuggers DebuggerOnMainDisplayOnly'
    41 	poolDictionaries:''
    44 	poolDictionaries:''
    42 	category:'Interface-Debugger'
    45 	category:'Interface-Debugger'
    43 !
    46 !
    44 
    47 
    45 Object subclass:#IgnoredHaltOrBreakpoint
    48 Object subclass:#IgnoredHaltOrBreakpoint
    46 	instanceVariableNames:'ignoreEndTime ignoreCount ignoreUntilShiftKeyPressed
    49 	instanceVariableNames:'ignoreEndTime ignoreCount ignoreUntilShiftKeyPressed
    47 		ignoredReceiverClasses ignoredProcesses'
    50 		ignoredReceiverClasses ignoredProcesses
       
    51 		ignoredSendingClassAndSelectors'
    48 	classVariableNames:''
    52 	classVariableNames:''
    49 	poolDictionaries:''
    53 	poolDictionaries:''
    50 	privateIn:DebugView
    54 	privateIn:DebugView
    51 !
    55 !
    52 
    56 
    67 !DebugView class methodsFor:'documentation'!
    71 !DebugView class methodsFor:'documentation'!
    68 
    72 
    69 copyright
    73 copyright
    70 "
    74 "
    71  COPYRIGHT (c) 1989 by Claus Gittinger
    75  COPYRIGHT (c) 1989 by Claus Gittinger
    72               All Rights Reserved
    76 	      All Rights Reserved
    73 
    77 
    74  This software is furnished under a license and may be used
    78  This software is furnished under a license and may be used
    75  only in accordance with the terms of that license and with the
    79  only in accordance with the terms of that license and with the
    76  inclusion of the above copyright notice.   This software may not
    80  inclusion of the above copyright notice.   This software may not
    77  be provided or otherwise made available to, or used by, any
    81  be provided or otherwise made available to, or used by, any
    86     The debugger usually sits on top of the faulting process,
    90     The debugger usually sits on top of the faulting process,
    87     taking over its event processing.
    91     taking over its event processing.
    88 
    92 
    89     (this is different from other Smalltalk debuggers, which control
    93     (this is different from other Smalltalk debuggers, which control
    90      the debuggee as a separate process. Consider this an historic
    94      the debuggee as a separate process. Consider this an historic
    91      leftover - the debugger was one of the first applications written for
    95      leftover - the debugger was one of the first applications written for ST/X.
    92      ST/X.
    96 
    93      The whole setup might be changed, once the required process primitives
    97      The whole setup might be changed, once the required process primitives
    94      are available, which allow control of another processes execution
    98      are available, which allow control of another processes execution
    95      (i.e. single-step, restart & return). The setup will be changed then,
    99      (i.e. single-step, restart & return). The setup will be changed then,
    96      to have the debugger control the debuggee (i.e. two processes)
   100      to have the debugger control the debuggee (i.e. two processes).
    97      however, why should we change it without a particular need...).
   101      However, as it works as it is, and is reliable enough,
       
   102      why should we change it without a particular need...).
    98 
   103 
    99     Only the 'stopped' debugged process is affected;
   104     Only the 'stopped' debugged process is affected;
   100     other processes continue to respond to events.
   105     other processes continue to respond to events.
   101     The one exception to this is when an error occurs within the dispatcher process
   106     The one exception to this is when an error occurs within the dispatcher process
   102     or in one of the eventhandler processes. In this case, the debugger
   107     or in one of the eventhandler processes. In this case, the debugger
   103     will sit on an exclusive display connection.
   108     will sit on an exclusive display connection.
   104 
   109 
   105     See additional information in 'doc/misc/debugger.doc'.
   110     See additional information in 'doc/misc/debugger.doc'.
   106 
   111 
   107     Notice & Warning:
   112     Notice & Warning (attention when changing thingslike menus, window spec etc. here):
   108         the DebugView class caches the last used debugger in a class variable. 
   113 	the DebugView class caches the last used debugger in a class variable,
   109         It may happen, that a malfunctioning debugger (for example, a halfway destroyed one) 
   114 	and hides/shows this window without recreating one from scratch. This is done to make
   110         is kept there. You will notice this, if a debugger comes up without showing any contents. 
   115 	the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint.
   111         In this case, close (or destroy) the broken debugView, and execute
   116 
   112             Debugger newDebugger
   117 	It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one)
   113         which removes the cached debugger and forces creation of a new one the next time. 
   118 	is kept there. You will notice this, if a debugger comes up without showing any contents.
   114         This is a temporary workaround - the debugger should be fixed to avoid this situation.
   119 	In this case, close (or destroy) the broken debugView, and execute
   115 
   120 	    Debugger newDebugger
   116         You must also flush the cached debugger, if you change the debugger's
   121 	which removes the cached debugger and forces creation of a new one the next time.
   117         initialization code (buttons, menu, etc.) or the debugger's class layout,
   122 	This is a temporary workaround - the debugger should be fixed to avoid this situation.
   118         and you want the new code to become effective.
   123 
       
   124 	You must also flush the cached debugger, if you change the debugger's
       
   125 	initialization code (buttons, menu, etc.) or the debugger's class layout,
       
   126 	and you want the new code to become effective.
   119 
   127 
   120     [author:]
   128     [author:]
   121         Claus Gittinger
   129 	Claus Gittinger
   122 
   130 
   123     [see also:]
   131     [see also:]
   124         Exception Signal
   132 	Exception Signal
   125         Process
   133 	Process
   126 "
   134 "
   127 ! !
   135 ! !
   128 
   136 
   129 !DebugView class methodsFor:'initialization'!
   137 !DebugView class methodsFor:'initialization'!
   130 
   138 
   171     CachedDebugger := nil.
   179     CachedDebugger := nil.
   172     CachedExclusive := nil.
   180     CachedExclusive := nil.
   173     OpenDebuggers := nil.
   181     OpenDebuggers := nil.
   174 
   182 
   175     (Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[
   183     (Debugger isBehavior and:[Debugger name = #DebugView]) ifTrue:[
   176         Debugger := self
   184 	Debugger := self
   177     ].
   185     ].
   178 
   186 
   179     "
   187     "
   180      DebugView newDebugger
   188      DebugView newDebugger
   181     "
   189     "
   182 ! !
   190 ! !
   183 
   191 
   184 !DebugView class methodsFor:'defaults'!
   192 !DebugView class methodsFor:'defaults'!
   185 
   193 
       
   194 debuggerOnMainDisplayOnly
       
   195     ^ DebuggerOnMainDisplayOnly ? true
       
   196 !
       
   197 
   186 defaultIcon
   198 defaultIcon
   187     "return the browsers default window icon"
   199     "return the browsers default window icon"
   188 
   200 
   189     <resource: #programImage>
   201     <resource: #programImage>
   190 
   202 
   238     "the information (if any) about the ignore-state of a halt"
   250     "the information (if any) about the ignore-state of a halt"
   239 
   251 
   240     IgnoredHalts isNil ifTrue:[^ nil].
   252     IgnoredHalts isNil ifTrue:[^ nil].
   241 
   253 
   242     IgnoredHalts do:[:ign |
   254     IgnoredHalts do:[:ign |
   243         (ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
   255 	(ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
   244         "/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod) 
   256 	"/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod)
   245         ifTrue:[
   257 	ifTrue:[
   246             ^ ign
   258 	    ^ ign
   247         ].
   259 	].
   248     ].
   260     ].
   249     ^ nil.
   261     ^ nil.
   250 !
   262 !
   251 
   263 
   252 hasIgnoredHalts
   264 hasIgnoredHalts
   253     self removeInactiveIgnores.
   265     self removeInactiveIgnores.
   254     ^ IgnoredHalts notEmptyOrNil
   266     ^ IgnoredHalts notEmptyOrNil
   255 !
   267 !
   256 
   268 
   257 ignoreBreakpointWithParameter:parameterOrNil forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey orReceiverClass:receiverClassOrNil orProcess:processOrNil
   269 ignoreBreakpointWithParameter:parameterOrNil
       
   270 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   271 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
   272 
   258     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   273     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   259      or until some time has elapsed.
   274      or until some time has elapsed.
   260      With nil count and time arguments, such an ignored breakpoint is reactivated"
   275      With nil count and time arguments, such an ignored breakpoint is reactivated"
   261 
   276 
   262     self 
   277     self
   263         ignoreHaltOrBreakpoint:#halt 
   278 	ignoreHaltOrBreakpoint:#halt
   264         method:nil line:nil  
   279 	method:nil line:nil
   265         parameter:parameterOrNil 
   280 	parameter:parameterOrNil
   266         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   281 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   267         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   282 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   268 !
   283 	orIfCalledFromMethod:nil
   269 
   284 !
   270 ignoreHaltIn:haltingMethod at:lineNrOfHalt forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey orReceiverClass:receiverClassOrNil orProcess:processOrNil
   285 
       
   286 ignoreHaltIn:haltingMethod at:lineNrOfHalt
       
   287 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   288 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
   289 
   271     "remember to ignore a halt in some method for some number of invocations
   290     "remember to ignore a halt in some method for some number of invocations
   272      or until some time has elapsed.
   291      or until some time has elapsed.
   273      With nil count and time arguments, such an ignored halt is reactivated"
   292      With nil count and time arguments, such an ignored halt is reactivated"
   274 
   293 
   275     self 
   294     self
   276         ignoreHaltOrBreakpoint:#halt 
   295 	ignoreHaltOrBreakpoint:#halt
   277         method:haltingMethod line:lineNrOfHalt  
   296 	method:haltingMethod line:lineNrOfHalt
   278         parameter:nil 
   297 	parameter:nil
   279         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   298 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   280         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   299 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   281 !
   300 	orIfCalledFromMethod:nil
   282 
   301 !
   283 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil 
   302 
   284         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   303 ignoreHaltIn:haltingMethod at:lineNrOfHalt
   285         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   304 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   305 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
   306 	orIfCalledFromMethod:ifCalledForMethodOrNil
       
   307 
       
   308     "remember to ignore a halt in some method for some number of invocations
       
   309      or until some time has elapsed.
       
   310      With nil count and time arguments, such an ignored halt is reactivated"
       
   311 
       
   312     self
       
   313 	ignoreHaltOrBreakpoint:#halt
       
   314 	method:haltingMethod line:lineNrOfHalt
       
   315 	parameter:nil
       
   316 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   317 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
   318 	orIfCalledFromMethod:ifCalledForMethodOrNil
       
   319 !
       
   320 
       
   321 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
       
   322 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   323 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   286 
   324 
   287     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   325     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   288      or until some time has elapsed.
   326      or until some time has elapsed.
   289      With nil count and time arguments, such an ignored breakpoint is reactivated"
   327      With nil count and time arguments, such an ignored breakpoint is reactivated"
   290 
   328 
       
   329     ^ self
       
   330 	ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
       
   331 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   332 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
   333 	orIfCalledFromMethod:nil
       
   334 !
       
   335 
       
   336 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
       
   337 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
       
   338 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
   339 	orIfCalledFromMethod:ifCalledFromMethodOrNil
       
   340 
       
   341     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
       
   342      or until some time has elapsed.
       
   343      With nil count and time arguments, such an ignored breakpoint is reactivated"
       
   344 
   291     |oldEntry ign|
   345     |oldEntry ign|
   292 
   346 
   293     IgnoredHalts notNil ifTrue:[
   347     IgnoredHalts notNil ifTrue:[
   294         self removeInactiveIgnores.
   348 	self removeInactiveIgnores.
   295         type == #halt ifTrue:[
   349 	type == #halt ifTrue:[
   296             oldEntry := IgnoredHalts
   350 	    oldEntry := IgnoredHalts
   297                             detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil]
   351 			    detect:[:ign | ign isForMethod:methodOrNil line:lineNrOfHaltOrNil]
   298                             ifNone:nil.
   352 			    ifNone:nil.
   299         ] ifFalse:[
   353 	] ifFalse:[
   300             oldEntry := IgnoredHalts
   354 	    oldEntry := IgnoredHalts
   301                             detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil]
   355 			    detect:[:ign | ign isForBreakpointWithParameter:parameterOrNil]
   302                             ifNone:nil.
   356 			    ifNone:nil.
   303         ].
   357 	].
   304         oldEntry notNil ifTrue:[
   358 	oldEntry notNil ifTrue:[
   305             (processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[
   359 	    (processOrNil notNil or:[receiverClassOrNil notNil]) ifTrue:[
   306                 receiverClassOrNil notNil ifTrue:[
   360 		receiverClassOrNil notNil ifTrue:[
   307                     oldEntry ignoreForReceiverClass:receiverClassOrNil.
   361 		    oldEntry ignoreForReceiverClass:receiverClassOrNil.
   308                 ].
   362 		].
   309                 processOrNil notNil ifTrue:[
   363 		processOrNil notNil ifTrue:[
   310                     oldEntry ignoreForProcess:processOrNil.
   364 		    oldEntry ignoreForProcess:processOrNil.
   311                 ].
   365 		].
   312                 ^ self.
   366 		^ self.
   313             ].
   367 	    ].
   314             IgnoredHalts remove:oldEntry ifAbsent:[].
   368 	    IgnoredHalts remove:oldEntry ifAbsent:[].
   315         ]
   369 	]
   316     ].
   370     ].
   317 
   371 
   318     (countOrNil notNil 
   372     (countOrNil notNil
   319       or:[dTOrNil notNil 
   373       or:[dTOrNil notNil
   320       or:[untilShiftKey == true
   374       or:[untilShiftKey == true
   321       or:[receiverClassOrNil notNil
   375       or:[receiverClassOrNil notNil
   322       or:[processOrNil notNil]]]]
   376       or:[processOrNil notNil
       
   377       or:[ifCalledFromMethodOrNil notNil]]]]]
   323     ) ifTrue:[
   378     ) ifTrue:[
   324         IgnoredHalts isNil ifTrue:[
   379 	IgnoredHalts isNil ifTrue:[
   325             IgnoredHalts := OrderedCollection new.
   380 	    IgnoredHalts := OrderedCollection new.
   326         ].
   381 	].
   327         type == #halt ifTrue:[
   382 	type == #halt ifTrue:[
   328             ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil.
   383 	    ign := IgnoredHalt new method:methodOrNil lineNumber:lineNrOfHaltOrNil.
   329         ] ifFalse:[
   384 	] ifFalse:[
   330             ign := IgnoredHalt new breakpointWithParameter:parameterOrNil.
   385 	    ign := IgnoredHalt new breakpointWithParameter:parameterOrNil.
   331         ].
   386 	].
   332 
   387 
   333         (countOrNil notNil and:[countOrNil > 0]) ifTrue:[
   388 	(countOrNil notNil and:[countOrNil > 0]) ifTrue:[
   334             ign ignoreCount:countOrNil.
   389 	    ign ignoreCount:countOrNil.
   335         ].
   390 	].
   336         (dTOrNil notNil) ifTrue:[
   391 	(dTOrNil notNil) ifTrue:[
   337             ign ignoreEndTime:(Timestamp now + dTOrNil).
   392 	    ign ignoreEndTime:(Timestamp now + dTOrNil).
   338         ].
   393 	].
   339         untilShiftKey == true ifTrue:[
   394 	untilShiftKey == true ifTrue:[
   340             ign ignoreUntilShiftKeyPressed:true.
   395 	    ign ignoreUntilShiftKeyPressed:true.
   341         ].
   396 	].
   342         receiverClassOrNil notNil ifTrue:[
   397 	receiverClassOrNil notNil ifTrue:[
   343             ign ignoreForReceiverClass:receiverClassOrNil.
   398 	    ign ignoreForReceiverClass:receiverClassOrNil.
   344         ].
   399 	].
   345         processOrNil notNil ifTrue:[
   400 	processOrNil notNil ifTrue:[
   346             ign ignoreForProcess:processOrNil.
   401 	    ign ignoreForProcess:processOrNil.
   347         ].
   402 	].
   348         IgnoredHalts add:ign.
   403 	ifCalledFromMethodOrNil notNil ifTrue:[
       
   404 	    ign ignoreIfCalledFromMethod:ifCalledFromMethodOrNil.
       
   405 	].
       
   406 	IgnoredHalts add:ign.
   349     ].
   407     ].
   350     Smalltalk changed:#ignoredHalts.
   408     Smalltalk changed:#ignoredHalts.
   351 
   409 
   352     "Created: / 06-03-2012 / 12:37:58 / cg"
   410     "Created: / 06-03-2012 / 12:37:58 / cg"
   353 !
   411 !
   357 
   415 
   358     IgnoredHalts isNil ifTrue:[^ false].
   416     IgnoredHalts isNil ifTrue:[^ false].
   359 
   417 
   360     "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString.
   418     "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString.
   361     IgnoredHalts do:[:ign |
   419     IgnoredHalts do:[:ign |
   362         (ign isForBreakpointWithParameter:parameter) ifTrue:[
   420 	(ign isForBreakpointWithParameter:parameter) ifTrue:[
   363             Transcript show:'Debugger [info]: break ignored for ', parameter.
   421 	    Transcript show:'Debugger [info]: break ignored for ', parameter.
   364 
   422 
   365             modifyCount ifTrue:[ ign decrementIgnoreCount ].
   423 	    modifyCount ifTrue:[ ign decrementIgnoreCount ].
   366             ign isHaltIgnored ifFalse:[
   424 	    ign isHaltIgnored ifFalse:[
   367                 Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter.
   425 		Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter.
   368                 IgnoredHalts remove:ign ifAbsent:[].
   426 		IgnoredHalts remove:ign ifAbsent:[].
   369             ].
   427 	    ].
   370             ^ true.
   428 	    ^ true.
   371         ].
   429 	].
   372     ].
   430     ].
   373 
   431 
   374     IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty.
   432     IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty.
   375 
   433 
   376     ^ false.
   434     ^ false.
   383 
   441 
   384     IgnoredHalts isNil ifTrue:[^ false].
   442     IgnoredHalts isNil ifTrue:[^ false].
   385 
   443 
   386     "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString.
   444     "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString.
   387     IgnoredHalts do:[:ign |
   445     IgnoredHalts do:[:ign |
   388         (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[
   446 	(ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod context:aContext) ifTrue:[
   389             Transcript show:'Debugger [info]: halt/break ignored in ', haltingMethod whoString.
   447 	    Transcript show:'Debugger [info]: halt/break ignored in ', haltingMethod whoString.
   390             Transcript show:' ('; show:ign; showCR:')'.
   448 	    Transcript show:' ('; show:ign; showCR:')'.
   391 
   449 
   392             modifyCount ifTrue:[ ign decrementIgnoreCount ].
   450 	    modifyCount ifTrue:[ ign decrementIgnoreCount ].
   393             ign isHaltIgnored ifFalse:[
   451 	    ign isHaltIgnored ifFalse:[
   394                 Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString.
   452 		Transcript showCR:'Debugger [info]: no longer ignore halt in ', haltingMethod whoString.
   395                 IgnoredHalts remove:ign ifAbsent:[].
   453 		IgnoredHalts remove:ign ifAbsent:[].
   396             ].
   454 	    ].
   397             ^ true.
   455 	    ^ true.
   398         ].
   456 	].
   399     ].
   457     ].
   400 
   458 
   401     IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty.
   459     IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not]) asNilIfEmpty.
   402 
   460 
   403     ^ false.
   461     ^ false.
   405     "Modified (comment): / 06-03-2012 / 12:51:43 / cg"
   463     "Modified (comment): / 06-03-2012 / 12:51:43 / cg"
   406 !
   464 !
   407 
   465 
   408 removeInactiveIgnores
   466 removeInactiveIgnores
   409     IgnoredHalts notNil ifTrue:[
   467     IgnoredHalts notNil ifTrue:[
   410         IgnoredHalts := IgnoredHalts select:[:i | i isActive].
   468 	IgnoredHalts := IgnoredHalts select:[:i | i isActive].
   411     ].
   469     ].
   412 !
   470 !
   413 
   471 
   414 stopIgnoringHalts
   472 stopIgnoringHalts
   415     "forget about all ignored halts"
   473     "forget about all ignored halts"
   416 
   474 
   417     IgnoredHalts := nil.
   475     IgnoredHalts := nil.
   418     Smalltalk changed:#ignoredHalts.
   476     Smalltalk changed:#ignoredHalts.
       
   477 !
       
   478 
       
   479 stopIgnoringHaltsFor:haltingMethod atLineNr:lineNrInHaltingMethod
       
   480     "remove the information (if any) about the ignore-state of a halt;
       
   481      effectively reenables the breakpoint/halt"
       
   482 
       
   483     IgnoredHalts isNil ifTrue:[^ self].
       
   484 
       
   485     IgnoredHalts := IgnoredHalts reject:[:ign |
       
   486 	(ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
       
   487     ].
   419 ! !
   488 ! !
   420 
   489 
   421 !DebugView class methodsFor:'instance creation / entering'!
   490 !DebugView class methodsFor:'instance creation / entering'!
   422 
   491 
   423 enter
   492 enter
   424     "enter a debugger"
   493     "enter a debugger"
   425 
   494 
   426     <context: #return>
   495     <context: #return>
   427 
   496 
   428     ^ self
   497     ^ self
   429         enter:thisContext sender
   498 	enter:thisContext sender
   430         withMessage:'Debugger Entered'
   499 	withMessage:'Debugger Entered'
   431         mayProceed:true.
   500 	mayProceed:true.
   432 !
   501 !
   433 
   502 
   434 enter:aContext withMessage:aString
   503 enter:aContext withMessage:aString
   435     "enter a debugger"
   504     "enter a debugger"
   436 
   505 
   437     <context: #return>
   506     <context: #return>
   438 
   507 
   439     ^ self
   508     ^ self
   440         enter:aContext
   509 	enter:aContext
   441         withMessage:aString
   510 	withMessage:aString
   442         mayProceed:true
   511 	mayProceed:true
   443 !
   512 !
   444 
   513 
   445 enter:aContext withMessage:aString mayProceed:mayProceed
   514 enter:aContext withMessage:aString mayProceed:mayProceed
   446     "enter a debugger; if this is a recursive invocation, enter
   515     "enter a debugger; if this is a recursive invocation, enter
   447      a MiniDebugger instead.
   516      a MiniDebugger instead.
   448      This is the standard way of entering the debugger;
   517      This is the standard way of entering the debugger;
   449      sent from error- and halt messages."
   518      sent from error- and halt messages."
   450 
   519 
   451     <context: #return>
   520     <context: #return>
   452 
   521 
   453     |active|
   522     |display|
   454 
   523 
   455     (NumberOfDebuggers ? 0) > self maxNumberOfDebuggers ifTrue:[
   524     (NumberOfDebuggers ? 0) > self maxNumberOfDebuggers ifTrue:[
   456         NumberOfDebuggers := self allInstances count:[:d | d isOpen].
   525 	NumberOfDebuggers := self allInstances count:[:d | d isOpen].
   457         NumberOfDebuggers > self maxNumberOfDebuggers ifTrue:[
   526 	NumberOfDebuggers > self maxNumberOfDebuggers ifTrue:[
   458             MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true.
   527 	    MiniDebugger enter:aContext withMessage:'too many debuggers - looping?' mayProceed:true.
   459         ].
   528 	].
   460     ].
   529     ].
   461 
   530 
   462     DebuggingDebugger == true ifTrue:[
   531     DebuggingDebugger == true ifTrue:[
   463         '==> enter1: (' print. aContext print. ')' printCR.
   532 	'==> enter1: (' print. aContext print. ')' printCR.
   464     ].
   533     ].
   465 
   534 
   466     StepInterruptPending := nil.
   535     display := (self debuggerOnMainDisplayOnly)
   467     ControlInterrupt handle:[:ex |
   536 		ifTrue:[ Display ]
   468         'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR.
   537 		ifFalse:[ Screen current ].
   469         ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR.
   538 
   470         ex proceed
   539     Screen currentScreenQuerySignal answer:display
   471     ] do:[
   540     do:[
   472         "
   541 	StepInterruptPending := nil.
   473          well, it could be a stepping or sending debugger up there;
   542 	ControlInterrupt handle:[:ex |
   474          in this case, return to it. This happens, when a stepping process
   543 	    'DebugView [info]: breakpoint in debugger setup ignored [enter.]' infoPrintCR.
   475          runs into an error (for example, a halt). In this case, we want the
   544 	    ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR.
   476          stepping debugger to come up again instead of a new one.
   545 	    ex proceed
   477         "
   546 	] do:[
   478         OpenDebuggers notNil ifTrue:[
   547 	    |debugger|
   479             active := Processor activeProcess.
   548 
   480             OpenDebuggers do:[:aDebugger |
   549 	    "
   481                 |debuggersProcess|
   550 	     well, it could be a stepping or sending debugger up there;
   482 
   551 	     in this case, return to it. This happens, when a stepping process
   483                 (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[
   552 	     runs into an error (for example, a halt). In this case, we want the
   484                     debuggersProcess := aDebugger inspectedProcess.
   553 	     stepping debugger to come up again instead of a new one.
   485                     debuggersProcess == active ifTrue:[
   554 	    "
   486                         aDebugger device isOpen ifTrue:[
   555 	    (debugger := self openDebuggerForActiveProcess) notNil ifTrue:[
   487                             DebuggingDebugger == true ifTrue:[
   556 		debugger unstep.
   488                                 'reusing cached debugger' errorPrintCR.
   557 		debugger setLabelFor:aString in:Processor activeProcess.
   489                             ].
   558 		debugger mayProceed:mayProceed.
   490                             aDebugger unstep.
   559 		^ debugger enter:aContext select:nil.
   491                             aDebugger setLabelFor:aString in:active.
   560 	    ].
   492                             aDebugger mayProceed:mayProceed.
   561 	].
   493                             ^ aDebugger enter:aContext select:nil.
   562 	^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed
   494                         ]
   563     ].
   495                     ].
   564 
   496                     (debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[
   565     "Modified: / 06-11-2013 / 20:58:54 / cg"
   497                         aDebugger destroy.
       
   498                     ].
       
   499                 ]
       
   500             ]
       
   501         ].
       
   502     ].
       
   503     ^ self enterUnconditional:aContext withMessage:aString mayProceed:mayProceed
       
   504 
       
   505     "Modified: / 17-07-2012 / 19:08:18 / cg"
       
   506 !
   566 !
   507 
   567 
   508 enterException:ex
   568 enterException:ex
   509     "enter a debugger; if this is a recursive invocation, enter
   569     "enter a debugger; if this is a recursive invocation, enter
   510      a MiniDebugger instead.
   570      a MiniDebugger instead.
   511      This is the standard way of entering the debugger;
   571      This is the standard way of entering the debugger;
   512      sent from error- and halt messages."
   572      sent from error- and halt messages."
   513 
   573 
   514     ^ self
   574     ^ self
   515         enter:ex returnableSuspendedContext
   575 	enter:ex returnableSuspendedContext
   516         withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger)
   576 	withMessage:('[',ex originalSignal class name,']: ',ex descriptionForDebugger)
   517         mayProceed:(ex mayProceed).
   577 	mayProceed:(ex mayProceed).
   518 !
   578 !
   519 
   579 
   520 enterUnconditional:aContext withMessage:aString mayProceed:mayProceed
   580 enterUnconditional:aContext withMessage:aString mayProceed:mayProceed
   521     "enter a debugger - do not check for recursive invocation"
   581     "enter a debugger - do not check for recursive invocation"
   522 
   582 
   528     NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1.
   588     NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1.
   529 
   589 
   530     "/ ignore halts & breakpoints while setting up the debugger
   590     "/ ignore halts & breakpoints while setting up the debugger
   531     "/ to avoid recursive debugging ...
   591     "/ to avoid recursive debugging ...
   532     ControlInterrupt handle:[:ex |
   592     ControlInterrupt handle:[:ex |
   533         'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR.
   593 	'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR.
   534         ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR.
   594 	('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR.
   535         ex proceed
   595 	ex proceed
   536     ] do:[
   596     ] do:[
   537         aDebugger := self new.
   597 	aDebugger := self new.
   538     ].
   598     ].
   539 
   599 
   540     aDebugger isNil ifTrue:[
   600     aDebugger isNil ifTrue:[
   541         'DebugView [error]: cannot open debugger' errorPrintCR.
   601 	'DebugView [error]: cannot open debugger' errorPrintCR.
   542         'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR.
   602 	'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR.
   543         mayProceed ifTrue:[
   603 	mayProceed ifTrue:[
   544             (Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs
   604 	    (Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs
   545                    yesLabel:'Continue' noLabel:'Abort')
   605 		   yesLabel:'Continue' noLabel:'Abort')
   546             ifTrue:[
   606 	    ifTrue:[
   547                 ^ nil
   607 		^ nil
   548             ].
   608 	    ].
   549         ] ifFalse:[
   609 	] ifFalse:[
   550             self information:'Error caught.\\Press OK to abort the operation.' withCRs.
   610 	    self information:'Error caught.\\Press OK to abort the operation.' withCRs.
   551         ].
   611 	].
   552         AbortOperationRequest raise.
   612 	AbortOperationRequest raise.
   553         "not reached"
   613 	"not reached"
   554     ].
   614     ].
   555 
   615 
   556     aDebugger mayProceed:mayProceed.
   616     aDebugger mayProceed:mayProceed.
   557     aDebugger setLabelFor:aString in:Processor activeProcess.
   617     aDebugger setLabelFor:aString in:Processor activeProcess.
   558     aDebugger enter:aContext select:nil.
   618     aDebugger enter:aContext select:nil.
   559     ^ nil.
   619     ^ nil.
   560 
   620 
   561     "
   621     "
   562         nil halt
   622 	nil halt
   563     "
   623     "
   564 
   624 
   565     "Modified: / 18.11.2001 / 00:29:23 / cg"
   625     "Modified: / 18.11.2001 / 00:29:23 / cg"
   566 !
   626 !
   567 
   627 
   569     "enter a debugger"
   629     "enter a debugger"
   570 
   630 
   571     <context: #return>
   631     <context: #return>
   572 
   632 
   573     ^ self
   633     ^ self
   574         enter:(thisContext sender)
   634 	enter:(thisContext sender)
   575         withMessage:message
   635 	withMessage:message
   576         mayProceed:true.
   636 	mayProceed:true.
   577 !
   637 !
   578 
   638 
   579 new
   639 new
   580     "return a new DebugView.
   640     "return a new DebugView.
   581      - return a cached debugger if it already exists.
   641      - return a cached debugger if it already exists.
   582      Also, care for remote displays on which no debugger is wanted
   642      Also, care for remote displays on which no debugger is wanted
   583      (ask with mayOpenDebugger) - if so, open on the default screen."
   643      (ask with mayOpenDebugger) - if so, open on the default screen."
   584 
   644 
   585     |debugger currentScreen debuggerDevice|
   645     |debugger currentScreen debuggerScreen|
   586 
   646 
   587     currentScreen := Screen current.
   647     currentScreen := Screen current.
   588 
   648 
   589     currentScreen notNil ifTrue:[
   649     currentScreen notNil ifTrue:[
   590         (currentScreen suppressDebugger) ifTrue:[
   650 	(currentScreen suppressDebugger) ifTrue:[
   591             "/ no debuggers with that device - show an alertBox which aborts...
   651 	    "/ no debuggers with that device - show an alertBox which aborts...
   592             ^ nil.
   652 	    ^ nil.
   593         ].
   653 	].
   594         (currentScreen mayOpenDebugger) ifFalse:[
   654 	(currentScreen mayOpenDebugger) ifFalse:[
   595             "/ no debugger on that device - but on the main screen
   655 	    "/ no debugger on that device - but on the main screen
   596             currentScreen := Screen default.
   656 	    currentScreen := Display ? Screen default.
   597         ].
   657 	].
   598     ].
   658     ].
   599 
   659 
   600     "
   660     "
   601      need a blocking debugger if no processes or
   661      need a blocking debugger if no processes or
   602      or if its a timing/interrupt process
   662      or if its a timing/interrupt process
   603      (because otherwise we would not get any events here ...
   663      (because otherwise we would not get any events here ...
   604     "
   664     "
   605     Processor activeProcessIsSystemProcess ifTrue:[
   665     Processor activeProcessIsSystemProcess ifTrue:[
   606         ((debugger := CachedExclusive) isNil
   666 	((debugger := CachedExclusive) isNil
   607         or:[debugger device ~~ currentScreen
   667 	or:[debugger device ~~ currentScreen
   608         or:[currentScreen isNil
   668 	or:[currentScreen isNil
   609         or:[currentScreen isOpen not]]]) ifTrue:[
   669 	or:[currentScreen isOpen not]]]) ifTrue:[
   610             debugger := self newExclusive
   670 	    debugger := self newExclusive
   611         ].
   671 	].
   612         CachedExclusive := nil.
   672 	CachedExclusive := nil.
   613     ] ifFalse:[
   673     ] ifFalse:[
   614         CachedDebugger notNil ifTrue:[
   674 	CachedDebugger notNil ifTrue:[
   615             (CachedDebugger device ~~ currentScreen
   675 	    (CachedDebugger device ~~ currentScreen
   616             or:[currentScreen isNil
   676 	    or:[currentScreen isNil
   617             or:[currentScreen isOpen not
   677 	    or:[currentScreen isOpen not
   618             or:[CachedDebugger class ~~ self]]]) ifTrue:[
   678 	    or:[CachedDebugger class ~~ self]]]) ifTrue:[
   619                 CachedDebugger := nil
   679 		CachedDebugger := nil
   620             ]
   680 	    ]
   621         ].
   681 	].
   622 
   682 
   623         (debugger := CachedDebugger) notNil ifTrue:[
   683 	(debugger := CachedDebugger) notNil ifTrue:[
   624             CachedDebugger := nil.
   684 	    CachedDebugger := nil.
   625         ] ifFalse:[
   685 	] ifFalse:[
   626             debuggerDevice := currentScreen.
   686 	    debuggerScreen := currentScreen.
   627             debuggerDevice isNil ifTrue:[
   687 	    debuggerScreen isNil ifTrue:[
   628                 "/ use the default display
   688 		"/ use the default display
   629                 debuggerDevice := Screen default.
   689 		debuggerScreen := Screen default.
   630             ].
   690 	    ].
   631             (debuggerDevice isNil
   691 	    (debuggerScreen isNil
   632             or:[debuggerDevice isOpen not
   692 	    or:[debuggerScreen isOpen not
   633             "/ or:[debuggerDevice mayOpenDebugger not]
   693 	    "/ or:[debuggerDevice mayOpenDebugger not]
   634             ]) ifTrue:[
   694 	    ]) ifTrue:[
   635                 "/ no debugger
   695 		"/ no debugger
   636                 ^ nil.
   696 		^ nil.
   637             ].
   697 	    ].
   638 
   698 
   639             Screen currentScreenQuerySignal answer:debuggerDevice
   699 	    Screen currentScreenQuerySignal answer:debuggerScreen
   640             do:[
   700 	    do:[
   641                 debugger := super new.
   701 		debugger := super new.
   642             ].
   702 	    ].
   643             debugger label:'Debugger'.
   703 	    debugger label:'Debugger'.
   644             debugger icon:self defaultIcon.
   704 	    debugger icon:self defaultIcon.
   645         ]
   705 	]
   646     ].
   706     ].
   647     ^ debugger
   707     ^ debugger
   648 
   708 
   649     "Modified: 31.7.1997 / 21:20:27 / cg"
   709     "Modified: 31.7.1997 / 21:20:27 / cg"
   650 !
   710 !
   661     ^ debugger
   721     ^ debugger
   662 
   722 
   663     "Modified: 1.1.1970 / 23:27:06 / cg"
   723     "Modified: 1.1.1970 / 23:27:06 / cg"
   664 !
   724 !
   665 
   725 
       
   726 openDebuggerForActiveProcess
       
   727     "return an already open debugger for the active process, or nil, if there is none.
       
   728      Open debuggers exist when stepping only, as then, the debugger is left open until the step
       
   729      is reached, to avoid too much flickering and redrawing on the screen"
       
   730 
       
   731     |active|
       
   732 
       
   733     "
       
   734      well, it could be a stepping or sending debugger up there;
       
   735      in this case, return to it. This happens, when a stepping process
       
   736      runs into an error (for example, a halt). In this case, we want the
       
   737      stepping debugger to come up again instead of a new one.
       
   738     "
       
   739     OpenDebuggers notNil ifTrue:[
       
   740 	active := Processor activeProcess.
       
   741 	OpenDebuggers do:[:aDebugger |
       
   742 	    |debuggersProcess|
       
   743 
       
   744 	    (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[
       
   745 		debuggersProcess := aDebugger inspectedProcess.
       
   746 		debuggersProcess == active ifTrue:[
       
   747 		    aDebugger device isOpen ifTrue:[
       
   748 			DebuggingDebugger == true ifTrue:[
       
   749 			    'reusing cached debugger' errorPrintCR.
       
   750 			].
       
   751 			aDebugger unstep.
       
   752 			^ aDebugger.
       
   753 		    ]
       
   754 		].
       
   755 		(debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[
       
   756 		    aDebugger destroy.
       
   757 		].
       
   758 	    ]
       
   759 	]
       
   760     ].
       
   761     ^ nil
       
   762 
       
   763     "Created: / 06-11-2013 / 20:57:49 / cg"
       
   764 !
       
   765 
   666 openOn:aProcess
   766 openOn:aProcess
   667     "start a  debugger on aProcess
   767     "start a  debugger on aProcess
   668      (actually not more than a good-looking inspector)"
   768      (actually not more than a good-looking inspector)"
   669 
   769 
   670     |aDebugger label nm|
   770     |aDebugger label nm|
   671 
   771 
   672     aDebugger := super new.
   772     aDebugger := super new.
   673     aDebugger icon:self defaultIcon.
   773     aDebugger icon:self defaultIcon.
   674     aProcess notNil ifTrue:[
   774     aProcess notNil ifTrue:[
   675         nm := aProcess name.
   775 	nm := aProcess name.
   676         nm notNil ifTrue:[
   776 	nm notNil ifTrue:[
   677             nm := (nm contractTo:17) , '-' , aProcess id printString
   777 	    nm := (nm contractTo:17) , '-' , aProcess id printString
   678         ] ifFalse:[
   778 	] ifFalse:[
   679             nm := aProcess id printString
   779 	    nm := aProcess id printString
   680         ].
   780 	].
   681         label := 'Debugger [' , nm , ']'.
   781 	label := 'Debugger [' , nm , ']'.
   682     ] ifFalse:[
   782     ] ifFalse:[
   683         label := 'no process'
   783 	label := 'no process'
   684     ].
   784     ].
   685     aDebugger label:label iconLabel:'Debugger'.
   785     aDebugger label:label iconLabel:'Debugger'.
   686     aDebugger openOn:aProcess.
   786     aDebugger openOn:aProcess.
   687     ^ nil
   787     ^ nil
   688 
   788 
   704      (Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp
   804      (Menu new fromLiteralArrayEncoding:(DebugView breakPointMenuSpec)) startUp
   705     "
   805     "
   706 
   806 
   707     <resource: #menu>
   807     <resource: #menu>
   708 
   808 
   709     ^ 
   809     ^
   710      #(Menu
   810      #(Menu
   711         (
   811 	(
   712          (MenuItem
   812 	 (MenuItem
   713             enabled: canRemoveBreakpoint
   813 	    enabled: canRemoveBreakpoint
   714             label: 'Remove Breakpoint'
   814 	    label: 'Remove Breakpoint'
   715             itemValue: removeBreakpoint
   815 	    itemValue: removeBreakpoint
   716           )
   816 	  )
   717          (MenuItem
   817 	 (MenuItem
   718             label: 'Remove all Breakpoints'
   818 	    label: 'Remove all Breakpoints'
   719             itemValue: removeAllBreakpoints
   819 	    itemValue: removeAllBreakpoints
   720           )
   820 	  )
   721          (MenuItem
   821 	 (MenuItem
   722             label: '-'
   822 	    label: '-'
   723           )
   823 	  )
   724          (MenuItem
   824 	 (MenuItem
   725             label: 'Ignore this Halt/BreakPoint'
   825 	    label: 'Ignore this Halt/BreakPoint'
   726             submenu: 
   826 	    submenu:
   727            (Menu
   827 	   (Menu
   728               (
   828 	      (
   729                (MenuItem
   829 	       (MenuItem
   730                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   830 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   731                   label: 'Forever (Until Ignoring is Stopped)'
   831 		  label: 'Forever (Until Ignoring is Stopped)'
   732                   itemValue: ignoreHaltForever
   832 		  itemValue: ignoreHaltForever
   733                 )
   833 		)
   734                (MenuItem
   834 	       (MenuItem
   735                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   835 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   736                   label: 'For Some Time...'
   836 		  label: 'For Some Time...'
   737                   itemValue: openIgnoreHaltUntilTimeElapsedDialog
   837 		  itemValue: openIgnoreHaltUntilTimeElapsedDialog
   738                 )
   838 		)
   739                (MenuItem
   839 	       (MenuItem
   740                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   840 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   741                   label: 'For the Next N Times...'
   841 		  label: 'For the Next N Times...'
   742                   itemValue: openIgnoreHaltNTimesDialog
   842 		  itemValue: openIgnoreHaltNTimesDialog
   743                 )
   843 		)
   744                (MenuItem
   844 	       (MenuItem
   745                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   845 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   746                   label: 'Until Shift-Key is Pressed'
   846 		  label: 'Until Shift-Key is Pressed'
   747                   itemValue: ignoreHaltUntilShiftKeyIsPressed
   847 		  itemValue: ignoreHaltUntilShiftKeyIsPressed
   748                 )
   848 		)
   749                (MenuItem
   849 	       (MenuItem
   750                   label: '-'
   850 		  label: '-'
   751                 )
   851 		)
   752                (MenuItem
   852 	       (MenuItem
   753                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   853 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   754                   label: 'In Current Process'
   854 		  label: 'In Current Process'
   755                   itemValue: ignoreHaltForCurrentProcess
   855 		  itemValue: ignoreHaltForCurrentProcess
   756                 )
   856 		)
   757                (MenuItem
   857 	       (MenuItem
   758                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   858 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   759                   label: 'For this Receiver Class'
   859 		  label: 'For this Receiver Class'
   760                   itemValue: ignoreHaltForThisReceiverClass
   860 		  itemValue: ignoreHaltForThisReceiverClass
   761                 )
   861 		)
   762                )
   862 	       (MenuItem
   763               nil
   863 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   764               nil
   864 		  label: 'If Called from Any Of'
   765             )
   865 		  submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf
   766           )
   866 		)
   767          (MenuItem
   867 	       )
   768             enabled: isStoppedAtBreakPointWithParameter
   868 	      nil
   769             label: 'Ignore all BreakPoints with this Parameter'
   869 	      nil
   770             submenu: 
   870 	    )
   771            (Menu
   871 	  )
   772               (
   872 	 (MenuItem
   773                (MenuItem
   873 	    enabled: isStoppedAtBreakPointWithParameter
   774                   enabled: isStoppedAtBreakPointWithParameter
   874 	    label: 'Ignore all BreakPoints with this Parameter'
   775                   label: 'Forever (Reenable in BreakPoint-Browser)'
   875 	    submenu:
   776                   itemValue: ignoreBreakpointsWithThisParameterForever
   876 	   (Menu
   777                 )
   877 	      (
   778                (MenuItem
   878 	       (MenuItem
   779                   enabled: isStoppedAtBreakPointWithParameter
   879 		  enabled: isStoppedAtBreakPointWithParameter
   780                   label: 'For Some Time...'
   880 		  label: 'Forever (Reenable in BreakPoint-Browser)'
   781                   itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
   881 		  itemValue: ignoreBreakpointsWithThisParameterForever
   782                 )
   882 		)
   783                (MenuItem
   883 	       (MenuItem
   784                   enabled: isStoppedAtBreakPointWithParameter
   884 		  enabled: isStoppedAtBreakPointWithParameter
   785                   label: 'For the Next N Times...'
   885 		  label: 'For Some Time...'
   786                   itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog
   886 		  itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
   787                 )
   887 		)
   788                (MenuItem
   888 	       (MenuItem
   789                   enabled: isStoppedAtBreakPointWithParameter
   889 		  enabled: isStoppedAtBreakPointWithParameter
   790                   label: 'Until Shift-Key is Pressed'
   890 		  label: 'For the Next N Times...'
   791                   itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
   891 		  itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog
   792                 )
   892 		)
   793                )
   893 	       (MenuItem
   794               nil
   894 		  enabled: isStoppedAtBreakPointWithParameter
   795               nil
   895 		  label: 'Until Shift-Key is Pressed'
   796             )
   896 		  itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
   797           )
   897 		)
   798          (MenuItem
   898 	       (MenuItem
   799             label: 'Ignore all Halts/BreakPoints'
   899 		  label: '-'
   800             submenu: 
   900 		)
   801            (Menu
   901 	       (MenuItem
   802               (
   902 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   803                (MenuItem
   903 		  label: 'In Current Process'
   804                   label: 'Forever (Until Ignoring is Stopped)'
   904 		  itemValue: ignoreAllHaltsForCurrentProcess
   805                   itemValue: ignoreAllHaltsForever
   905 		)
   806                 )
   906 	       (MenuItem
   807                (MenuItem
   907 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   808                   label: 'For Some Time...'
   908 		  label: 'For this Receiver Class'
   809                   itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog
   909 		  itemValue: ignoreAllHaltsForThisReceiverClass
   810                 )
   910 		)
   811                (MenuItem
   911 	       (MenuItem
   812                   label: 'Until Shift-Key is Pressed'
   912 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   813                   itemValue: ignoreAllHaltsUntilShiftKeyIsPressed
   913 		  label: 'If Called from Any Of'
   814                 )
   914 		  submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf
   815                )
   915 		)
   816               nil
   916 	       )
   817               nil
   917 	      nil
   818             )
   918 	      nil
   819           )
   919 	    )
   820          (MenuItem
   920 	  )
   821             enabled: hasHaltsToIgnore
   921 	 (MenuItem
   822             label: 'Stop Ignoring'
   922 	    label: 'Ignore all Halts/BreakPoints'
   823             itemValue: stopIgnoringHalts
   923 	    submenu:
   824           )
   924 	   (Menu
   825          (MenuItem
   925 	      (
   826             label: '-'
   926 	       (MenuItem
   827           )
   927 		  label: 'Forever (Until Ignoring is Stopped)'
   828          (MenuItem
   928 		  itemValue: ignoreAllHaltsForever
   829             enabled: canAddBreakpoint
   929 		)
   830             label: 'Add Breakpoint'
   930 	       (MenuItem
   831             itemValue: addBreakpoint
   931 		  label: 'For Some Time...'
   832           )
   932 		  itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog
   833          (MenuItem
   933 		)
   834             label: 'Manage Breakpoints'
   934 	       (MenuItem
   835             itemValue: openBreakPointBrowser
   935 		  label: 'Until Shift-Key is Pressed'
   836           )
   936 		  itemValue: ignoreAllHaltsUntilShiftKeyIsPressed
   837          (MenuItem
   937 		)
   838             label: '-'
   938 	       )
   839           )
   939 	      nil
   840          (MenuItem
   940 	      nil
   841             label: 'Allow Halt in Debugger'
   941 	    )
   842             itemValue: allowBreakPointsInDebugger:
   942 	  )
   843             indication: allowBreakPointsInDebugger
   943 	 (MenuItem
   844           )
   944 	    enabled: hasHaltsToIgnore
   845          )
   945 	    label: 'Stop Ignoring'
   846         nil
   946 	    itemValue: stopIgnoringHalts
   847         nil
   947 	  )
       
   948 	 (MenuItem
       
   949 	    label: '-'
       
   950 	  )
       
   951 	 (MenuItem
       
   952 	    enabled: canAddBreakpoint
       
   953 	    label: 'Add Breakpoint'
       
   954 	    itemValue: addBreakpoint
       
   955 	  )
       
   956 	 (MenuItem
       
   957 	    label: 'Manage Breakpoints'
       
   958 	    itemValue: openBreakPointBrowser
       
   959 	  )
       
   960 	 (MenuItem
       
   961 	    label: '-'
       
   962 	  )
       
   963 	 (MenuItem
       
   964 	    label: 'Allow Halt in Debugger'
       
   965 	    itemValue: allowBreakPointsInDebugger:
       
   966 	    indication: allowBreakPointsInDebugger
       
   967 	  )
       
   968 	 )
       
   969 	nil
       
   970 	nil
   848       )
   971       )
   849 !
   972 !
   850 
   973 
   851 classMenuSpec
   974 classMenuSpec
   852     "This resource specification was automatically generated
   975     "This resource specification was automatically generated
   861      (Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp
   984      (Menu new fromLiteralArrayEncoding:(DebugView receiverMenuSpec)) startUp
   862     "
   985     "
   863 
   986 
   864     <resource: #menu>
   987     <resource: #menu>
   865 
   988 
   866     ^ 
   989     ^
   867      #(Menu
   990      #(Menu
   868         (
   991 	(
   869          (MenuItem
   992 	 (MenuItem
   870             enabled: canBrowseImplementingClass
   993 	    enabled: canBrowseImplementingClass
   871             label: 'Browse Implementing Class'
   994 	    label: 'Browse Implementing Class'
   872             itemValue: browseImplementingClass
   995 	    itemValue: browseImplementingClass
   873           )
   996 	  )
   874          (MenuItem
   997 	 (MenuItem
   875             enabled: canBrowseReceiversClass
   998 	    enabled: canBrowseReceiversClass
   876             label: 'Browse Receiver''s Class'
   999 	    label: 'Browse Receiver''s Class'
   877             itemValue: browseReceiversClass
  1000 	    itemValue: browseReceiversClass
   878           )
  1001 	  )
   879          (MenuItem
  1002 	 (MenuItem
   880             enabled: canBrowseProcessesApplication
  1003 	    enabled: canBrowseProcessesApplication
   881             label: 'Browse Application Class'
  1004 	    label: 'Browse Application Class'
   882             itemValue: browseProcessesApplication
  1005 	    itemValue: browseProcessesApplication
   883           )
  1006 	  )
   884          (MenuItem
  1007 	 (MenuItem
   885             label: '-'
  1008 	    label: '-'
   886           )
  1009 	  )
   887          (MenuItem
  1010 	 (MenuItem
   888             enabled: canBrowseClassHierarchy
  1011 	    enabled: canBrowseClassHierarchy
   889             label: 'Browse Receiver''s Class Hierarchy'
  1012 	    label: 'Browse Receiver''s Class Hierarchy'
   890             itemValue: browseClassHierarchy
  1013 	    itemValue: browseClassHierarchy
   891             isVisible: false
  1014 	    isVisible: false
   892           )
  1015 	  )
   893          (MenuItem
  1016 	 (MenuItem
   894             enabled: canBrowseFullClassProtocol
  1017 	    enabled: canBrowseFullClassProtocol
   895             label: 'Browse Receiver''s Full Protocol'
  1018 	    label: 'Browse Receiver''s Full Protocol'
   896             itemValue: browseFullClassProtocol
  1019 	    itemValue: browseFullClassProtocol
   897             isVisible: false
  1020 	    isVisible: false
   898           )
  1021 	  )
   899          (MenuItem
  1022 	 (MenuItem
   900             label: '-'
  1023 	    label: '-'
   901             isVisible: false
  1024 	    isVisible: false
   902           )
  1025 	  )
   903          (MenuItem
  1026 	 (MenuItem
   904             enabled: canInspectWidgetHierarchy
  1027 	    enabled: canInspectWidgetHierarchy
   905             label: 'Inspect Widget Hierarchy'
  1028 	    label: 'Inspect Widget Hierarchy'
   906             itemValue: inspectWidgetHierarchy
  1029 	    itemValue: inspectWidgetHierarchy
   907           )
  1030 	  )
   908          )
  1031 	 )
   909         nil
  1032 	nil
   910         nil
  1033 	nil
   911       )
  1034       )
   912 !
  1035 !
   913 
  1036 
   914 contextMenuSpec
  1037 contextMenuSpec
   915     "This resource specification was automatically generated
  1038     "This resource specification was automatically generated
   924      (Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp
  1047      (Menu new fromLiteralArrayEncoding:(DebugView contextMenuSpec)) startUp
   925     "
  1048     "
   926 
  1049 
   927     <resource: #menu>
  1050     <resource: #menu>
   928 
  1051 
   929     ^ 
  1052     ^
   930      #(Menu
  1053      #(Menu
   931         (
  1054 	(
   932          (MenuItem
  1055 	 (MenuItem
   933             enabled: canReturn
  1056 	    enabled: canReturn
   934             label: 'Return'
  1057 	    label: 'Return'
   935             itemValue: doReturn
  1058 	    itemValue: doReturn
   936           )
  1059 	  )
   937          (MenuItem
  1060 	 (MenuItem
   938             enabled: canRestart
  1061 	    enabled: canRestart
   939             label: 'Restart'
  1062 	    label: 'Restart'
   940             itemValue: doRestart
  1063 	    itemValue: doRestart
   941           )
  1064 	  )
   942          (MenuItem
  1065 	 (MenuItem
   943             label: '-'
  1066 	    label: '-'
   944           )
  1067 	  )
   945          (MenuItem
  1068 	 (MenuItem
   946             enabled: hasContextSelected
  1069 	    enabled: hasContextSelected
   947             label: 'Inspect'
  1070 	    label: 'Inspect'
   948             itemValue: inspectContext
  1071 	    itemValue: inspectContext
   949           )
  1072 	  )
   950          (MenuItem
  1073 	 (MenuItem
   951             label: 'Copy WalkBack Text'
  1074 	    label: 'Copy WalkBack Text'
   952             itemValue: copyWalkbackText
  1075 	    itemValue: copyWalkbackText
   953           )
  1076 	  )
   954          (MenuItem
  1077 	 (MenuItem
   955             label: 'Bookmark Method in SystemBrowser'
  1078 	    label: 'Inspect Method'
   956             itemValue: addBrowserBookmark
  1079 	    itemValue: inspectContextsMethod
   957           )
  1080 	  )
   958          (MenuItem
  1081 	 (MenuItem
   959             label: '-'
  1082 	    label: 'Bookmark Method in SystemBrowser'
   960           )
  1083 	    itemValue: addBrowserBookmark
   961          (MenuItem
  1084 	  )
   962             enabled: hasContextSelected
  1085 	 (MenuItem
   963             label: 'Find Context with String in Source...'
  1086 	    label: '-'
   964             itemValue: findContextWithStringInSource
  1087 	  )
   965           )
  1088 	 (MenuItem
   966          (MenuItem
  1089 	    enabled: hasBlockContextSelected
   967             enabled: hasContextSelected
  1090 	    label: 'Find Home Context in Caller Chain...'
   968             label: 'Find Context with Value in Variable...'
  1091 	    itemValue: findHomeContext
   969             itemValue: findContextWithValueInVariable
  1092 	  )
   970           )
  1093 	 (MenuItem
   971          (MenuItem
  1094 	    enabled: hasContextSelected
   972             enabled: hasContextSelected
  1095 	    label: 'Find Context with String in Source...'
   973             label: 'Find Next Exception Handler'
  1096 	    itemValue: findContextWithStringInSource
   974             itemValue: findNextExceptionHandlerContext
  1097 	  )
   975           )
  1098 	 (MenuItem
   976          (MenuItem
  1099 	    enabled: hasContextSelected
   977             enabled: hasContextSelected
  1100 	    label: 'Find Context with Value in Variable...'
   978             label: 'Find Handler For...'
  1101 	    itemValue: findContextWithValueInVariable
   979             itemValue: findHandlerFor
  1102 	  )
   980           )
  1103 	 (MenuItem
   981          (MenuItem
  1104 	    enabled: hasContextSelected
   982             label: 'Find Dialog Opener...'
  1105 	    label: 'Find Next Exception Handler'
   983             itemValue: doGotoDialogOpener
  1106 	    itemValue: findNextExceptionHandlerContext
   984           )
  1107 	  )
   985          (MenuItem
  1108 	 (MenuItem
   986             label: '-'
  1109 	    enabled: hasContextSelected
   987           )
  1110 	    label: 'Find Handler For...'
   988          (MenuItem
  1111 	    itemValue: findHandlerFor
   989             label: 'Remember Callchain && Highlight on Next Entry'
  1112 	  )
   990             itemValue: rememberCallchain
  1113 	 (MenuItem
   991           )
  1114 	    label: 'Find Dialog Opener...'
   992          (MenuItem
  1115 	    itemValue: doGotoDialogOpener
   993             label: 'Clear Remembered Callchain'
  1116 	  )
   994             itemValue: clearRememberedCallchain
  1117 	 (MenuItem
   995           )
  1118 	    label: 'Find Application Action Method...'
   996          )
  1119 	    itemValue: doGotoApplicationActionMethod
   997         nil
  1120 	  )
   998         nil
  1121 	 (MenuItem
       
  1122 	    label: '-'
       
  1123 	  )
       
  1124 	 (MenuItem
       
  1125 	    label: 'Remember Callchain && Highlight on Next Entry'
       
  1126 	    itemValue: rememberCallchain
       
  1127 	  )
       
  1128 	 (MenuItem
       
  1129 	    label: 'Clear Remembered Callchain'
       
  1130 	    itemValue: clearRememberedCallchain
       
  1131 	  )
       
  1132 	 )
       
  1133 	nil
       
  1134 	nil
   999       )
  1135       )
  1000 !
  1136 !
  1001 
  1137 
  1002 fileMenuSpec
  1138 fileMenuSpec
  1003     "This resource specification was automatically generated
  1139     "This resource specification was automatically generated
  1012      (Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp
  1148      (Menu new fromLiteralArrayEncoding:(DebugView fileMenuSpec)) startUp
  1013     "
  1149     "
  1014 
  1150 
  1015     <resource: #menu>
  1151     <resource: #menu>
  1016 
  1152 
  1017     ^ 
  1153     ^
  1018      #(Menu
  1154      #(Menu
  1019         (
  1155 	(
  1020          (MenuItem
  1156 	 (MenuItem
  1021             enabled: canSendEmail
  1157 	    enabled: canSendEmail
  1022             label: 'Report a Bug via eMail...'
  1158 	    label: 'Report a Bug via eMail...'
  1023             itemValue: doOpenReportMailApp
  1159 	    itemValue: doOpenReportMailApp
  1024           )
  1160 	  )
  1025          (MenuItem
  1161 	 (MenuItem
  1026             label: '-'
  1162 	    label: '-'
  1027           )
  1163 	  )
  1028          (MenuItem
  1164 	 (MenuItem
  1029             enabled: canCloseAllDebuggers
  1165 	    enabled: canCloseAllDebuggers
  1030             label: 'Close all Debuggers...'
  1166 	    label: 'Close all Debuggers...'
  1031             itemValue: closeAllDebuggers
  1167 	    itemValue: closeAllDebuggers
  1032             isVisible: isNotInspecting
  1168 	    isVisible: isNotInspecting
  1033           )
  1169 	  )
  1034          (MenuItem
  1170 	 (MenuItem
  1035             label: '-'
  1171 	    label: '-'
  1036           )
  1172 	  )
  1037          (MenuItem
  1173 	 (MenuItem
  1038             label: 'Exit'
  1174 	    label: 'Exit'
  1039             itemValue: closeRequest
  1175 	    itemValue: closeRequest
  1040             isVisible: isInspecting
  1176 	    isVisible: isInspecting
  1041           )
  1177 	  )
  1042          (MenuItem
  1178 	 (MenuItem
  1043             label: 'Close Debugger and Abort'
  1179 	    label: 'Close Debugger and Abort'
  1044             itemValue: closeRequest
  1180 	    itemValue: closeRequest
  1045             isVisible: isNotInspecting
  1181 	    isVisible: isNotInspecting
  1046           )
  1182 	  )
  1047          )
  1183 	 )
  1048         nil
  1184 	nil
  1049         nil
  1185 	nil
  1050       )
  1186       )
  1051 !
  1187 !
  1052 
  1188 
  1053 helpMenuSpec
  1189 helpMenuSpec
  1054     "This resource specification was automatically generated
  1190     "This resource specification was automatically generated
  1063      (Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp
  1199      (Menu new fromLiteralArrayEncoding:(DebugView helpMenuSpec)) startUp
  1064     "
  1200     "
  1065 
  1201 
  1066     <resource: #menu>
  1202     <resource: #menu>
  1067 
  1203 
  1068     ^ 
  1204     ^
  1069      #(Menu
  1205      #(Menu
  1070         (
  1206 	(
  1071          (MenuItem
  1207 	 (MenuItem
  1072             label: 'Debugger''s Documentation'
  1208 	    label: 'Debugger''s Documentation'
  1073             itemValue: openHTMLDocument:
  1209 	    itemValue: openHTMLDocument:
  1074             argument: 'tools/debugger/TOP.html'
  1210 	    argument: 'tools/debugger/TOP.html'
  1075           )
  1211 	  )
  1076          (MenuItem
  1212 	 (MenuItem
  1077             label: '-'
  1213 	    label: '-'
  1078           )
  1214 	  )
  1079          (MenuItem
  1215 	 (MenuItem
  1080             label: 'About DebugView...'
  1216 	    label: 'About DebugView...'
  1081             itemValue: openAboutThisApplication
  1217 	    itemValue: openAboutThisApplication
  1082           )
  1218 	  )
  1083          )
  1219 	 )
  1084         nil
  1220 	nil
  1085         nil
  1221 	nil
  1086       )
  1222       )
  1087 !
  1223 !
  1088 
  1224 
  1089 menuSpec
  1225 menuSpec
  1090     "This resource specification was automatically generated
  1226     "This resource specification was automatically generated
  1099      (Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp
  1235      (Menu new fromLiteralArrayEncoding:(DebugView menuSpec)) startUp
  1100     "
  1236     "
  1101 
  1237 
  1102     <resource: #menu>
  1238     <resource: #menu>
  1103 
  1239 
  1104     ^ 
  1240     ^
  1105      #(Menu
  1241      #(Menu
  1106         (
  1242 	(
  1107          (MenuItem
  1243 	 (MenuItem
  1108             label: 'File'
  1244 	    label: 'File'
  1109             submenuChannel: fileMenuSpec
  1245 	    submenuChannel: fileMenuSpec
  1110           )
  1246 	  )
  1111          (MenuItem
  1247 	 (MenuItem
  1112             label: 'View'
  1248 	    label: 'View'
  1113             submenuChannel: viewMenuSpec
  1249 	    submenuChannel: viewMenuSpec
  1114           )
  1250 	  )
  1115          (MenuItem
  1251 	 (MenuItem
  1116             label: 'Process'
  1252 	    label: 'Process'
  1117             submenuChannel: processMenuSpec
  1253 	    submenuChannel: processMenuSpec
  1118           )
  1254 	  )
  1119          (MenuItem
  1255 	 (MenuItem
  1120             label: 'Context'
  1256 	    label: 'Context'
  1121             submenuChannel: contextMenuSpec
  1257 	    submenuChannel: contextMenuSpec
  1122           )
  1258 	  )
  1123          (MenuItem
  1259 	 (MenuItem
  1124             label: 'Receiver'
  1260 	    label: 'Receiver'
  1125             submenuChannel: classMenuSpec
  1261 	    submenuChannel: classMenuSpec
  1126           )
  1262 	  )
  1127          (MenuItem
  1263 	 (MenuItem
  1128             label: 'Selector'
  1264 	    label: 'Selector'
  1129             submenuChannel: selectorMenuSpec
  1265 	    submenuChannel: selectorMenuSpec
  1130           )
  1266 	  )
  1131          (MenuItem
  1267 	 (MenuItem
  1132             label: 'Breakpoint'
  1268 	    label: 'Breakpoint'
  1133             submenuChannel: breakPointMenuSpec
  1269 	    submenuChannel: breakPointMenuSpec
  1134           )
  1270 	  )
  1135          (MenuItem
  1271 	 (MenuItem
  1136             label: 'Help'
  1272 	    label: 'MENU_Help'
  1137             startGroup: conditionalRight
  1273 	    startGroup: conditionalRight
  1138             submenuChannel: helpMenuSpec
  1274 	    submenuChannel: helpMenuSpec
  1139           )
  1275 	  )
  1140          )
  1276 	 )
  1141         nil
  1277 	nil
  1142         nil
  1278 	nil
  1143       )
  1279       )
  1144 !
  1280 !
  1145 
  1281 
  1146 processMenuSpec
  1282 processMenuSpec
  1147     "This resource specification was automatically generated
  1283     "This resource specification was automatically generated
  1156      (Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp
  1292      (Menu new fromLiteralArrayEncoding:(DebugView processMenuSpec)) startUp
  1157     "
  1293     "
  1158 
  1294 
  1159     <resource: #menu>
  1295     <resource: #menu>
  1160 
  1296 
  1161     ^ 
  1297     ^
  1162      #(Menu
  1298      #(Menu
  1163         (
  1299 	(
  1164          (MenuItem
  1300 	 (MenuItem
  1165             label: 'Continue'
  1301 	    label: 'Continue'
  1166             itemValue: doContinue
  1302 	    itemValue: doContinue
  1167           )
  1303 	  )
  1168          (MenuItem
  1304 	 (MenuItem
  1169             label: 'Next (Line-Step)'
  1305 	    label: 'Next (Line-Step)'
  1170             itemValue: doNext
  1306 	    itemValue: doNext
  1171           )
  1307 	  )
  1172          (MenuItem
  1308 	 (MenuItem
  1173             label: 'Step'
  1309 	    label: 'Step'
  1174             itemValue: doStep
  1310 	    itemValue: doStep
  1175           )
  1311 	  )
  1176          (MenuItem
  1312 	 (MenuItem
  1177             label: '-'
  1313 	    label: '-'
  1178           )
  1314 	  )
  1179          (MenuItem
  1315 	 (MenuItem
  1180             label: 'After 5 Seconds'
  1316 	    label: 'After 5 Seconds'
  1181             submenu: 
  1317 	    submenu:
  1182            (Menu
  1318 	   (Menu
  1183               (
  1319 	      (
  1184                (MenuItem
  1320 	       (MenuItem
  1185                   label: 'Continue'
  1321 		  label: 'Continue'
  1186                   itemValue: doContinueAfterDelay
  1322 		  itemValue: doContinueAfterDelay
  1187                 )
  1323 		)
  1188                (MenuItem
  1324 	       (MenuItem
  1189                   label: 'Next (Line-Step)'
  1325 		  label: 'Next (Line-Step)'
  1190                   itemValue: doNextAfterDelay
  1326 		  itemValue: doNextAfterDelay
  1191                 )
  1327 		)
  1192                (MenuItem
  1328 	       (MenuItem
  1193                   label: 'Step'
  1329 		  label: 'Step'
  1194                   itemValue: doStepAfterDelay
  1330 		  itemValue: doStepAfterDelay
  1195                 )
  1331 		)
  1196                )
  1332 	       )
  1197               nil
  1333 	      nil
  1198               nil
  1334 	      nil
  1199             )
  1335 	    )
  1200           )
  1336 	  )
  1201          (MenuItem
  1337 	 (MenuItem
  1202             label: '-'
  1338 	    label: '-'
  1203           )
  1339 	  )
  1204          (MenuItem
  1340 	 (MenuItem
  1205             label: 'Skip to Cursor Line'
  1341 	    label: 'Skip to Cursor Line'
  1206             itemValue: skip
  1342 	    itemValue: skip
  1207           )
  1343 	  )
  1208          (MenuItem
  1344 	 (MenuItem
  1209             label: 'Step Out (Skip until Return)'
  1345 	    label: 'Step Out (Skip until Return)'
  1210             itemValue: skipForReturn
  1346 	    itemValue: skipForReturn
  1211           )
  1347 	  )
  1212          (MenuItem
  1348 	 (MenuItem
  1213             label: 'Skip until Entering...'
  1349 	    label: 'Skip until Entering...'
  1214             itemValue: skipUntilEntering
  1350 	    itemValue: skipUntilEntering
  1215           )
  1351 	  )
  1216          (MenuItem
  1352 	 (MenuItem
  1217             label: '-'
  1353 	    label: '-'
  1218           )
  1354 	  )
  1219          (MenuItem
  1355 	 (MenuItem
  1220             label: 'Abort'
  1356 	    label: 'Abort'
  1221             itemValue: doAbort
  1357 	    itemValue: doAbort
  1222           )
  1358 	  )
  1223          (MenuItem
  1359 	 (MenuItem
  1224             enabled: abortAllIsHandled
  1360 	    enabled: abortAllIsHandled
  1225             label: 'Abort All'
  1361 	    label: 'Abort All'
  1226             itemValue: doAbortAll
  1362 	    itemValue: doAbortAll
  1227           )
  1363 	  )
  1228          (MenuItem
  1364 	 (MenuItem
  1229             label: '-'
  1365 	    label: '-'
  1230           )
  1366 	  )
  1231          (MenuItem
  1367 	 (MenuItem
  1232             label: 'Inspect'
  1368 	    label: 'Inspect'
  1233             itemValue: doInspectProcess
  1369 	    itemValue: doInspectProcess
  1234           )
  1370 	  )
  1235          (MenuItem
  1371 	 (MenuItem
  1236             label: 'Change Priority...'
  1372 	    label: 'Change Priority...'
  1237             itemValue: doChangeProcessPriority
  1373 	    itemValue: doChangeProcessPriority
  1238           )
  1374 	  )
  1239          (MenuItem
  1375 	 (MenuItem
  1240             label: '-'
  1376 	    label: '-'
  1241           )
  1377 	  )
  1242          (MenuItem
  1378 	 (MenuItem
  1243             label: 'Terminate'
  1379 	    label: 'Terminate'
  1244             itemValue: doTerminate
  1380 	    itemValue: doTerminate
  1245           )
  1381 	  )
  1246          (MenuItem
  1382 	 (MenuItem
  1247             label: 'Hard Terminate (Danger)'
  1383 	    label: 'Hard Terminate (Danger)'
  1248             itemValue: quickTerminate
  1384 	    itemValue: quickTerminate
  1249             isVisible: false
  1385 	    isVisible: false
  1250           )
  1386 	  )
  1251          )
  1387 	 )
  1252         nil
  1388 	nil
  1253         nil
  1389 	nil
  1254       )
  1390       )
  1255 !
  1391 !
  1256 
  1392 
  1257 selectorMenuSpec
  1393 selectorMenuSpec
  1258     "This resource specification was automatically generated
  1394     "This resource specification was automatically generated
  1267      (Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp
  1403      (Menu new fromLiteralArrayEncoding:(DebugView selectorMenuSpec)) startUp
  1268     "
  1404     "
  1269 
  1405 
  1270     <resource: #menu>
  1406     <resource: #menu>
  1271 
  1407 
  1272     ^ 
  1408     ^
  1273      #(Menu
  1409      #(Menu
  1274         (
  1410 	(
  1275          (MenuItem
  1411 	 (MenuItem
  1276             label: 'Browse Implementors...'
  1412 	    label: 'Browse Implementors...'
  1277             itemValue: browseImplementorsOf
  1413 	    itemValue: browseImplementorsOf
  1278           )
  1414 	  )
  1279          (MenuItem
  1415 	 (MenuItem
  1280             label: 'Browse Senders...'
  1416 	    label: 'Browse Senders...'
  1281             itemValue: browseSendersOf
  1417 	    itemValue: browseSendersOf
  1282           )
  1418 	  )
  1283          (MenuItem
  1419 	 (MenuItem
  1284             label: '-'
  1420 	    label: '-'
  1285           )
  1421 	  )
  1286          (MenuItem
  1422 	 (MenuItem
  1287             enabled: canDefineMethod
  1423 	    enabled: canDefineMethod
  1288             label: 'Define Missing Method'
  1424 	    label: 'Define Missing Method'
  1289             itemValue: doDefineMethod
  1425 	    itemValue: doDefineMethod
  1290           )
  1426 	  )
  1291          )
  1427 	 )
  1292         nil
  1428 	nil
  1293         nil
  1429 	nil
  1294       )
  1430       )
  1295 !
  1431 !
  1296 
  1432 
  1297 viewMenuSpec
  1433 viewMenuSpec
  1298     "This resource specification was automatically generated
  1434     "This resource specification was automatically generated
  1307      (Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp
  1443      (Menu new fromLiteralArrayEncoding:(DebugView viewMenuSpec)) startUp
  1308     "
  1444     "
  1309 
  1445 
  1310     <resource: #menu>
  1446     <resource: #menu>
  1311 
  1447 
  1312     ^ 
  1448     ^
  1313      #(Menu
  1449      #(Menu
  1314         (
  1450 	(
  1315          (MenuItem
  1451 	 (MenuItem
  1316             enabled: canShowMore
  1452 	    enabled: canShowMore
  1317             label: 'Show More WalkBack'
  1453 	    label: 'Show More WalkBack'
  1318             itemValue: showMoreWalkback
  1454 	    itemValue: showMoreWalkback
  1319           )
  1455 	  )
  1320          (MenuItem
  1456 	 (MenuItem
  1321             enabled: canShowMore
  1457 	    enabled: canShowMore
  1322             label: 'Show Full WalkBack'
  1458 	    label: 'Show Full WalkBack'
  1323             itemValue: showFullWalkback
  1459 	    itemValue: showFullWalkback
  1324           )
  1460 	  )
  1325          (MenuItem
  1461 	 (MenuItem
  1326             label: '-'
  1462 	    label: '-'
  1327           )
  1463 	  )
  1328          (MenuItem
  1464 	 (MenuItem
  1329             label: 'Show Dense WalkBack'
  1465 	    label: 'Show Dense WalkBack'
  1330             itemValue: showingDenseWalkback:
  1466 	    itemValue: showingDenseWalkback:
  1331             hideMenuOnActivated: false
  1467 	    hideMenuOnActivated: false
  1332             indication: showingDenseWalkback
  1468 	    indication: showingDenseWalkback
  1333           )
  1469 	  )
  1334          (MenuItem
  1470 	 (MenuItem
  1335             label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)'
  1471 	    enabled: notShowingDenseWalkbackHolder
  1336             itemValue: showingSupportCode:
  1472 	    label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)'
  1337             hideMenuOnActivated: false
  1473 	    itemValue: showingSupportCode:
  1338             indication: showingSupportCode
  1474 	    hideMenuOnActivated: false
  1339           )
  1475 	    indication: showingSupportCode
  1340          (MenuItem
  1476 	  )
  1341             label: '-'
  1477 	 (MenuItem
  1342           )
  1478 	    label: '-'
  1343          (MenuItem
  1479 	  )
  1344             label: 'Raise Debugger when Entering'
  1480 	 (MenuItem
  1345             itemValue: autoRaiseView:
  1481 	    label: 'Raise Debugger when Entering'
  1346             hideMenuOnActivated: false
  1482 	    itemValue: autoRaiseView:
  1347             indication: autoRaiseView
  1483 	    hideMenuOnActivated: false
  1348           )
  1484 	    indication: autoRaiseView
  1349          (MenuItem
  1485 	  )
  1350             label: '-'
  1486 	 (MenuItem
  1351           )
  1487 	    label: '-'
  1352          (MenuItem
  1488 	  )
  1353             label: 'Settings...'
  1489 	 (MenuItem
  1354             itemValue: openSettingsDialog
  1490 	    label: 'Settings...'
  1355           )
  1491 	    itemValue: openSettingsDialog
  1356          )
  1492 	  )
  1357         nil
  1493 	 )
  1358         nil
  1494 	nil
       
  1495 	nil
  1359       )
  1496       )
  1360 ! !
  1497 ! !
  1361 
  1498 
  1362 !DebugView class methodsFor:'misc'!
  1499 !DebugView class methodsFor:'misc'!
  1363 
  1500 
  1373     "/ fetch some contexts...
  1510     "/ fetch some contexts...
  1374     someContexts := Array new:25.
  1511     someContexts := Array new:25.
  1375     con := aContext.
  1512     con := aContext.
  1376     idx := 1.
  1513     idx := 1.
  1377     [(idx <= someContexts size) and:[con notNil]] whileTrue:[
  1514     [(idx <= someContexts size) and:[con notNil]] whileTrue:[
  1378         someContexts at:idx put:con.
  1515 	someContexts at:idx put:con.
  1379         con := con sender.
  1516 	con := con sender.
  1380         idx := idx + 1.
  1517 	idx := idx + 1.
  1381     ].
  1518     ].
  1382     "/ search...
  1519     "/ search...
  1383     idx := self interestingContextIndexIn:someContexts.
  1520     idx := self interestingContextIndexIn:someContexts.
  1384     ^ someContexts at:idx.
  1521     ^ someContexts at:idx.
  1385 
  1522 
  1405     (con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1].  "/ we are already there
  1542     (con method notNil and:[ con method isWrapped ]) ifTrue:[^ 1].  "/ we are already there
  1406 
  1543 
  1407     "/ somewhere, at the bottom, there must be a raise ...
  1544     "/ somewhere, at the bottom, there must be a raise ...
  1408     "/ find the exception
  1545     "/ find the exception
  1409     1 to:5 do:[:i |
  1546     1 to:5 do:[:i |
  1410         found isNil ifTrue:[
  1547 	found isNil ifTrue:[
  1411             con := aContextArray at:i ifAbsent:nil.
  1548 	    con := aContextArray at:i ifAbsent:nil.
  1412             con notNil ifTrue:[
  1549 	    con notNil ifTrue:[
  1413                 sel := con selector ? ''.
  1550 		sel := con selector ? ''.
  1414                 (sel isSymbol
  1551 		(sel isSymbol
  1415                 and:[ (sel startsWith:'raise') 
  1552 		and:[ (sel startsWith:'raise')
  1416                 and:[ ((rcvr := con receiver) isLazyValue not) 
  1553 		and:[ ((rcvr := con receiver) isLazyValue not)
  1417                 and:[ rcvr isExceptionCreator]]]) ifTrue:[
  1554 		and:[ rcvr isExceptionCreator]]]) ifTrue:[
  1418                     offset := i.
  1555 		    offset := i.
  1419                     found := con.
  1556 		    found := con.
  1420 
  1557 
  1421                     "/ if this is a noHandler exception, 
  1558 		    "/ if this is a noHandler exception,
  1422                     "/ skip forward to the erronous context
  1559 		    "/ skip forward to the erronous context
  1423                     (rcvr isException) ifTrue:[
  1560 		    (rcvr isException) ifTrue:[
  1424                         rcvr creator == Signal noHandlerSignal ifTrue:[
  1561 			rcvr creator == Signal noHandlerSignal ifTrue:[
  1425                             found := rcvr suspendedContext.
  1562 			    found := rcvr suspendedContext.
  1426                             offset := aContextArray identityIndexOf:found.
  1563 			    offset := aContextArray identityIndexOf:found.
  1427                         ]
  1564 			]
  1428                     ].
  1565 		    ].
  1429                 ].
  1566 		].
  1430             ].
  1567 	    ].
  1431         ].
  1568 	].
  1432     ].
  1569     ].
  1433 "/ Transcript showCR:con.
  1570 "/ Transcript showCR:con.
  1434 "/ Transcript show:'1 '; showCR:found.
  1571 "/ Transcript show:'1 '; showCR:found.
  1435 
  1572 
  1436     found isNil ifTrue:[
  1573     found isNil ifTrue:[
  1437         "/ this is a kludge, but convenient.
  1574 	"/ this is a kludge, but convenient.
  1438         "/ show the place where the error (divisionByZero...) happend,
  1575 	"/ show the place where the error (divisionByZero...) happend,
  1439         "/ not where the signal was raised.
  1576 	"/ not where the signal was raised.
  1440         con := (aContextArray at:1).
  1577 	con := (aContextArray at:1).
  1441         sel := con methodHome selector.
  1578 	sel := con methodHome selector.
  1442 
  1579 
  1443 "/ Transcript show:'2 '; showCR:con.
  1580 "/ Transcript show:'2 '; showCR:con.
  1444         "/ typically a DivisionByZero - show caller of division
  1581 	"/ typically a DivisionByZero - show caller of division
  1445         (sel == #//
  1582 	(sel == #//
  1446         or:[sel == #/
  1583 	or:[sel == #/
  1447         or:[sel == #\\]]) ifTrue:[
  1584 	or:[sel == #\\]]) ifTrue:[
  1448             ^ 2
  1585 	    ^ 2
  1449         ].
  1586 	].
  1450 
  1587 
  1451         "/ show the place of the bad message; not where the Signal was raised...
  1588 	"/ show the place of the bad message; not where the Signal was raised...
  1452         (sel == #doesNotUnderstand:) ifTrue:[
  1589 	(sel == #doesNotUnderstand:) ifTrue:[
  1453             idx := 3.
  1590 	    idx := 3.
  1454             nMax > 2 ifTrue:[
  1591 	    nMax > 2 ifTrue:[
  1455                 sel := (aContextArray at:idx) selector ? ''.
  1592 		sel := (aContextArray at:idx) selector ? ''.
  1456                 sel == #doesNotUnderstand: ifTrue:[
  1593 		sel == #doesNotUnderstand: ifTrue:[
  1457                     idx := 4
  1594 		    idx := 4
  1458                 ].
  1595 		].
  1459                 nMax > idx ifTrue:[
  1596 		nMax > idx ifTrue:[
  1460                     sel := (aContextArray at:idx) selector ? ''.
  1597 		    sel := (aContextArray at:idx) selector ? ''.
  1461                     "/ show the place of the perfor-send; not where the Signal was raised...
  1598 		    "/ show the place of the perfor-send; not where the Signal was raised...
  1462                     ((sel == #perform:)
  1599 		    ((sel == #perform:)
  1463                     or:[sel startsWith:'perform:with']) ifTrue:[
  1600 		    or:[sel startsWith:'perform:with']) ifTrue:[
  1464                         idx := idx + 1
  1601 			idx := idx + 1
  1465                     ].
  1602 		    ].
  1466                 ]
  1603 		]
  1467             ].
  1604 	    ].
  1468             ^ idx min:nMax
  1605 	    ^ idx min:nMax
  1469         ].
  1606 	].
  1470 
  1607 
  1471         "/ show the bad method; not where the Signal was raised...
  1608 	"/ show the bad method; not where the Signal was raised...
  1472         (sel == #noByteCode) ifTrue:[
  1609 	(sel == #noByteCode) ifTrue:[
  1473             ^ 2
  1610 	    ^ 2
  1474         ].
  1611 	].
  1475 
  1612 
  1476 "/        "/ show the place of the halt; not where the HaltSignal was raised...
  1613 "/        "/ show the place of the halt; not where the HaltSignal was raised...
  1477 "/        ((sel == #halt) or:[sel == #halt:]) ifTrue:[
  1614 "/        ((sel == #halt) or:[sel == #halt:]) ifTrue:[
  1478 "/            ^ 2
  1615 "/            ^ 2
  1479 "/        ].
  1616 "/        ].
  1493 "/                ].
  1630 "/                ].
  1494 "/            ].
  1631 "/            ].
  1495 "/            ^ 2
  1632 "/            ^ 2
  1496 "/        ].
  1633 "/        ].
  1497 
  1634 
  1498         "/ show the place of signalInterrupt-call; not where the Signal was raised...
  1635 	"/ show the place of signalInterrupt-call; not where the Signal was raised...
  1499         (sel == #signalInterrupt:) ifTrue:[
  1636 	(sel == #signalInterrupt:) ifTrue:[
  1500             ^ 2
  1637 	    ^ 2
  1501         ].
  1638 	].
  1502 
  1639 
  1503 "/        "/ show the place of error-call; not where the ErrorSignal was raised...
  1640 "/        "/ show the place of error-call; not where the ErrorSignal was raised...
  1504 "/        ((sel == #error) or:[sel == #error:]) ifTrue:[
  1641 "/        ((sel == #error) or:[sel == #error:]) ifTrue:[
  1505 "/            con method mclass == Object ifTrue:[
  1642 "/            con method mclass == Object ifTrue:[
  1506 "/                ^ 2
  1643 "/                ^ 2
  1510 "/        "/ show the place of the send; not where the Signal was raised...
  1647 "/        "/ show the place of the send; not where the Signal was raised...
  1511 "/        (sel == #subclassResponsibility) ifTrue:[
  1648 "/        (sel == #subclassResponsibility) ifTrue:[
  1512 "/            ^ 2
  1649 "/            ^ 2
  1513 "/        ].
  1650 "/        ].
  1514 
  1651 
  1515         "/ show the place of the bad index; not where the Signal was raised...
  1652 	"/ show the place of the bad index; not where the Signal was raised...
  1516         ( #(#notIndexed
  1653 	( #(#notIndexed
  1517             #indexNotIntegerOrOutOfBounds:
  1654 	    #indexNotIntegerOrOutOfBounds:
  1518             #subscriptBoundsError:
  1655 	    #subscriptBoundsError:
  1519             #elementBoundsError:
  1656 	    #elementBoundsError:
  1520             "/ #subclassResponsibility
  1657 	    "/ #subclassResponsibility
  1521         ) includes:sel) ifTrue:[
  1658 	) includes:sel) ifTrue:[
  1522             idx := 2.
  1659 	    idx := 2.
  1523             [ idx <= 3
  1660 	    [ idx <= 3
  1524                 and:[
  1661 		and:[
  1525                     sel := (aContextArray at:idx) selector.
  1662 		    sel := (aContextArray at:idx) selector.
  1526                     #(#notIndexed
  1663 		    #(#notIndexed
  1527                       #indexNotIntegerOrOutOfBounds:
  1664 		      #indexNotIntegerOrOutOfBounds:
  1528                       #subscriptBoundsError:
  1665 		      #subscriptBoundsError:
  1529                       #elementBoundsError: ) includes:sel
  1666 		      #elementBoundsError: ) includes:sel
  1530                 ]
  1667 		]
  1531             ] whileTrue:[ idx := idx + 1 ].
  1668 	    ] whileTrue:[ idx := idx + 1 ].
  1532             sel := (aContextArray at:idx) selector.
  1669 	    sel := (aContextArray at:idx) selector.
  1533             (nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel])
  1670 	    (nMax > idx and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel])
  1534             ifTrue:[
  1671 	    ifTrue:[
  1535                 sel := (aContextArray at:idx+1) selector.
  1672 		sel := (aContextArray at:idx+1) selector.
  1536                 (nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel])
  1673 		(nMax > (idx+1) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel])
  1537                 ifTrue:[
  1674 		ifTrue:[
  1538                     sel := (aContextArray at:idx+2) selector.
  1675 		    sel := (aContextArray at:idx+2) selector.
  1539                     (nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel])
  1676 		    (nMax > (idx+2) and:[ #(#basicAt: #basicAt:put: #at: #at:put: ) includes:sel])
  1540                     ifTrue:[
  1677 		    ifTrue:[
  1541                         ^ idx+3
  1678 			^ idx+3
  1542                     ].
  1679 		    ].
  1543                     ^ idx+2
  1680 		    ^ idx+2
  1544                 ].
  1681 		].
  1545                 ^ idx+1
  1682 		^ idx+1
  1546             ].
  1683 	    ].
  1547             ^ idx
  1684 	    ^ idx
  1548         ].
  1685 	].
  1549         offset := 1.
  1686 	offset := 1.
  1550     ].
  1687     ].
  1551 
  1688 
  1552     "/ the above is all too hard-coded;
  1689     "/ the above is all too hard-coded;
  1553     "/ ask the method, if it thinks it should be skipped in the walkback.
  1690     "/ ask the method, if it thinks it should be skipped in the walkback.
  1554     "/ as more methods get flagged, remove code from above.
  1691     "/ as more methods get flagged, remove code from above.
  1555     con := aContextArray at:offset ifAbsent:nil.
  1692     con := aContextArray at:offset ifAbsent:nil.
  1556 "/ Transcript show:'2 '; showCR:con.
  1693 "/ Transcript show:'2 '; showCR:con.
  1557     [
  1694     [
  1558         con notNil
  1695 	con notNil
  1559         and:[ (methodHome := con methodHome) notNil
  1696 	and:[ (methodHome := con methodHome) notNil
  1560         and:[ (method := methodHome method) notNil
  1697 	and:[ (method := methodHome method) notNil
  1561         and:[ method shouldBeSkippedInDebuggersWalkBack ]]]
  1698 	and:[ method shouldBeSkippedInDebuggersWalkBack ]]]
  1562     ] whileTrue:[
  1699     ] whileTrue:[
  1563 "/ Transcript showCR:con methodHome method.
  1700 "/ Transcript showCR:con methodHome method.
  1564         offset := offset + 1.
  1701 	offset := offset + 1.
  1565         con := aContextArray at:offset ifAbsent:nil.
  1702 	con := aContextArray at:offset ifAbsent:nil.
  1566     ].
  1703     ].
  1567     methodHome := nil. "/ help GC
  1704     methodHome := nil. "/ help GC
  1568 
  1705 
  1569     "
  1706     "
  1570      got it; move up, skipping all intermediate Signal and
  1707      got it; move up, skipping all intermediate Signal and
  1571      Exception contexts
  1708      Exception contexts
  1572     "
  1709     "
  1573     prev := nil.
  1710     prev := nil.
  1574     rcvr := con receiver.
  1711     rcvr := con receiver.
  1575     [
  1712     [
  1576         rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]]
  1713 	rcvr isLazyValue not and:[(rcvr isExceptionHandler) or:[(rcvr isException)]]
  1577     ] whileTrue:[
  1714     ] whileTrue:[
  1578         prev := con.
  1715 	prev := con.
  1579         nMax > offset ifFalse:[^ offset].
  1716 	nMax > offset ifFalse:[^ offset].
  1580 
  1717 
  1581         offset := offset + 1.
  1718 	offset := offset + 1.
  1582         con := aContextArray at:offset.
  1719 	con := aContextArray at:offset.
  1583         rcvr := con receiver.
  1720 	rcvr := con receiver.
  1584     ].
  1721     ].
  1585 
  1722 
  1586     "
  1723     "
  1587      now, we are one above the raising context
  1724      now, we are one above the raising context
  1588     "
  1725     "
  1589 "/ Transcript show:'3 '; showCR:con.
  1726 "/ Transcript show:'3 '; showCR:con.
  1590 
  1727 
  1591     (con selector == #retry:coercing:) ifTrue:[
  1728     (con selector == #retry:coercing:) ifTrue:[
  1592         "/ show the operation which failed to coerce, not the coerce
  1729 	"/ show the operation which failed to coerce, not the coerce
  1593         ^ offset + 1
  1730 	^ offset + 1
  1594     ].
  1731     ].
  1595 
  1732 
  1596     "
  1733     "
  1597      if the sender-method of the raise is one of object's error methods ...
  1734      if the sender-method of the raise is one of object's error methods ...
  1598     "
  1735     "
  1599     ( #( halt halt:
  1736     ( #( halt halt:
  1600          error error:
  1737 	 error error:
  1601          doesNotUnderstand:
  1738 	 doesNotUnderstand:
  1602          subclassResponsibility
  1739 	 subclassResponsibility
  1603          primitiveFailed) includes:con selector)
  1740 	 primitiveFailed) includes:con selector)
  1604     ifTrue:[
  1741     ifTrue:[
  1605         con selector == #doesNotUnderstand: ifTrue:[
  1742 	con selector == #doesNotUnderstand: ifTrue:[
  1606             "
  1743 	    "
  1607              one more up, to get to the originating context
  1744 	     one more up, to get to the originating context
  1608             "
  1745 	    "
  1609             con := aContextArray at:(offset + 1).
  1746 	    con := aContextArray at:(offset + 1).
  1610             con isNil ifTrue:[^ offset].
  1747 	    con isNil ifTrue:[^ offset].
  1611             offset := offset + 1.
  1748 	    offset := offset + 1.
  1612         ].
  1749 	].
  1613         con := aContextArray at:(offset + 1).
  1750 	con := aContextArray at:(offset + 1).
  1614         con isNil ifTrue:[^ offset].
  1751 	con isNil ifTrue:[^ offset].
  1615         offset := offset + 1.
  1752 	offset := offset + 1.
  1616     ] ifFalse:[
  1753     ] ifFalse:[
  1617         "
  1754 	"
  1618          ok, got the raise - if its a BreakPoint, look for the sender
  1755 	 ok, got the raise - if its a BreakPoint, look for the sender
  1619         "
  1756 	"
  1620         (prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[
  1757 	(prev notNil and:[prev receiver == BreakPointInterrupt]) ifTrue:[
  1621             offset := offset + 1
  1758 	    offset := offset + 1
  1622         ].
  1759 	].
  1623     ].
  1760     ].
  1624 
  1761 
  1625     ^ offset
  1762     ^ offset
  1626 
  1763 
  1627     "Created: / 17-11-2001 / 20:37:49 / cg"
  1764     "Created: / 17-11-2001 / 20:37:49 / cg"
  1628     "Modified: / 28-08-2013 / 20:23:35 / cg"
  1765     "Modified: / 28-08-2013 / 20:23:35 / cg"
  1629 ! !
  1766 ! !
  1630 
  1767 
       
  1768 !DebugView methodsFor:'accessing'!
       
  1769 
       
  1770 contextInspector
       
  1771     ^ contextInspector
       
  1772 !
       
  1773 
       
  1774 inspectedProcess
       
  1775     ^ inspectedProcess
       
  1776 ! !
       
  1777 
       
  1778 !DebugView methodsFor:'aspects'!
       
  1779 
       
  1780 verboseBacktraceHolder
       
  1781     verboseBacktraceHolder isNil ifTrue:[
       
  1782 	verboseBacktraceHolder := ValueHolder with:false
       
  1783     ].
       
  1784     ^ verboseBacktraceHolder
       
  1785 ! !
       
  1786 
  1631 !DebugView methodsFor:'basic'!
  1787 !DebugView methodsFor:'basic'!
  1632 
  1788 
  1633 enableDisableActions
  1789 enableDisableActions
  1634     |m|
  1790     |m|
  1635 
  1791 
  1636     m := contextView middleButtonMenu.
  1792     m := contextView middleButtonMenu.
  1637     m notNil ifTrue:[
  1793     m notNil ifTrue:[
  1638         self updateMenuItems.
  1794 	self updateMenuItems.
  1639 
  1795 
  1640         (inspecting or:[AbortOperationRequest isHandled]) ifTrue:[
  1796 	(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[
  1641             abortButton enable.
  1797 	    abortButton enable.
  1642             m enable:#doAbort.
  1798 	    m enable:#doAbort.
  1643         ] ifFalse:[
  1799 	] ifFalse:[
  1644             abortButton disable.
  1800 	    abortButton disable.
  1645             m disable:#doAbort.
  1801 	    m disable:#doAbort.
  1646         ].
  1802 	].
  1647         exclusive ifTrue:[
  1803 	exclusive ifTrue:[
  1648             terminateButton disable.
  1804 	    terminateButton disable.
  1649             m disable:#doTerminate.
  1805 	    m disable:#doTerminate.
  1650         ] ifFalse:[
  1806 	] ifFalse:[
  1651             terminateButton enable.
  1807 	    terminateButton enable.
  1652             m enable:#doTerminate.
  1808 	    m enable:#doTerminate.
  1653         ]
  1809 	]
  1654     ].
  1810     ].
  1655 
  1811 
  1656     mayProceed == false ifTrue:[
  1812     mayProceed == false ifTrue:[
  1657         continueButton disable.
  1813 	continueButton disable.
  1658         m notNil ifTrue:[m disable:#doContinue].
  1814 	m notNil ifTrue:[m disable:#doContinue].
  1659     ] ifFalse:[
  1815     ] ifFalse:[
  1660         continueButton enable.
  1816 	continueButton enable.
  1661         m notNil ifTrue:[m enable:#doContinue]
  1817 	m notNil ifTrue:[m enable:#doContinue]
  1662     ].
  1818     ].
  1663 
  1819 
  1664     "Created: / 16.11.2001 / 17:40:51 / cg"
  1820     "Created: / 16.11.2001 / 17:40:51 / cg"
  1665 !
  1821 !
  1666 
  1822 
  1668     "enter a debugger"
  1824     "enter a debugger"
  1669 
  1825 
  1670     <context: #return>
  1826     <context: #return>
  1671 
  1827 
  1672     ^ self
  1828     ^ self
  1673         enter:thisContext sender
  1829 	enter:thisContext sender
  1674         select: nil.
  1830 	select: nil.
  1675 
  1831 
  1676     "Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1832     "Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1677 !
  1833 !
  1678 
  1834 
  1679 enter:aContext select:initialSelectionOrNil
  1835 enter:aContext select:initialSelectionOrNil
  1683     <context: #return>
  1839     <context: #return>
  1684 
  1840 
  1685     |con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c|
  1841     |con m enteredByInterrupt sel iAmNew foundNoByteCodeContext foundExitContext c|
  1686 
  1842 
  1687     DebuggingDebugger == true ifTrue:[
  1843     DebuggingDebugger == true ifTrue:[
  1688         '==> enter2: (' print. aContext print.
  1844 	'==> enter2: (' print. aContext print.
  1689         ') select: ' print. initialSelectionOrNil printCR.
  1845 	') select: ' print. initialSelectionOrNil printCR.
  1690     ].
  1846     ].
  1691     thisContext isRecursive ifTrue:[
  1847     thisContext isRecursive ifTrue:[
  1692         "/ care for the special case, were the Debugger was autoloaded.
  1848 	"/ care for the special case, were the Debugger was autoloaded.
  1693         "/ in this case, thisContext IS recursive, but thats no error
  1849 	"/ in this case, thisContext IS recursive, but thats no error
  1694         "/ condition.
  1850 	"/ condition.
  1695         foundNoByteCodeContext := false.
  1851 	foundNoByteCodeContext := false.
  1696         foundExitContext := false.
  1852 	foundExitContext := false.
  1697 
  1853 
  1698         c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:.
  1854 	c := thisContext findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:.
  1699         [
  1855 	[
  1700          foundNoByteCodeContext not
  1856 	 foundNoByteCodeContext not
  1701          and:[ foundExitContext not
  1857 	 and:[ foundExitContext not
  1702          and:[c notNil
  1858 	 and:[c notNil
  1703          and:[c selector ~~ #enter:withMessage:mayProceed:
  1859 	 and:[c selector ~~ #enter:withMessage:mayProceed:
  1704         ]]]]
  1860 	]]]]
  1705         whileTrue:[
  1861 	whileTrue:[
  1706             c selector == #exit_unwindThenDo: ifTrue:[
  1862 	    c selector == #exit_unwindThenDo: ifTrue:[
  1707                 foundExitContext := true
  1863 		foundExitContext := true
  1708             ].
  1864 	    ].
  1709             c selector == #noByteCode ifTrue:[
  1865 	    c selector == #noByteCode ifTrue:[
  1710                 foundNoByteCodeContext := true
  1866 		foundNoByteCodeContext := true
  1711             ].
  1867 	    ].
  1712             c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:.
  1868 	    c := c findNextContextWithSelector:#enter:withMessage:mayProceed: or:#noByteCode or:#exit_unwindThenDo:.
  1713         ].
  1869 	].
  1714 
  1870 
  1715         (foundNoByteCodeContext not
  1871 	(foundNoByteCodeContext not
  1716         and:[ foundExitContext not]) ifFalse:[
  1872 	and:[ foundExitContext not]) ifFalse:[
  1717             ('DebugView [warning]: reentered') errorPrintCR.
  1873 	    ('DebugView [warning]: reentered') errorPrintCR.
  1718 
  1874 
  1719             ^ MiniDebugger
  1875 	    ^ MiniDebugger
  1720                 enter:aContext
  1876 		enter:aContext
  1721                 withMessage:'DebugView [error]: recursive error (in debugger)'
  1877 		withMessage:'DebugView [error]: recursive error (in debugger)'
  1722                 mayProceed:mayProceed.
  1878 		mayProceed:mayProceed.
  1723         ].
  1879 	].
  1724         foundExitContext ifTrue:[
  1880 	foundExitContext ifTrue:[
  1725             'DebugView [error]: recursive error (in debugger) ignored' printCR.
  1881 	    'DebugView [error]: recursive error (in debugger) ignored' printCR.
  1726             ^ self.
  1882 	    ^ self.
  1727         ].
  1883 	].
  1728     ].
  1884     ].
  1729 
  1885 
  1730     "/'entering: ' print. aContext printCR.
  1886     "/'entering: ' print. aContext printCR.
  1731     "/'initial: ' print. initialSelectionOrNil printCR.
  1887     "/'initial: ' print. initialSelectionOrNil printCR.
  1732     thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s)
  1888     thisContext sender fixAllLineNumbers. "/ _CONTEXTLINENOS(s)
  1733 
  1889 
  1734     (self isHaltToBeIgnored) ifTrue:[
  1890     (self isHaltToBeIgnored) ifTrue:[
  1735         ^ self.
  1891 	^ self.
  1736     ].
  1892     ].
  1737 "/    "/ does not work yet - but we should ignore any breakpoints while stepping
  1893 "/    "/ does not work yet - but we should ignore any breakpoints while stepping
  1738 "/    (stepping and:[steppedContext notNil]) ifTrue:[
  1894 "/    (stepping and:[steppedContext notNil]) ifTrue:[
  1739 "/        self isEnteredDueToBreakpointOrHalt ifTrue:[
  1895 "/        self isEnteredDueToBreakpointOrHalt ifTrue:[
  1740 "/            'DebugView [info]: ignored other interrupt while stepping' infoPrintCR.
  1896 "/            'DebugView [info]: ignored other interrupt while stepping' infoPrintCR.
  1741 "/            ^ self
  1897 "/            ^ self
  1742 "/        ].
  1898 "/        ].
  1743 "/    ].
  1899 "/    ].
  1744 
  1900 
  1745     iAmNew := drawableId isNil.
  1901     iAmNew := self drawableId isNil.
  1746 
  1902 
  1747     verboseBacktrace := UserPreferences current verboseBacktraceInDebugger.
  1903     self verboseBacktraceHolder value:(UserPreferences current verboseBacktraceInDebugger).
  1748 
  1904 
  1749     busy := cachable := true.
  1905     busy := cachable := true.
  1750     inspecting := false.
  1906     inspecting := false.
  1751     inspectedProcess := Processor activeProcess.
  1907     inspectedProcess := Processor activeProcess.
  1752     stepping := false.
  1908     stepping := false.
  1760     "/ On a multiUser system, ungrab all of them ...
  1916     "/ On a multiUser system, ungrab all of them ...
  1761     "/ Q: this is good for multi-screen apps (where an error should not happen),
  1917     "/ Q: this is good for multi-screen apps (where an error should not happen),
  1762     "/    but not for multi-user development, where the debugger is entered often.
  1918     "/    but not for multi-user development, where the debugger is entered often.
  1763     "/    What is a good solution to this dilemma ?
  1919     "/    What is a good solution to this dilemma ?
  1764     Screen allScreens do:[:aScreen |
  1920     Screen allScreens do:[:aScreen |
  1765         aScreen ungrabPointer.
  1921 	aScreen ungrabPointer.
  1766         aScreen ungrabKeyboard.
  1922 	aScreen ungrabKeyboard.
  1767     ].
  1923     ].
  1768 
  1924 
  1769     ("inspectedProcess suspendedContext isNil
  1925     ("inspectedProcess suspendedContext isNil
  1770     or:["inspectedProcess isSystemProcess"]") ifTrue:[
  1926     or:["inspectedProcess isSystemProcess"]") ifTrue:[
  1771         terminateButton disable.
  1927 	terminateButton disable.
  1772     ] ifFalse:[
  1928     ] ifFalse:[
  1773         terminateButton enable.
  1929 	terminateButton enable.
  1774         abortButton enable.
  1930 	abortButton enable.
  1775     ].
  1931     ].
  1776 
  1932 
  1777     iAmNew ifFalse:[
  1933     iAmNew ifFalse:[
  1778         "/ not the first time - disable buttons & menus
  1934 	"/ not the first time - disable buttons & menus
  1779         "/ from the previous life
  1935 	"/ from the previous life
  1780         self turnOffAllButtons.
  1936 	self turnOffAllButtons.
  1781 
  1937 
  1782         m := contextView middleButtonMenu.
  1938 	m := contextView middleButtonMenu.
  1783         m notNil ifTrue:[
  1939 	m notNil ifTrue:[
  1784             m disableAll:#(showMore "skip skipForReturn" inspectContext).
  1940 	    m disableAll:#(showMore "skip skipForReturn" inspectContext).
  1785         ].
  1941 	].
  1786         self showingDenseWalkback:(verboseBacktrace not).
  1942 	self showingDenseWalkback:(self verboseBacktraceHolder value not).
  1787     ].
  1943     ].
  1788     self iconLabel:'Debugger'.
  1944     self iconLabel:'Debugger'.
  1789 
  1945 
  1790     windowGroup isNil ifTrue:[
  1946     windowGroup isNil ifTrue:[
  1791         self windowGroup: WindowGroup new.
  1947 	self windowGroup: WindowGroup new.
  1792         windowGroup addTopView:self.
  1948 	windowGroup addTopView:self.
  1793     ].
  1949     ].
  1794     exclusive ifFalse:[
  1950     exclusive ifFalse:[
  1795         "/ create a (modal) windowGroup for myself
  1951 	"/ create a (modal) windowGroup for myself
  1796 
  1952 
  1797         windowGroup setModal:true.
  1953 	windowGroup setModal:true.
  1798     ] ifTrue:[
  1954     ] ifTrue:[
  1799         "/ create a windowGroup with a synchronous sensor for me
  1955 	"/ create a windowGroup with a synchronous sensor for me
  1800 
  1956 
  1801         windowGroup beSynchronous.
  1957 	windowGroup beSynchronous.
  1802     ].
  1958     ].
  1803     windowGroup setProcess:Processor activeProcess.
  1959     windowGroup setProcess:Processor activeProcess.
  1804 
  1960     IsDebuggingQuery answer:true do:[
  1805         "
  1961 
  1806          get the walkback list; clear inspectors if we did not come here by single stepping)
  1962 	"
  1807         "
  1963 	 get the walkback list; clear inspectors if we did not come here by single stepping)
       
  1964 	"
  1808 "/Transcript show:'0 '; showCR:aContext.
  1965 "/Transcript show:'0 '; showCR:aContext.
  1809 "/Transcript show:'0 '; showCR:thisContext sender.
  1966 "/Transcript show:'0 '; showCR:thisContext sender.
  1810 "/Transcript show:'0 '; showCR:thisContext sender sender.
  1967 "/Transcript show:'0 '; showCR:thisContext sender sender.
  1811 "/Transcript show:'0 '; showCR:thisContext sender sender sender.
  1968 "/Transcript show:'0 '; showCR:thisContext sender sender sender.
  1812 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender.
  1969 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender.
  1816 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender .
  1973 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender .
  1817 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender.
  1974 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender.
  1818 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender.
  1975 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender.
  1819 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender.
  1976 "/Transcript show:'0 '; showCR:thisContext sender sender sender sender sender sender sender sender sender sender sender.
  1820 "/Transcript showCR:initialSelectionOrNil.
  1977 "/Transcript showCR:initialSelectionOrNil.
  1821         self setContext:aContext releaseInspectors:(exitAction ~~ #step).
  1978 	self setContext:aContext releaseInspectors:(exitAction ~~ #step).
  1822         "/'after setContext; first is ' print.
  1979 	"/'after setContext; first is ' print.
  1823         "/(contextArray at:1 ifAbsent:nil) printCR.
  1980 	"/(contextArray at:1 ifAbsent:nil) printCR.
  1824         self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext.
  1981 	self setInitialSelectionOnEntry:initialSelectionOrNil context:aContext.
  1825 
  1982 
  1826     IsDebuggingQuery answer:true do:[
  1983 	self updateButtonsAndMenuItemsForContext:aContext.
  1827         self updateButtonsAndMenuItemsForContext:aContext.
  1984 
  1828 
  1985 	"
  1829         "
  1986 	 If this is a new debugger, do a realize.
  1830          If this is a new debugger, do a realize.
  1987 	 Otherwise, its probably better to do a map, which shows the
  1831          Otherwise, its probably better to do a map, which shows the
  1988 	 view at the previous position, without a need for the user to set the
  1832          view at the previous position, without a need for the user to set the
  1989 	 position again
  1833          position again
  1990 	"
  1834         "
  1991 	iAmNew ifTrue:[
  1835         iAmNew ifTrue:[
  1992 	    self realize.
  1836             self realize.
  1993 	] ifFalse:[
  1837         ] ifFalse:[
  1994 	    self remap.
  1838             self remap.
  1995 	].
  1839         ].
  1996 	self setForegroundWindow.
  1840         self setForegroundWindow.
  1997 
  1841 
  1998 	exclusive ifTrue:[
  1842         exclusive ifTrue:[
  1999 	    self showError:'
  1843             self showError:'
       
  1844 Debugging system process `' , (inspectedProcess nameOrId) printString , '''.
  2000 Debugging system process `' , (inspectedProcess nameOrId) printString , '''.
  1845 
  2001 
  1846 This is a modal debugger - all event processing is stopped..
  2002 This is a modal debugger - all event processing is stopped..
  1847 Therefore, you cannot interact with other views or
  2003 Therefore, you cannot interact with other views or
  1848 open any other tools while this debugger is active.
  2004 open any other tools while this debugger is active.
  1849 
  2005 
  1850 Also, there is no event processing (redraw) for other views.'
  2006 Also, there is no event processing (redraw) for other views.'
  1851         ].
  2007 	].
  1852 
  2008 
  1853         self autoRaiseView ifTrue:[
  2009 	self autoRaiseView ifTrue:[
  1854             "/ self raise.
  2010 	    "/ self raise.
  1855             self raiseDeiconified.
  2011 	    self raiseDeiconified.
  1856             self topView activate; setForegroundWindow; activate.
  2012 	    self topView activate; setForegroundWindow; activate.
  1857         ].
  2013 	].
  1858 
  2014 
  1859         canContinue := true.
  2015 	canContinue := true.
  1860         exitAction := nil.
  2016 	exitAction := nil.
  1861 
  2017 
  1862         "/ enter private event handling loop. This is left (and we come back here again)
  2018 	"/ enter private event handling loop. This is left (and we come back here again)
  1863         "/ when any button was pressed which requires continuation of the debuggee or
  2019 	"/ when any button was pressed which requires continuation of the debuggee or
  1864         "/ closedown of the debugger.
  2020 	"/ closedown of the debugger.
  1865         [self controlLoop] ifCurtailed:[
  2021 	[self controlLoop] ifCurtailed:[
  1866             windowGroup notNil ifTrue:[
  2022 	    windowGroup notNil ifTrue:[
  1867                 windowGroup setProcess:nil.
  2023 		windowGroup setProcess:nil.
  1868             ].
  2024 	    ].
  1869             NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1.
  2025 	    NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1.
  1870             self destroy
  2026 	    self destroy
  1871         ].
  2027 	].
  1872         NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1.
  2028 	NumberOfDebuggers := (NumberOfDebuggers ? 1) - 1.
  1873     ].
  2029     ].
  1874     "/ here after my own control loop is finished.
  2030     "/ here after my own control loop is finished.
  1875 
  2031 
  1876     "/ release all context stuff.
  2032     "/ release all context stuff.
  1877     "/ This is required to avoid keeping references to the debuggees objects
  2033     "/ This is required to avoid keeping references to the debuggees objects
  1880 
  2036 
  1881     codeView acceptAction:nil.
  2037     codeView acceptAction:nil.
  1882     codeView doItAction:nil.
  2038     codeView doItAction:nil.
  1883 
  2039 
  1884     ObjectMemory stepInterruptHandler == self ifTrue:[
  2040     ObjectMemory stepInterruptHandler == self ifTrue:[
  1885         ObjectMemory stepInterruptHandler:nil.
  2041 	ObjectMemory stepInterruptHandler:nil.
  1886     ].
  2042     ].
  1887 
  2043 
  1888     lastSelectionInReceiverInspector := receiverInspector selectedKeyName.
  2044     lastSelectionInReceiverInspector := receiverInspector selectedKeyName.
  1889     lastSelectionInContextInspector := contextInspector selectedKeyName.
  2045     lastSelectionInContextInspector := contextInspector selectedKeyName.
  1890 
  2046 
  1891     (exitAction ~~ #step) ifTrue:[
  2047     (exitAction ~~ #step) ifTrue:[
  1892         "/ not stepping or continue - close window
  2048 	"/ not stepping or continue - close window
  1893         self cacheMyself.
  2049 	self cacheMyself.
  1894         receiverInspector release.
  2050 	receiverInspector release.
  1895         contextInspector release.
  2051 	contextInspector release.
  1896 
  2052 
  1897         self unmap.
  2053 	self unmap.
  1898         device flush.
  2054 	self flush.
  1899 
  2055 
  1900         (exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ].
  2056 	(exitAction == #abort) ifTrue:[ self exit_abort. "does not return" ].
  1901         (exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ].
  2057 	(exitAction == #abortAll) ifTrue:[ self exit_abortAll. "does not return" ].
  1902         (exitAction == #return) ifTrue:[ self exit_return. "does not return" ].
  2058 	(exitAction == #return) ifTrue:[ self exit_return. "does not return" ].
  1903         (exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ].
  2059 	(exitAction == #restart) ifTrue:[ self exit_restart. "does not return" ].
  1904         (exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ].
  2060 	(exitAction == #resend) ifTrue:[ self exit_resend. "does not return" ].
  1905         (exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ].
  2061 	(exitAction == #quickTerminate) ifTrue:[ self exit_quickTerminate. "does not return" ].
  1906         (exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ].
  2062 	(exitAction == #terminate) ifTrue:[ self exit_terminate. "does not return" ].
  1907         exitAction isBlock ifTrue:[
  2063 	exitAction isBlock ifTrue:[
  1908             self exit_unwindThenDo:exitAction.
  2064 	    self exit_unwindThenDo:exitAction.
  1909             "does not return"
  2065 	    "does not return"
  1910         ].
  2066 	].
  1911         "not reached"
  2067 	"not reached"
  1912         ^ self
  2068 	^ self
  1913     ].
  2069     ].
  1914 
  2070 
  1915     "/ stepping - window stays open
  2071     "/ stepping - window stays open
  1916     selectedContext := actualContext := firstContext := nil.
  2072     selectedContext := actualContext := firstContext := nil.
  1917 
  2073 
  1918     "/ restore the previous pointer grab
  2074     "/ restore the previous pointer grab
  1919     grabber notNil ifTrue:[
  2075     grabber notNil ifTrue:[
  1920         device grabPointerInView:grabber.
  2076 	self graphicsDevice grabPointerInView:grabber.
  1921         grabber := nil.
  2077 	grabber := nil.
  1922     ].
  2078     ].
  1923 
  2079 
  1924     (exitAction == #step) ifTrue:[
  2080     (exitAction == #step) ifTrue:[
  1925         "
  2081 	"
  1926          schedule another stepInterrupt
  2082 	 schedule another stepInterrupt
  1927          - must enter myself into the collection of open debuggers,
  2083 	 - must enter myself into the collection of open debuggers,
  1928            in case the stepping process comes back again via a halt or signal
  2084 	   in case the stepping process comes back again via a halt or signal
  1929            before the step is finished. In this case, the stepping debugger should
  2085 	   before the step is finished. In this case, the stepping debugger should
  1930            come up (instead of a new one)
  2086 	   come up (instead of a new one)
  1931          - must flush caches since optimized methods not always
  2087 	 - must flush caches since optimized methods not always
  1932            look for pending interrupts
  2088 	   look for pending interrupts
  1933         "
  2089 	"
  1934 
  2090 
  1935         "/
  2091 	"/
  1936         "/ also must care for stepping into a return
  2092 	"/ also must care for stepping into a return
  1937         "/
  2093 	"/
  1938         steppedContext notNil ifTrue:[
  2094 	steppedContext notNil ifTrue:[
  1939             Processor activeProcess forceInterruptOnReturnOf:steppedContext.
  2095 	    Processor activeProcess forceInterruptOnReturnOf:steppedContext.
  1940         ].
  2096 	].
  1941 
  2097 
  1942         OpenDebuggers isNil ifTrue:[
  2098 	OpenDebuggers isNil ifTrue:[
  1943             OpenDebuggers := WeakIdentitySet new.
  2099 	    OpenDebuggers := WeakIdentitySet new.
  1944         ].
  2100 	].
  1945         OpenDebuggers add:self.
  2101 	OpenDebuggers add:self.
  1946 
  2102 
  1947         self label:'single stepping - please wait ...'.
  2103 	self label:'single stepping - please wait ...'.
  1948         stepping := true.
  2104 	stepping := true.
  1949 
  2105 
  1950         ObjectMemory stepInterruptHandler:self.
  2106 	ObjectMemory stepInterruptHandler:self.
  1951         Processor activeProcess stepInterruptHandler:self.
  2107 	Processor activeProcess stepInterruptHandler:self.
  1952         ObjectMemory flushCaches.
  2108 	ObjectMemory flushCaches.
  1953 
  2109 
  1954         Context singleStepInterruptRequest isHandled ifTrue:[
  2110 	Context singleStepInterruptRequest isHandled ifTrue:[
  1955             Context singleStepInterruptRequest
  2111 	    Context singleStepInterruptRequest
  1956                 raiseWith:
  2112 		raiseWith:
  1957                     (("bigStep" steppedContextLineno notNil)
  2113 		    (("bigStep" steppedContextLineno notNil)
  1958                         ifTrue:[#next]
  2114 			ifTrue:[#next]
  1959                         ifFalse:[#step])
  2115 			ifFalse:[#step])
  1960         ] ifFalse:[
  2116 	] ifFalse:[
  1961             "/ see if we came here through an interrupt-action
  2117 	    "/ see if we came here through an interrupt-action
  1962             "/ (i.e. aProcess interruptWith:...)
  2118 	    "/ (i.e. aProcess interruptWith:...)
  1963 
  2119 
  1964             enteredByInterrupt := false.
  2120 	    enteredByInterrupt := false.
  1965             con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil.
  2121 	    con := thisContext findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil.
  1966             [enteredByInterrupt not
  2122 	    [enteredByInterrupt not
  1967              and:[con notNil
  2123 	     and:[con notNil
  1968              and:[con ~~ aContext]]] whileTrue:[
  2124 	     and:[con ~~ aContext]]] whileTrue:[
  1969                 ((sel := con selector) == #timerInterrupt
  2125 		((sel := con selector) == #timerInterrupt
  1970                 or:[sel == #ioInterrupt]) ifTrue:[
  2126 		or:[sel == #ioInterrupt]) ifTrue:[
  1971                     enteredByInterrupt := true.
  2127 		    enteredByInterrupt := true.
  1972                 ] ifFalse:[
  2128 		] ifFalse:[
  1973                     con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil.
  2129 		    con := con findNextContextWithSelector:#timerInterrupt or:#ioInterrupt or:nil.
  1974                 ].
  2130 		].
  1975             ].
  2131 	    ].
  1976 
  2132 
  1977             ObjectMemory flushInlineCaches.
  2133 	    ObjectMemory flushInlineCaches.
  1978 
  2134 
  1979             DebuggingDebugger == true ifTrue:[
  2135 	    DebuggingDebugger == true ifTrue:[
  1980                 enteredByInterrupt printCR.
  2136 		enteredByInterrupt printCR.
  1981             ].
  2137 	    ].
  1982             enteredByInterrupt ifTrue:[
  2138 	    enteredByInterrupt ifTrue:[
  1983                 "/ don't want to step through all intermediate
  2139 		"/ don't want to step through all intermediate
  1984                 "/ (scheduler-) contexts; place a return-trap on the
  2140 		"/ (scheduler-) contexts; place a return-trap on the
  1985                 "/ one right below the interesting one
  2141 		"/ one right below the interesting one
  1986 
  2142 
  1987 "/                'special unwind return' printCR.
  2143 "/                'special unwind return' printCR.
  1988                 con unwindThenDo:[
  2144 		con unwindThenDo:[
  1989                                   Processor activeProcess stepInterruptHandler:self.
  2145 				  Processor activeProcess stepInterruptHandler:self.
  1990                                   ObjectMemory stepInterruptHandler:self.
  2146 				  ObjectMemory stepInterruptHandler:self.
  1991                                   InStepInterrupt := nil.
  2147 				  InStepInterrupt := nil.
  1992                                   StepInterruptPending := 1.
  2148 				  StepInterruptPending := 1.
  1993                                   InterruptPending := 1].
  2149 				  InterruptPending := 1].
  1994             ] ifFalse:[
  2150 	    ] ifFalse:[
  1995 "/                'normal step return' printCR.
  2151 "/                'normal step return' printCR.
  1996                 skipLineNr ~~ #return ifTrue:[
  2152 		skipLineNr ~~ #return ifTrue:[
  1997                     StepInterruptPending := 1.
  2153 		    StepInterruptPending := 1.
  1998                     InterruptPending := 1.
  2154 		    InterruptPending := 1.
  1999                 ] ifFalse:[
  2155 		] ifFalse:[
  2000 "/                    'step for return' printCR.
  2156 "/                    'step for return' printCR.
  2001                 ]
  2157 		]
  2002             ].
  2158 	    ].
  2003             InStepInterrupt := nil
  2159 	    InStepInterrupt := nil
  2004         ]
  2160 	]
  2005     ] ifFalse:[
  2161     ] ifFalse:[
  2006         OpenDebuggers notNil ifTrue:[
  2162 	OpenDebuggers notNil ifTrue:[
  2007             OpenDebuggers remove:self ifAbsent:[].
  2163 	    OpenDebuggers remove:self ifAbsent:[].
  2008         ].
  2164 	].
  2009         self cacheMyself.
  2165 	self cacheMyself.
  2010     ]
  2166     ]
  2011 
  2167 
  2012     "Modified: / 17-04-1997 / 13:01:32 / stefan"
  2168     "Modified: / 17-04-1997 / 13:01:32 / stefan"
  2013     "Created: / 30-10-1997 / 21:08:18 / cg"
  2169     "Created: / 30-10-1997 / 21:08:18 / cg"
  2014     "Modified: / 13-10-1998 / 19:56:59 / ps"
  2170     "Modified: / 13-10-1998 / 19:56:59 / ps"
  2049 
  2205 
  2050 exit_resend
  2206 exit_resend
  2051     |con|
  2207     |con|
  2052 
  2208 
  2053     selectedContext notNil ifTrue:[
  2209     selectedContext notNil ifTrue:[
  2054         con := selectedContext.
  2210 	con := selectedContext.
  2055         self cacheMyself.
  2211 	self cacheMyself.
  2056         "
  2212 	"
  2057          have to catch errors occuring in unwind-blocks
  2213 	 have to catch errors occuring in unwind-blocks
  2058         "
  2214 	"
  2059         Error handle:[:ex |
  2215 	Error handle:[:ex |
  2060             'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2216 	    'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2061             ex description infoPrintCR.
  2217 	    ex description infoPrintCR.
  2062             ex proceed
  2218 	    ex proceed
  2063         ] do:[
  2219 	] do:[
  2064             ^ con unwindThenResend.
  2220 	    ^ con unwindThenResend.
  2065         ].
  2221 	].
  2066         'DebugView [warning]: cannot resend selected context''s message' errorPrintCR
  2222 	'DebugView [warning]: cannot resend selected context''s message' errorPrintCR
  2067     ]
  2223     ]
  2068 !
  2224 !
  2069 
  2225 
  2070 exit_restart
  2226 exit_restart
  2071     |con|
  2227     |con|
  2072 
  2228 
  2073     selectedContext notNil ifTrue:[
  2229     selectedContext notNil ifTrue:[
  2074         con := selectedContext.
  2230 	con := selectedContext.
  2075         self cacheMyself.
  2231 	self cacheMyself.
  2076         "
  2232 	"
  2077          have to catch errors occuring in unwind-blocks
  2233 	 have to catch errors occuring in unwind-blocks
  2078         "
  2234 	"
  2079         Error handle:[:ex |
  2235 	Error handle:[:ex |
  2080             'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2236 	    'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2081             ex description infoPrintCR.
  2237 	    ex description infoPrintCR.
  2082             ex proceed
  2238 	    ex proceed
  2083         ] do:[
  2239 	] do:[
  2084             con unwindAndRestart.
  2240 	    con unwindAndRestart.
  2085         ].
  2241 	].
  2086         'DebugView [warning]: cannot restart selected context' errorPrintCR
  2242 	'DebugView [warning]: cannot restart selected context' errorPrintCR
  2087     ]
  2243     ]
  2088 
  2244 
  2089     "Created: / 16-11-2001 / 17:23:17 / cg"
  2245     "Created: / 16-11-2001 / 17:23:17 / cg"
  2090     "Modified: / 26-09-2012 / 15:09:52 / cg"
  2246     "Modified: / 26-09-2012 / 15:09:52 / cg"
  2091 !
  2247 !
  2092 
  2248 
  2093 exit_return
  2249 exit_return
  2094     |con retVal|
  2250     |con retVal|
  2095 
  2251 
       
  2252     retVal := nil.
       
  2253 
  2096     selectedContext notNil ifTrue:[
  2254     selectedContext notNil ifTrue:[
  2097         "
  2255 	"
  2098          if there is a selection in the codeView,
  2256 	 if there is a selection in the codeView,
  2099          evaluate it and use the result as return value
  2257 	 evaluate it and use the result as return value
  2100         "
  2258 	"
  2101 "/ disabled for now, there is almost always a selection (the current line)
  2259 "/ disabled for now, there is almost always a selection (the current line)
  2102 "/ and that is syntactically incorrect ...
  2260 "/ and that is syntactically incorrect ...
  2103 "/ ... leading to a popup warning from the codeView
  2261 "/ ... leading to a popup warning from the codeView
  2104 "/
  2262 "/
  2105 "/                codeView hasSelection ifTrue:[
  2263 "/                codeView hasSelection ifTrue:[
  2113 "/                        s := codeView selection asString.
  2271 "/                        s := codeView selection asString.
  2114 "/                        retVal := codeView doItAction value:s.
  2272 "/                        retVal := codeView doItAction value:s.
  2115 "/                    ].
  2273 "/                    ].
  2116 "/                ].
  2274 "/                ].
  2117 
  2275 
  2118         con := selectedContext.
  2276 	con := selectedContext.
  2119         self cacheMyself.
  2277 	self cacheMyself.
  2120         "
  2278 	"
  2121          have to catch errors occuring in unwind-blocks
  2279 	 have to catch errors occuring in unwind-blocks
  2122         "
  2280 	"
  2123         Error handle:[:ex |
  2281 	Error handle:[:ex |
  2124             'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2282 	    'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2125             ex description infoPrintCR.
  2283 	    ex description infoPrintCR.
  2126             ex proceed
  2284 	    ex proceed
  2127         ] do:[
  2285 	] do:[
  2128             con unwind:retVal.
  2286 	    con unwind:retVal.
  2129         ].
  2287 	].
  2130         'DebugView [warning]: cannot return from selected context' errorPrintCR
  2288 	'DebugView [warning]: cannot return from selected context' errorPrintCR
  2131     ]
  2289     ]
  2132 
  2290 
  2133     "Created: / 16.11.2001 / 17:22:24 / cg"
  2291     "Created: / 16.11.2001 / 17:22:24 / cg"
  2134     "Modified: / 17.11.2001 / 23:20:21 / cg"
  2292     "Modified: / 17.11.2001 / 23:20:21 / cg"
  2135 !
  2293 !
  2138 
  2296 
  2139     "
  2297     "
  2140      have to catch errors occuring in unwind-blocks
  2298      have to catch errors occuring in unwind-blocks
  2141     "
  2299     "
  2142     Error handle:[:ex |
  2300     Error handle:[:ex |
  2143         'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2301 	'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2144         ex description infoPrintCR.
  2302 	ex description infoPrintCR.
  2145         ex proceed
  2303 	ex proceed
  2146     ] do:[
  2304     ] do:[
  2147         self cacheMyself.
  2305 	self cacheMyself.
  2148         Processor activeProcess terminate.
  2306 	Processor activeProcess terminate.
  2149     ].
  2307     ].
  2150     'DebugView [warning]: cannot terminate process' errorPrintCR
  2308     'DebugView [warning]: cannot terminate process' errorPrintCR
  2151 
  2309 
  2152     "Created: / 16.11.2001 / 17:24:20 / cg"
  2310     "Created: / 16.11.2001 / 17:24:20 / cg"
  2153     "Modified: / 17.11.2001 / 23:20:27 / cg"
  2311     "Modified: / 17.11.2001 / 23:20:27 / cg"
  2169     "
  2327     "
  2170     self cacheMyself.
  2328     self cacheMyself.
  2171     con := thisContext sender.
  2329     con := thisContext sender.
  2172 
  2330 
  2173     Error handle:[:ex |
  2331     Error handle:[:ex |
  2174         'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2332 	'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2175         ex description infoPrintCR.
  2333 	ex description infoPrintCR.
  2176         ex proceed
  2334 	ex proceed
  2177     ] do:[
  2335     ] do:[
  2178         "/ find the enter:select context.
  2336 	"/ find the enter:select context.
  2179         [(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[ 
  2337 	[(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[
  2180             con := con sender 
  2338 	    con := con sender
  2181         ].
  2339 	].
  2182 
  2340 
  2183         "/ must skip over its caller (because this one has a ControlInterrupt handler too)
  2341 	"/ must skip over its caller (because this one has a ControlInterrupt handler too)
  2184         con sender receiver == self class ifTrue:[
  2342 	con sender receiver == self class ifTrue:[
  2185             con := con sender.
  2343 	    con := con sender.
  2186             con sender receiver == self class ifTrue:[
  2344 	    con sender receiver == self class ifTrue:[
  2187                 con := con sender methodHome.
  2345 		con := con sender methodHome.
  2188             ].
  2346 	    ].
  2189         ].
  2347 	].
  2190 
  2348 
  2191         con unwindThenDo:aBlock.
  2349 	con unwindThenDo:aBlock.
  2192     ].
  2350     ].
  2193     'DebugView [warning]: abort failed' errorPrintCR
  2351     'DebugView [warning]: abort failed' errorPrintCR
  2194 
  2352 
  2195     "Created: / 16.11.2001 / 17:20:45 / cg"
  2353     "Created: / 16.11.2001 / 17:20:45 / cg"
  2196     "Modified: / 18.11.2001 / 00:58:14 / cg"
  2354     "Modified: / 18.11.2001 / 00:58:14 / cg"
  2198 
  2356 
  2199 initialSelectionOnEntry:initialSelectionOrNil context:aContext
  2357 initialSelectionOnEntry:initialSelectionOrNil context:aContext
  2200     |selection con1 con2 h|
  2358     |selection con1 con2 h|
  2201 
  2359 
  2202     initialSelectionOrNil notNil ifTrue:[
  2360     initialSelectionOrNil notNil ifTrue:[
  2203         ^ initialSelectionOrNil
  2361 	^ initialSelectionOrNil
  2204     ].
  2362     ].
  2205 
  2363 
  2206     "
  2364     "
  2207      and find the one context to show initially
  2365      and find the one context to show initially
  2208      - if we came here by a send (single step), its the top context;
  2366      - if we came here by a send (single step), its the top context;
  2215     con2 := (contextArray at:2 ifAbsent:nil).
  2373     con2 := (contextArray at:2 ifAbsent:nil).
  2216 "/ Transcript show:'x '; showCR:exitAction.
  2374 "/ Transcript show:'x '; showCR:exitAction.
  2217 
  2375 
  2218     "/ came here via a step?
  2376     "/ came here via a step?
  2219     exitAction == #step ifTrue:[
  2377     exitAction == #step ifTrue:[
  2220         selection := 1.
  2378 	selection := 1.
  2221         steppedContext notNil ifTrue:[
  2379 	steppedContext notNil ifTrue:[
  2222 
  2380 
  2223             "
  2381 	    "
  2224              if we came here by a big-step, show the method where we are
  2382 	     if we came here by a big-step, show the method where we are
  2225             "
  2383 	    "
  2226             con1 == steppedContext ifTrue:[
  2384 	    con1 == steppedContext ifTrue:[
  2227                 selection := 1
  2385 		selection := 1
  2228             ] ifFalse:[
  2386 	    ] ifFalse:[
  2229                 con2 == steppedContext ifTrue:[
  2387 		con2 == steppedContext ifTrue:[
  2230                     selection := 2
  2388 		    selection := 2
  2231                 ]
  2389 		]
  2232             ].
  2390 	    ].
  2233             "
  2391 	    "
  2234              for bigStep, we could also be in a block below the actual method ...
  2392 	     for bigStep, we could also be in a block below the actual method ...
  2235             "
  2393 	    "
  2236             ((h := con1 home) notNil
  2394 	    ((h := con1 home) notNil
  2237              and:[h == steppedContext]) ifTrue:[
  2395 	     and:[h == steppedContext]) ifTrue:[
  2238                 selection := 1
  2396 		selection := 1
  2239             ] ifFalse:[
  2397 	    ] ifFalse:[
  2240                 (con2 notNil
  2398 		(con2 notNil
  2241                 and:[(h := con2 home) notNil
  2399 		and:[(h := con2 home) notNil
  2242                 and:[h == steppedContext]]) ifTrue:[
  2400 		and:[h == steppedContext]]) ifTrue:[
  2243                     selection := 2
  2401 		    selection := 2
  2244                 ]
  2402 		]
  2245             ].
  2403 	    ].
  2246             h := nil.
  2404 	    h := nil.
  2247         ]
  2405 	]
  2248     ] ifFalse:[
  2406     ] ifFalse:[
  2249         steppedContext isNil ifTrue:[
  2407 	steppedContext isNil ifTrue:[
  2250             "
  2408 	    "
  2251              preselect a more interesting context, (where halt/raise was ...)
  2409 	     preselect a more interesting context, (where halt/raise was ...)
  2252             "
  2410 	    "
  2253             "/ selection := self class interestingContextIndexFrom:aContext.
  2411 	    "/ selection := self class interestingContextIndexFrom:aContext.
  2254             selection := self class interestingContextIndexIn:contextArray.
  2412 	    selection := self class interestingContextIndexIn:contextArray.
  2255 "/ Transcript show:'x '; showCR:selection.
  2413 "/ Transcript show:'x '; showCR:selection.
  2256             selection := selection min:(contextArray size).
  2414 	    selection := selection min:(contextArray size).
  2257         ] ifFalse:[
  2415 	] ifFalse:[
  2258             "
  2416 	    "
  2259              if we came here by a big-step, show the method where we are
  2417 	     if we came here by a big-step, show the method where we are
  2260             "
  2418 	    "
  2261             con1 == steppedContext ifTrue:[
  2419 	    con1 == steppedContext ifTrue:[
  2262                 selection := 1
  2420 		selection := 1
  2263             ] ifFalse:[
  2421 	    ] ifFalse:[
  2264                 con2 == steppedContext ifTrue:[
  2422 		con2 == steppedContext ifTrue:[
  2265                     selection := 2.
  2423 		    selection := 2.
  2266                 ]
  2424 		]
  2267             ]
  2425 	    ]
  2268         ]
  2426 	]
  2269     ].
  2427     ].
  2270     ^ selection
  2428     ^ selection
  2271 
  2429 
  2272     "Created: / 17.11.2001 / 20:26:26 / cg"
  2430     "Created: / 17.11.2001 / 20:26:26 / cg"
  2273     "Modified: / 17.11.2001 / 22:51:46 / cg"
  2431     "Modified: / 17.11.2001 / 22:51:46 / cg"
  2288      one. (think of it as an inspector showing more detail, and offering
  2446      one. (think of it as an inspector showing more detail, and offering
  2289      some more control operations)"
  2447      some more control operations)"
  2290 
  2448 
  2291     |bpanel dummy w|
  2449     |bpanel dummy w|
  2292 
  2450 
  2293     verboseBacktrace := UserPreferences current verboseBacktraceInDebugger.
  2451     self verboseBacktraceHolder value:( UserPreferences current verboseBacktraceInDebugger ).
  2294 
  2452 
  2295     busy := true.
  2453     busy := true.
  2296     bigStep := false.
  2454     bigStep := false.
  2297     stepHow := nil.
  2455     stepHow := nil.
  2298     inspecting := true.
  2456     inspecting := true.
  2308     continueButton label:(resources string:'Stop').
  2466     continueButton label:(resources string:'Stop').
  2309     w := w max:(continueButton preferredWidth).
  2467     w := w max:(continueButton preferredWidth).
  2310     continueButton preferredExtent:(w @ continueButton preferredHeight).
  2468     continueButton preferredExtent:(w @ continueButton preferredHeight).
  2311 
  2469 
  2312     aProcess state == #run ifTrue:[
  2470     aProcess state == #run ifTrue:[
  2313         device hasColors ifTrue:[
  2471 	self graphicsDevice hasColors ifTrue:[
  2314             continueButton foregroundColor:Color red darkened.
  2472 	    continueButton foregroundColor:Color red darkened.
  2315         ].
  2473 	].
  2316         continueButton label:(resources string:'Stop').
  2474 	continueButton label:(resources string:'Stop').
  2317         continueButton action:[self doStop].
  2475 	continueButton action:[self doStop].
  2318     ] ifFalse:[
  2476     ] ifFalse:[
  2319         device hasColors ifTrue:[
  2477 	self graphicsDevice hasColors ifTrue:[
  2320             continueButton foregroundColor:Color green darkened darkened.
  2478 	    continueButton foregroundColor:Color green darkened darkened.
  2321         ].
  2479 	].
  2322         continueButton label:(resources string:'Continue').
  2480 	continueButton label:(resources string:'Continue').
  2323         continueButton action:[self doContinue].
  2481 	continueButton action:[self doContinue].
  2324     ].
  2482     ].
  2325     continueButton preferredExtent:(w @ continueButton preferredHeight).
  2483     continueButton preferredExtent:(w @ continueButton preferredHeight).
  2326 
  2484 
  2327     returnButton disable.
  2485     returnButton disable.
  2328     restartButton disable.
  2486     restartButton disable.
  2332 
  2490 
  2333 "/    stepButton destroy.
  2491 "/    stepButton destroy.
  2334 "/    sendButton destroy.
  2492 "/    sendButton destroy.
  2335 
  2493 
  2336     updateButton := Button
  2494     updateButton := Button
  2337                         label:(resources string:'Update')
  2495 			label:(resources string:'Update')
  2338                         action:[self updateContext]
  2496 			action:[self updateContext]
  2339                         in:bpanel.
  2497 			in:bpanel.
  2340     monitorToggle := Toggle in:bpanel.
  2498     monitorToggle := Toggle in:bpanel.
  2341     monitorToggle label:(resources string:'Monitor').
  2499     monitorToggle label:(resources string:'Monitor').
  2342     monitorToggle pressAction:[self autoUpdateOn].
  2500     monitorToggle pressAction:[self autoUpdateOn].
  2343     monitorToggle releaseAction:[self autoUpdateOff].
  2501     monitorToggle releaseAction:[self autoUpdateOff].
  2344 
  2502 
  2353     nextButton disable; beInvisible.
  2511     nextButton disable; beInvisible.
  2354     nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible].
  2512     nextOverButton notNil ifTrue:[nextOverButton disable; beInvisible].
  2355     nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible].
  2513     nextOutButton notNil ifTrue:[nextOutButton disable; beInvisible].
  2356 
  2514 
  2357     aProcess isNil ifTrue:[
  2515     aProcess isNil ifTrue:[
  2358         terminateButton disable.
  2516 	terminateButton disable.
  2359         abortButton disable.
  2517 	abortButton disable.
  2360         continueButton disable.
  2518 	continueButton disable.
  2361         returnButton disable.
  2519 	returnButton disable.
  2362         restartButton disable.
  2520 	restartButton disable.
  2363     ] ifFalse:[
  2521     ] ifFalse:[
  2364         (aProcess suspendedContext isNil
  2522 	(aProcess suspendedContext isNil
  2365         or:[aProcess isSystemProcess]) ifTrue:[
  2523 	or:[aProcess isSystemProcess]) ifTrue:[
  2366             terminateButton disable.
  2524 	    terminateButton disable.
  2367         ].
  2525 	].
  2368 
  2526 
  2369         self setContextSkippingInterruptContexts:aProcess suspendedContext.
  2527 	self setContextSkippingInterruptContexts:aProcess suspendedContext.
  2370 
  2528 
  2371         catchBlock := [
  2529 	catchBlock := [
  2372             catchBlock := nil.
  2530 	    catchBlock := nil.
  2373             contextArray := nil.
  2531 	    contextArray := nil.
  2374             selectedContext := actualContext := firstContext := nil.
  2532 	    selectedContext := actualContext := firstContext := nil.
  2375             steppedContext := wrapperContext := nil.
  2533 	    steppedContext := wrapperContext := nil.
  2376 
  2534 
  2377             (exitAction == #terminate) ifTrue:[
  2535 	    (exitAction == #terminate) ifTrue:[
  2378                 aProcess terminate.
  2536 		aProcess terminate.
  2379             ].
  2537 	    ].
  2380             (exitAction == #quickTerminate) ifTrue:[
  2538 	    (exitAction == #quickTerminate) ifTrue:[
  2381                 aProcess terminateNoSignal.
  2539 		aProcess terminateNoSignal.
  2382             ].
  2540 	    ].
  2383             super destroy
  2541 	    super destroy
  2384         ].
  2542 	].
  2385     ].
  2543     ].
  2386     self open
  2544     self open
  2387 
  2545 
  2388     "Modified: 20.3.1997 / 16:53:56 / cg"
  2546     "Modified: 20.3.1997 / 16:53:56 / cg"
  2389     "Modified: 17.4.1997 / 13:01:57 / stefan"
  2547     "Modified: 17.4.1997 / 13:01:57 / stefan"
  2391 
  2549 
  2392 selectContextWithIndex:index
  2550 selectContextWithIndex:index
  2393     self showSelection:index.
  2551     self showSelection:index.
  2394     contextView setSelection:index.
  2552     contextView setSelection:index.
  2395     index > 1 ifTrue:[
  2553     index > 1 ifTrue:[
  2396         contextView scrollToLine:(index - 1)
  2554 	contextView scrollToLine:(index - 1)
  2397     ].
  2555     ].
  2398 !
  2556 !
  2399 
  2557 
  2400 setInitialSelectionOnEntry:initialSelectionOrNil context:aContext
  2558 setInitialSelectionOnEntry:initialSelectionOrNil context:aContext
  2401     |selection|
  2559     |selection|
  2402 
  2560 
  2403     selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext.
  2561     selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext.
  2404     selection notNil ifTrue:[
  2562     selection notNil ifTrue:[
  2405         self selectContextWithIndex:selection
  2563 	self selectContextWithIndex:selection
  2406     ].
  2564     ].
  2407 
  2565 
  2408     "Created: / 16.11.2001 / 17:28:07 / cg"
  2566     "Created: / 16.11.2001 / 17:28:07 / cg"
  2409     "Modified: / 17.11.2001 / 20:27:21 / cg"
  2567     "Modified: / 17.11.2001 / 20:27:21 / cg"
  2410 !
  2568 !
  2433 
  2591 
  2434 flyByHelpTextFor:aComponent
  2592 flyByHelpTextFor:aComponent
  2435     |s|
  2593     |s|
  2436 
  2594 
  2437     aComponent == abortButton ifTrue:[
  2595     aComponent == abortButton ifTrue:[
  2438         s := 'Abort (unwind to eventLoop)'
  2596 	s := 'Abort (unwind to eventLoop)'
  2439     ].
  2597     ].
  2440     aComponent == terminateButton ifTrue:[
  2598     aComponent == terminateButton ifTrue:[
  2441         Processor activeProcess isGUIProcess ifTrue:[
  2599 	Processor activeProcess isGUIProcess ifTrue:[
  2442             s := 'Terminate the process (closes view and shuts down application)'
  2600 	    s := 'Terminate the process (closes view and shuts down application)'
  2443         ] ifFalse:[
  2601 	] ifFalse:[
  2444             s := 'Terminate the process'
  2602 	    s := 'Terminate the process'
  2445         ]
  2603 	]
  2446     ].
  2604     ].
  2447     aComponent == continueButton ifTrue:[
  2605     aComponent == continueButton ifTrue:[
  2448         continueButton label = (resources string:'Stop') ifTrue:[
  2606 	continueButton label = (resources string:'Stop') ifTrue:[
  2449             s := 'Stop'
  2607 	    s := 'Stop'
  2450         ] ifFalse:[
  2608 	] ifFalse:[
  2451             s := 'Continue execution'
  2609 	    s := 'Continue execution'
  2452         ]
  2610 	]
  2453     ].
  2611     ].
  2454     aComponent == stepButton ifTrue:[
  2612     aComponent == stepButton ifTrue:[
  2455         s := 'Step to next send in selected context (don''t enter into called methods)'
  2613 	s := 'Step to next send in selected context (don''t enter into called methods)'
  2456     ].
  2614     ].
  2457     aComponent == nextButton ifTrue:[
  2615     aComponent == nextButton ifTrue:[
  2458         s := 'Step to next line in selected context (don''t enter into called methods)'
  2616 	s := 'Step to next line in selected context (don''t enter into called methods)'
  2459     ].
  2617     ].
  2460     aComponent == nextOverButton ifTrue:[
  2618     aComponent == nextOverButton ifTrue:[
  2461         s := 'Step over to cursor-line'
  2619 	s := 'Step over to cursor-line'
  2462     ].
  2620     ].
  2463     aComponent == nextOutButton ifTrue:[
  2621     aComponent == nextOutButton ifTrue:[
  2464         s := 'Step out to caller'
  2622 	s := 'Step out to caller'
  2465     ].
  2623     ].
  2466     aComponent == sendButton ifTrue:[
  2624     aComponent == sendButton ifTrue:[
  2467         s := 'Send next message (enter into called methods)'
  2625 	s := 'Send next message (enter into called methods)'
  2468     ].
  2626     ].
  2469     aComponent == returnButton ifTrue:[
  2627     aComponent == returnButton ifTrue:[
  2470         restartButton enabled ifTrue:[
  2628 	restartButton enabled ifTrue:[
  2471             s := 'Return from the selected method'
  2629 	    s := 'Return from the selected method'
  2472         ] ifFalse:[
  2630 	] ifFalse:[
  2473             s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs
  2631 	    s := 'Return from the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs
  2474         ]
  2632 	]
  2475     ].
  2633     ].
  2476     aComponent == restartButton ifTrue:[
  2634     aComponent == restartButton ifTrue:[
  2477         restartButton enabled ifTrue:[
  2635 	restartButton enabled ifTrue:[
  2478             s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again'
  2636 	    s := 'Restart the selected method.\If the code was changed in the meanwhile, the original method will be executed again'
  2479         ] ifFalse:[
  2637 	] ifFalse:[
  2480             s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs
  2638 	    s := 'Restart the selected method.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs
  2481         ]
  2639 	]
  2482     ].
  2640     ].
  2483     aComponent == resendButton ifTrue:[
  2641     aComponent == resendButton ifTrue:[
  2484         resendButton enabled ifTrue:[
  2642 	resendButton enabled ifTrue:[
  2485             s := 'Resend the selected method''s message.\If the code was changed in the meanwhile, the new method will be called with the original arguments.'
  2643 	    s := 'Resend the selected method''s message.\If the code was changed in the meanwhile, the new method will be called with the original arguments.'
  2486         ] ifFalse:[
  2644 	] ifFalse:[
  2487             s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs
  2645 	    s := 'Resend the selected method''s message.\Disabled, because this method was compiled with context optimization, and cannot be returned from.' withCRs
  2488         ]
  2646 	]
  2489     ].
  2647     ].
  2490     aComponent == monitorToggle ifTrue:[
  2648     aComponent == monitorToggle ifTrue:[
  2491         s := 'Toggle monitoring'
  2649 	s := 'Toggle monitoring'
  2492     ].
  2650     ].
  2493     aComponent == updateButton ifTrue:[
  2651     aComponent == updateButton ifTrue:[
  2494         s := 'Update'
  2652 	s := 'Update'
  2495     ].
  2653     ].
  2496     aComponent == defineButton ifTrue:[
  2654     aComponent == defineButton ifTrue:[
  2497         s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then'
  2655 	s := 'Define the missing method (as halting) and proceed into it.\A debugger will reopen there, so you can add the code then'
  2498     ].
  2656     ].
  2499     aComponent == reportButton ifTrue:[
  2657     aComponent == reportButton ifTrue:[
  2500         s := 'Send a defect report via eMail'
  2658 	s := 'Send a defect report via eMail'
  2501     ].
  2659     ].
  2502     s notNil ifTrue:[
  2660     s notNil ifTrue:[
  2503         ^ resources stringWithCRs:s
  2661 	^ resources stringWithCRs:s
  2504     ].
  2662     ].
  2505     ^ nil
  2663     ^ nil
  2506 
  2664 
  2507     "Modified: / 29-08-1995 / 23:38:54 / claus"
  2665     "Modified: / 29-08-1995 / 23:38:54 / claus"
  2508     "Modified: / 18-06-2010 / 11:34:51 / cg"
  2666     "Modified: / 18-06-2010 / 11:34:51 / cg"
  2521 
  2679 
  2522     pos := codeView characterPositionOfLine:line col:col.
  2680     pos := codeView characterPositionOfLine:line col:col.
  2523     interval := pos to:pos.
  2681     interval := pos to:pos.
  2524 
  2682 
  2525     self
  2683     self
  2526         withNodeValueAtInterval:interval
  2684 	withNodeValueAtInterval:interval
  2527         do:[:value :description |
  2685 	do:[:value :description |
  2528             |valueClassOrSizeString valueString|
  2686 	    |valueClassOrSizeString valueString|
  2529 
  2687 
  2530             valueClassOrSizeString := valueString := ''.
  2688 	    valueClassOrSizeString := valueString := ''.
  2531 
  2689 
  2532             "/ some heuristics as when to show the class name (a purely subjective preference)
  2690 	    "/ some heuristics as when to show the class name (a purely subjective preference)
  2533             value isString ifTrue:[
  2691 	    value isString ifTrue:[
  2534                 value isText ifTrue:[
  2692 		value isText ifTrue:[
  2535                     valueString := '"',(value contractTo:80),'"'.
  2693 		    valueString := '"',(value contractTo:80),'"'.
  2536                 ] ifFalse:[
  2694 		] ifFalse:[
  2537                     valueString := value storeString contractTo:80.
  2695 		    valueString := value storeString contractTo:80.
  2538                 ].
  2696 		].
  2539             ] ifFalse:[
  2697 	    ] ifFalse:[
  2540                 (value isBoolean
  2698 		(value isBoolean
  2541                 or:[ value isInteger
  2699 		or:[ value isInteger
  2542                 or:[ value isSymbol ]]) ifTrue:[
  2700 		or:[ value isSymbol ]]) ifTrue:[
  2543                     valueString := value printString.
  2701 		    valueString := value printString.
  2544                 ] ifFalse:[
  2702 		] ifFalse:[
  2545                     valueClassOrSizeString := ' (',value class name,')'.
  2703 		    valueClassOrSizeString := ' (',value class name,')'.
  2546 
  2704 
  2547                     (value isArray
  2705 		    (value isArray
  2548                     or:[ value isOrderedCollection ]) ifTrue:[
  2706 		    or:[ value isOrderedCollection ]) ifTrue:[
  2549                         valueClassOrSizeString := ' (size=',value size printString,')'.
  2707 			valueClassOrSizeString := ' (size=',value size printString,')'.
  2550                     ].
  2708 		    ].
  2551 
  2709 
  2552                     Error handle:[:ex |
  2710 		    Error handle:[:ex |
  2553                         valueString := '??? (',ex description,')'
  2711 			valueString := '??? (',ex description,')'
  2554                     ] do:[
  2712 		    ] do:[
  2555                         [
  2713 			[
  2556                             valueString := value printString contractTo:80.
  2714 			    valueString := value printString contractTo:80.
  2557                         ] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30.
  2715 			] valueWithWatchDog:[ valueString := value classNameWithArticle ] afterMilliseconds:30.
  2558                     ]
  2716 		    ]
  2559                 ]
  2717 		]
  2560             ].
  2718 	    ].
  2561             description isEmptyOrNil ifTrue:[
  2719 	    description isEmptyOrNil ifTrue:[
  2562                 s := valueString , valueClassOrSizeString
  2720 		s := valueString , valueClassOrSizeString
  2563             ] ifFalse:[
  2721 	    ] ifFalse:[
  2564                 s := description , ': ', valueString, valueClassOrSizeString
  2722 		s := description , ': ', valueString, valueClassOrSizeString
  2565             ].
  2723 	    ].
  2566         ].
  2724 	].
  2567     "/ Transcript showCR:s.
  2725     "/ Transcript showCR:s.
  2568     ^ s
  2726     ^ s
  2569 
  2727 
  2570     "Modified: / 27-04-2010 / 17:51:53 / cg"
  2728     "Modified: / 27-04-2010 / 17:51:53 / cg"
  2571 !
  2729 !
  2572 
  2730 
  2573 helpTextFor:aComponent
  2731 helpTextFor:aComponent
  2574     |s|
  2732     |s|
  2575 
  2733 
  2576     aComponent == abortButton ifTrue:[
  2734     aComponent == abortButton ifTrue:[
  2577         s := 'HELP_ABORT'
  2735 	s := 'HELP_ABORT'
  2578     ].
  2736     ].
  2579     aComponent == terminateButton ifTrue:[
  2737     aComponent == terminateButton ifTrue:[
  2580         s := 'HELP_TERMINATE'
  2738 	s := 'HELP_TERMINATE'
  2581     ].
  2739     ].
  2582     aComponent == continueButton ifTrue:[
  2740     aComponent == continueButton ifTrue:[
  2583         continueButton label = (resources string:'Stop') ifTrue:[
  2741 	continueButton label = (resources string:'Stop') ifTrue:[
  2584             s := 'HELP_STOP'
  2742 	    s := 'HELP_STOP'
  2585         ] ifFalse:[
  2743 	] ifFalse:[
  2586             s := 'HELP_CONTINUE'
  2744 	    s := 'HELP_CONTINUE'
  2587         ]
  2745 	]
  2588     ].
  2746     ].
  2589     aComponent == stepButton ifTrue:[
  2747     aComponent == stepButton ifTrue:[
  2590         s := 'HELP_STEP'
  2748 	s := 'HELP_STEP'
  2591     ].
  2749     ].
  2592     aComponent == nextButton ifTrue:[
  2750     aComponent == nextButton ifTrue:[
  2593         s := 'HELP_NEXT'
  2751 	s := 'HELP_NEXT'
  2594     ].
  2752     ].
  2595     aComponent == nextOverButton ifTrue:[
  2753     aComponent == nextOverButton ifTrue:[
  2596         s := 'HELP_NEXTOVER'
  2754 	s := 'HELP_NEXTOVER'
  2597     ].
  2755     ].
  2598     aComponent == nextOutButton ifTrue:[
  2756     aComponent == nextOutButton ifTrue:[
  2599         s := 'HELP_NEXTOUT'
  2757 	s := 'HELP_NEXTOUT'
  2600     ].
  2758     ].
  2601     aComponent == stepButton ifTrue:[
  2759     aComponent == stepButton ifTrue:[
  2602         s := 'HELP_STEP'
  2760 	s := 'HELP_STEP'
  2603     ].
  2761     ].
  2604     aComponent == sendButton ifTrue:[
  2762     aComponent == sendButton ifTrue:[
  2605         s := 'HELP_SEND'
  2763 	s := 'HELP_SEND'
  2606     ].
  2764     ].
  2607     aComponent == returnButton ifTrue:[
  2765     aComponent == returnButton ifTrue:[
  2608         returnButton enabled ifTrue:[
  2766 	returnButton enabled ifTrue:[
  2609             s := 'HELP_RETURN'
  2767 	    s := 'HELP_RETURN'
  2610         ] ifFalse:[
  2768 	] ifFalse:[
  2611             s := 'HELP_RETURN_DISABLED'
  2769 	    s := 'HELP_RETURN_DISABLED'
  2612         ].
  2770 	].
  2613     ].
  2771     ].
  2614     aComponent == restartButton ifTrue:[
  2772     aComponent == restartButton ifTrue:[
  2615         restartButton enabled ifTrue:[
  2773 	restartButton enabled ifTrue:[
  2616             s := 'HELP_RESTART'
  2774 	    s := 'HELP_RESTART'
  2617         ] ifFalse:[
  2775 	] ifFalse:[
  2618             s := 'HELP_RESTART_DISABLED'
  2776 	    s := 'HELP_RESTART_DISABLED'
  2619         ].
  2777 	].
  2620     ].
  2778     ].
  2621     aComponent == resendButton ifTrue:[
  2779     aComponent == resendButton ifTrue:[
  2622         resendButton enabled ifTrue:[
  2780 	resendButton enabled ifTrue:[
  2623             s := 'HELP_RESEND'
  2781 	    s := 'HELP_RESEND'
  2624         ] ifFalse:[
  2782 	] ifFalse:[
  2625             s := 'HELP_RESEND_DISABLED'
  2783 	    s := 'HELP_RESEND_DISABLED'
  2626         ].
  2784 	].
  2627     ].
  2785     ].
  2628     aComponent == contextView ifTrue:[
  2786     aComponent == contextView ifTrue:[
  2629         s := 'HELP_WALKBACK'
  2787 	s := 'HELP_WALKBACK'
  2630     ].
  2788     ].
  2631     aComponent == codeView ifTrue:[
  2789     aComponent == codeView ifTrue:[
  2632         s := 'HELP_CODEVIEW'
  2790 	s := 'HELP_CODEVIEW'
  2633     ].
  2791     ].
  2634     aComponent == monitorToggle ifTrue:[
  2792     aComponent == monitorToggle ifTrue:[
  2635         s := 'HELP_MONITOR'
  2793 	s := 'HELP_MONITOR'
  2636     ].
  2794     ].
  2637     aComponent == updateButton ifTrue:[
  2795     aComponent == updateButton ifTrue:[
  2638         s := 'HELP_UPDATE'
  2796 	s := 'HELP_UPDATE'
       
  2797     ].
       
  2798     aComponent == gotoDialogOpenerButton ifTrue:[
       
  2799 	s := 'HELP_GOTO_DIALOG_OPENER'
       
  2800     ].
       
  2801     aComponent == gotoApplicationActionMethodButton ifTrue:[
       
  2802 	s := 'HELP_GOTO_APPLICATION_ACTION'
  2639     ].
  2803     ].
  2640 "/    aComponent == stopButton ifTrue:[
  2804 "/    aComponent == stopButton ifTrue:[
  2641 "/        s := 'HELP_STOP'
  2805 "/        s := 'HELP_STOP'
  2642 "/    ].
  2806 "/    ].
  2643     (aComponent isComponentOf:receiverInspector) ifTrue:[
  2807     (aComponent isComponentOf:receiverInspector) ifTrue:[
  2644         s := 'HELP_REC_INSP'
  2808 	s := 'HELP_REC_INSP'
  2645     ].
  2809     ].
  2646     (aComponent isComponentOf:contextInspector) ifTrue:[
  2810     (aComponent isComponentOf:contextInspector) ifTrue:[
  2647         s := 'HELP_CON_INSP'
  2811 	s := 'HELP_CON_INSP'
  2648     ].
  2812     ].
  2649 
  2813 
  2650     s notNil ifTrue:[
  2814     s notNil ifTrue:[
  2651         ^ resources stringWithCRs:s
  2815 	^ resources stringWithCRs:s
  2652     ].
  2816     ].
  2653     ^ nil
  2817     ^ nil
  2654 
  2818 
  2655     "Modified: 29.8.1995 / 23:38:54 / claus"
  2819     "Modified: 29.8.1995 / 23:38:54 / claus"
  2656     "Modified: 4.3.1997 / 01:54:03 / cg"
  2820     "Modified: 4.3.1997 / 01:54:03 / cg"
  2677     "closing the debugger implies an abort or continue"
  2841     "closing the debugger implies an abort or continue"
  2678 
  2842 
  2679     |m|
  2843     |m|
  2680 
  2844 
  2681     withConfirmation ifTrue:[
  2845     withConfirmation ifTrue:[
  2682         self checkIfCodeIsReallyModified ifTrue:[
  2846 	self checkIfCodeIsReallyModified ifTrue:[
  2683             (self confirm:('Code modified - exit anyway ?'))
  2847 	    (self confirm:('Code modified - exit anyway ?'))
  2684             ifFalse:[
  2848 	    ifFalse:[
  2685                 ^ self
  2849 		^ self
  2686             ]
  2850 	    ]
  2687         ]
  2851 	]
  2688     ].
  2852     ].
  2689 
  2853 
  2690     self autoUpdateOff.
  2854     self autoUpdateOff.
  2691 
  2855 
  2692     (m := contextView middleButtonMenu) notNil ifTrue:[m hide].
  2856     (m := contextView middleButtonMenu) notNil ifTrue:[m hide].
  2693     inspecting ifFalse:[
  2857     inspecting ifFalse:[
  2694         "I am running on top of a process, abort or continue it"
  2858 	"I am running on top of a process, abort or continue it"
  2695 
  2859 
  2696         windowGroup notNil ifTrue:[
  2860 	windowGroup notNil ifTrue:[
  2697             windowGroup setProcess:nil.
  2861 	    windowGroup setProcess:nil.
  2698         ].
  2862 	].
  2699         self uncacheMyself.
  2863 	self uncacheMyself.
  2700 
  2864 
  2701         "/
  2865 	"/
  2702         "/ catch invalid return;
  2866 	"/ catch invalid return;
  2703         "/ this happens, when my process has somehow died (quickterminate)
  2867 	"/ this happens, when my process has somehow died (quickterminate)
  2704         "/ and I am a leftOver view, which gets terminated via the launchers
  2868 	"/ and I am a leftOver view, which gets terminated via the launchers
  2705         "/ #destroy-window function.
  2869 	"/ #destroy-window function.
  2706         "/
  2870 	"/
  2707         Context cannotReturnSignal handle:[:ex |
  2871 	Context cannotReturnSignal handle:[:ex |
  2708             'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR.
  2872 	    'DebugView [info]: OOPS - non regular debugView closing(1)' infoPrintCR.
  2709             self uncacheMyself.
  2873 	    self uncacheMyself.
  2710             Debugger newDebugger.
  2874 	    Debugger newDebugger.
  2711             ex return.
  2875 	    ex return.
  2712         ] do:[
  2876 	] do:[
  2713             AbortOperationRequest isHandled ifTrue:[
  2877 	    AbortOperationRequest isHandled ifTrue:[
  2714                 self doAbort.
  2878 		self doAbort.
  2715             ] ifFalse:[
  2879 	    ] ifFalse:[
  2716                 self doContinue
  2880 		self doContinue
  2717             ]
  2881 	    ]
  2718         ].
  2882 	].
  2719         "/ We don't reach this point normally
  2883 	"/ We don't reach this point normally
  2720         'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR.
  2884 	'DebugView [info]: OOPS - non regular debugView closing(2)' infoPrintCR.
  2721     ].
  2885     ].
  2722 
  2886 
  2723     Debugger newDebugger.
  2887     Debugger newDebugger.
  2724     "/ since I am going to be destroyed, remove me from the cache
  2888     "/ since I am going to be destroyed, remove me from the cache
  2725     self uncacheMyself.
  2889     self uncacheMyself.
  2733     |menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel
  2897     |menu menuPanel mH panel bpanel bH bpanel1 bH1 bpanel2 bH2 codePanel
  2734      newLayout v exceptionAndTogglePanel codeToggleLabels userPrefs|
  2898      newLayout v exceptionAndTogglePanel codeToggleLabels userPrefs|
  2735 
  2899 
  2736     super initialize.
  2900     super initialize.
  2737 
  2901 
  2738     font := font onDevice:device.
       
  2739     userPrefs := UserPreferences current.
  2902     userPrefs := UserPreferences current.
  2740 
  2903 
  2741     verboseBacktrace := userPrefs verboseBacktraceInDebugger ? false.
  2904     self verboseBacktraceHolder value:(userPrefs verboseBacktraceInDebugger).
       
  2905 
  2742     hideSupportCode := userPrefs hideSupportCodeInDebugger ? false.
  2906     hideSupportCode := userPrefs hideSupportCodeInDebugger ? false.
  2743     ignoreBreakpoints := true.    "/ ignore halts/breakpoints in doIts of
  2907     ignoreBreakpoints := true.    "/ ignore halts/breakpoints in doIts of
  2744                                   "/ the debugger
  2908 				  "/ the debugger
  2745 
  2909 
  2746     busy := false.
  2910     busy := false.
  2747     exclusive := false.
  2911     exclusive := false.
  2748     inspecting := false.
  2912     inspecting := false.
  2749     exitAction := nil.
  2913     exitAction := nil.
  2763     mH := menuPanel preferredHeight.
  2927     mH := menuPanel preferredHeight.
  2764     menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)).
  2928     menuPanel origin:(0.0 @ 0.0) corner:(1.0 @ (mH)).
  2765 
  2929 
  2766     newLayout := userPrefs useNewLayoutInDebugger.
  2930     newLayout := userPrefs useNewLayoutInDebugger.
  2767     newLayout ifFalse:[
  2931     newLayout ifFalse:[
  2768         bpanel := HorizontalPanelView in:self.
  2932 	bpanel := HorizontalPanelView in:self.
  2769 
  2933 
  2770         self initializeButtonsIn:bpanel.
  2934 	self initializeButtonsIn:bpanel.
  2771 
  2935 
  2772         bH := bpanel preferredHeight + 5.
  2936 	bH := bpanel preferredHeight + 5.
  2773         bpanel origin:(0.0 @ mH)
  2937 	bpanel origin:(0.0 @ mH)
  2774                extent:(1.0 @ bH).
  2938 	       extent:(1.0 @ bH).
  2775         panel := VariableVerticalPanel
  2939 	panel := VariableVerticalPanel
  2776                             origin:(0.0 @ (mH + bH))
  2940 			    origin:(0.0 @ (mH + bH))
  2777                             corner:(1.0 @ 1.0)
  2941 			    corner:(1.0 @ 1.0)
  2778                             in:self.
  2942 			    in:self.
  2779 
  2943 
  2780         v := self initializeContextListViewIn:panel.
  2944 	v := self initializeContextListViewIn:panel.
  2781         v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25).
  2945 	v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25).
  2782 
  2946 
  2783         codePanel := View in:panel.
  2947 	codePanel := View in:panel.
  2784         v := self initializeCodeViewIn:codePanel.
  2948 	v := self initializeCodeViewIn:codePanel.
  2785         v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
  2949 	v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
  2786         codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75).
  2950 	codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75).
  2787 
  2951 
  2788         v := self initializeInspectorViewsIn:panel.
  2952 	v := self initializeInspectorViewsIn:panel.
  2789         v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0).
  2953 	v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0).
  2790 
  2954 
  2791     ] ifTrue:[
  2955     ] ifTrue:[
  2792         bpanel1 := HorizontalPanelView in:self.
  2956 	bpanel1 := HorizontalPanelView in:self.
  2793         self initializeButtons1In:bpanel1.
  2957 	self initializeButtons1In:bpanel1.
  2794 
  2958 
  2795         contextInfoLabel := Label label:''.
  2959 	contextInfoLabel := Label label:''.
  2796         contextInfoLabel adjust:#left.
  2960 	contextInfoLabel adjust:#left.
  2797         bpanel1 add:contextInfoLabel.
  2961 	bpanel1 add:contextInfoLabel.
  2798 
  2962 
  2799         bH1 := bpanel1 preferredHeight + 5.
  2963 	bH1 := bpanel1 preferredHeight + 5.
  2800         bpanel1 origin:(0.0 @ mH)
  2964 	bpanel1 origin:(0.0 @ mH)
  2801                 extent:(1.0 @ bH1).
  2965 		extent:(1.0 @ bH1).
  2802         panel := VariableVerticalPanel
  2966 	panel := VariableVerticalPanel
  2803                             origin:(0.0 @ (mH + bH1))
  2967 			    origin:(0.0 @ (mH + bH1))
  2804                             corner:(1.0 @ 1.0)
  2968 			    corner:(1.0 @ 1.0)
  2805                                 in:self.
  2969 				in:self.
  2806         "/ panel showHandle:true.
  2970 	"/ panel showHandle:true.
  2807         "/ panel handlePosition:#left.
  2971 	"/ panel handlePosition:#left.
  2808 
  2972 
  2809         v := self initializeContextListViewIn:panel.
  2973 	v := self initializeContextListViewIn:panel.
  2810         v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25).
  2974 	v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25).
  2811 
  2975 
  2812         codePanel := View in:panel.
  2976 	codePanel := View in:panel.
  2813         bpanel2 := HorizontalPanelView in:codePanel.
  2977 	bpanel2 := HorizontalPanelView in:codePanel.
  2814         self initializeButtons2In:bpanel2.
  2978 	self initializeButtons2In:bpanel2.
  2815 
  2979 
  2816         bH2 := bpanel2 preferredHeight + 5.
  2980 	bH2 := bpanel2 preferredHeight + 5.
  2817         bpanel2 origin:(0.0 @ 0.0)
  2981 	bpanel2 origin:(0.0 @ 0.0)
  2818                 extent:(1.0 @ bH2).
  2982 		extent:(1.0 @ bH2).
  2819 
  2983 
  2820         exceptionInfoLabel := Label label:''.
  2984 	exceptionInfoLabel := Label label:''.
  2821         exceptionInfoLabel adjust:#left.
  2985 	exceptionInfoLabel adjust:#left.
  2822 
  2986 
  2823         exceptionAndTogglePanel := HorizontalPanelView in:codePanel.
  2987 	exceptionAndTogglePanel := HorizontalPanelView in:codePanel.
  2824         exceptionAndTogglePanel horizontalLayout:#left.
  2988 	exceptionAndTogglePanel horizontalLayout:#left.
  2825         exceptionAndTogglePanel
  2989 	exceptionAndTogglePanel
  2826             geometryLayout:
  2990 	    geometryLayout:
  2827                 ((LayoutFrame
  2991 		((LayoutFrame
  2828                     origin:(0.0 @ 0.0)
  2992 		    origin:(0.0 @ 0.0)
  2829                     corner:(1.0 @ 0.0))
  2993 		    corner:(1.0 @ 0.0))
  2830                         topOffset:bH2;
  2994 			topOffset:bH2;
  2831                         bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6);
  2995 			bottomOffset:(bH2 + exceptionInfoLabel preferredHeight + 6);
  2832                         rightOffset:-2).
  2996 			rightOffset:-2).
  2833 
  2997 
  2834         methodCodeToggleSelectionHolder := 1 asValue.
  2998 	methodCodeToggleSelectionHolder := 1 asValue.
  2835         methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self.
  2999 	methodCodeToggleSelectionHolder onChangeSend:#methodCodeToggleChanged to:self.
  2836         codeToggleLabels := resources array:{ 
  3000 	codeToggleLabels := resources array:{
  2837                     'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened . 
  3001 		    'Showing Original Code (being executed, but obsolete)' asText backgroundColorizeAllWith:Color red lightened .
  2838                     'Showing Current Code'                                 asText backgroundColorizeAllWith:Color green lightened . 
  3002 		    'Showing Current Code'                                 asText backgroundColorizeAllWith:Color green lightened .
  2839                   }.
  3003 		  }.
  2840         methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel.
  3004 	methodCodeToggle := PopUpList label:codeToggleLabels first in:exceptionAndTogglePanel.
  2841         methodCodeToggle list:codeToggleLabels.
  3005 	methodCodeToggle list:codeToggleLabels.
  2842         methodCodeToggle useIndex:true.
  3006 	methodCodeToggle useIndex:true.
  2843         methodCodeToggle model:methodCodeToggleSelectionHolder.
  3007 	methodCodeToggle model:methodCodeToggleSelectionHolder.
  2844         methodCodeToggle beInvisible.
  3008 	methodCodeToggle beInvisible.
  2845 
  3009 
  2846         exceptionAndTogglePanel add:exceptionInfoLabel.
  3010 	exceptionAndTogglePanel add:exceptionInfoLabel.
  2847 
  3011 
  2848         v := self initializeCodeViewIn:codePanel.
  3012 	v := self initializeCodeViewIn:codePanel.
  2849         v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0).
  3013 	v origin:(0.0 @ (bH2+exceptionInfoLabel preferredHeight+6)) corner:(1.0 @ 1.0).
  2850         codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75).
  3014 	codePanel origin:(0.0 @ 0.25) corner:(1.0 @ 0.75).
  2851 
  3015 
  2852         v := self initializeInspectorViewsIn:panel.
  3016 	v := self initializeInspectorViewsIn:panel.
  2853         v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0).
  3017 	v origin:(0.0 @ 0.75) corner:(1.0 @ 1.0).
  2854     ].
  3018     ].
  2855 
  3019 
  2856     DefaultDebuggerBackgroundColor notNil ifTrue:[
  3020     DefaultDebuggerBackgroundColor notNil ifTrue:[
  2857         self allViewBackground:DefaultDebuggerBackgroundColor.
  3021 	self allViewBackground:DefaultDebuggerBackgroundColor.
  2858     ].
  3022     ].
  2859     LastExtent notNil ifTrue:[
  3023     LastExtent notNil ifTrue:[
  2860         self extent:LastExtent.
  3024 	self extent:LastExtent.
  2861     ].
  3025     ].
  2862     LastOrigin notNil ifTrue:[
  3026     LastOrigin notNil ifTrue:[
  2863         self origin:LastOrigin.
  3027 	self origin:LastOrigin.
  2864     ].
  3028     ].
  2865 
  3029 
  2866     "
  3030     "
  2867      Debugger newDebugger
  3031      Debugger newDebugger
  2868     "
  3032     "
  2870     "Modified: / 27-07-2012 / 14:46:07 / cg"
  3034     "Modified: / 27-07-2012 / 14:46:07 / cg"
  2871 !
  3035 !
  2872 
  3036 
  2873 initializeAbortButtonIn:bpanel
  3037 initializeAbortButtonIn:bpanel
  2874     abortButton := Button
  3038     abortButton := Button
  2875                 label:(resources string:'Abort')
  3039 		label:(resources string:'Abort')
  2876                 action:[
  3040 		action:[
  2877                     abortButton turnOffWithoutRedraw.
  3041 		    abortButton turnOffWithoutRedraw.
  2878                     self doAbort
  3042 		    self doAbort
  2879                 ]
  3043 		]
  2880                 in:bpanel.
  3044 		in:bpanel.
  2881 
  3045 
  2882     "Created: / 17.11.2001 / 20:56:47 / cg"
  3046     "Created: / 17.11.2001 / 20:56:47 / cg"
  2883     "Modified: / 17.11.2001 / 20:57:17 / cg"
  3047     "Modified: / 17.11.2001 / 20:57:17 / cg"
  2884 !
  3048 !
  2885 
  3049 
  2907 
  3071 
  2908     separator := View extent:(50 @ 5) in:bpanel.
  3072     separator := View extent:(50 @ 5) in:bpanel.
  2909     separator borderWidth:0; level:0.
  3073     separator borderWidth:0; level:0.
  2910 
  3074 
  2911     self initializeGotoDialogOpenerButtonIn:bpanel.
  3075     self initializeGotoDialogOpenerButtonIn:bpanel.
       
  3076     self initializeGotoApplicationActionMethodButtonIn:bpanel.
  2912     self initializeDefineButtonIn:bpanel.
  3077     self initializeDefineButtonIn:bpanel.
       
  3078 
  2913     (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[
  3079     (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[
  2914         separator := View extent:(10 @ 5) in:bpanel.
  3080 	separator := View extent:(10 @ 5) in:bpanel.
  2915         separator borderWidth:0; level:0.
  3081 	separator borderWidth:0; level:0.
  2916         self initializeReportButtonIn:bpanel.
  3082 	self initializeReportButtonIn:bpanel.
  2917     ].
  3083     ].
  2918     "Modified: / 17.11.2001 / 21:02:59 / cg"
  3084     "Modified: / 17.11.2001 / 21:02:59 / cg"
  2919 !
  3085 !
  2920 
  3086 
  2921 initializeButtons2In:bpanel
  3087 initializeButtons2In:bpanel
  3052     separator := View extent:(30 @ 5) in:bpanel.
  3218     separator := View extent:(30 @ 5) in:bpanel.
  3053     separator borderWidth:0; level:0.
  3219     separator borderWidth:0; level:0.
  3054 
  3220 
  3055     self initializeDefineButtonIn:bpanel.
  3221     self initializeDefineButtonIn:bpanel.
  3056     (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[
  3222     (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[
  3057         self initializeReportButtonIn:bpanel.
  3223 	self initializeReportButtonIn:bpanel.
  3058     ].
  3224     ].
  3059 
  3225 
  3060 
  3226 
  3061     "Created: / 17.11.2001 / 20:56:20 / cg"
  3227     "Created: / 17.11.2001 / 20:56:20 / cg"
  3062     "Modified: / 17.11.2001 / 21:03:18 / cg"
  3228     "Modified: / 17.11.2001 / 21:03:18 / cg"
  3064 
  3230 
  3065 initializeCodeViewIn:panel
  3231 initializeCodeViewIn:panel
  3066     |scrollableCodeView|
  3232     |scrollableCodeView|
  3067 
  3233 
  3068     (UserPreferences current useCodeView2In: #Debugger) ifTrue:[
  3234     (UserPreferences current useCodeView2In: #Debugger) ifTrue:[
  3069         scrollableCodeView := codeView := Tools::CodeView2 new.
  3235 	scrollableCodeView := codeView := Tools::CodeView2 new.
  3070         codeView model: ValueHolder new.
  3236 	codeView model: ValueHolder new.
  3071         codeView methodHolder: ValueHolder new.
  3237 	codeView methodHolder: ValueHolder new.
  3072         codeView classHolder: ValueHolder new.
  3238 	codeView classHolder: ValueHolder new.
  3073     ] ifFalse:[
  3239     ] ifFalse:[
  3074         scrollableCodeView := HVScrollableView
  3240 	scrollableCodeView := HVScrollableView
  3075                     for:CodeView
  3241 		    for:CodeView
  3076                     miniScrollerH:true
  3242 		    miniScrollerH:true
  3077                     miniScrollerV:false
  3243 		    miniScrollerV:false
  3078                     in:panel.
  3244 		    in:panel.
  3079 
  3245 
  3080         codeView := scrollableCodeView scrolledView.
  3246 	codeView := scrollableCodeView scrolledView.
  3081         codeView enableMotionEvents. "/ for active help
  3247 	codeView enableMotionEvents. "/ for active help
  3082     ].
  3248     ].
  3083 
  3249 
  3084      (UserPreferences current showAcceptCancelBarInBrowser 
  3250      (UserPreferences current showAcceptCancelBarInBrowser
  3085         and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
  3251 	and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
  3086         ViewWithAcceptAndCancelBar notNil ifTrue:[
  3252 	ViewWithAcceptAndCancelBar notNil ifTrue:[
  3087             |v|
  3253 	    |v|
  3088 
  3254 
  3089             v := ViewWithAcceptAndCancelBar new.
  3255 	    v := ViewWithAcceptAndCancelBar new.
  3090             v slaveView:scrollableCodeView.
  3256 	    v slaveView:scrollableCodeView.
  3091             v reallyModifiedHolder:(codeView isCodeView2 
  3257 	    v reallyModifiedHolder:(codeView isCodeView2
  3092                                         ifTrue:[ codeView reallyModifiedChannel ]
  3258 					ifTrue:[ codeView reallyModifiedChannel ]
  3093                                         ifFalse:[ 
  3259 					ifFalse:[
  3094                                             BlockValue
  3260 					    BlockValue
  3095                                                 with:[:m |
  3261 						with:[:m |
  3096                                                     |same|
  3262 						    |same|
  3097 
  3263 
  3098                                                     same := (codeView contentsAsString string = currentMethod source string).
  3264 						    same := (codeView contentsAsString string = currentMethod source string).
  3099                                                     codeView modifiedChannel setValue:false.  "/ so it triggers again
  3265 						    codeView modifiedChannel setValue:false.  "/ so it triggers again
  3100                                                     same not.
  3266 						    same not.
  3101                                                 ]
  3267 						]
  3102                                                 argument:codeView modifiedChannel 
  3268 						argument:codeView modifiedChannel
  3103                                         ]).
  3269 					]).
  3104             v cancelAction:
  3270 	    v cancelAction:
  3105                 [
  3271 		[
  3106                     "/ codeView setClipboardText:(codeView contents).   "/ for undo
  3272 		    "/ codeView setClipboardText:(codeView contents).   "/ for undo
  3107                     codeView device rememberInCopyBufferHistory:(codeView contents).  "/ for undo
  3273 		    codeView device rememberInCopyBufferHistory:(codeView contents).  "/ for undo
  3108                     codeView contents:(currentMethod source).
  3274 		    codeView contents:(currentMethod source).
  3109                     codeView modifiedChannel setValue:false; changed.   "/ trigger
  3275 		    codeView modifiedChannel setValue:false; changed.   "/ trigger
  3110                     codeView requestFocus.
  3276 		    codeView requestFocus.
  3111                 ].
  3277 		].
  3112             v compareAction:
  3278 	    v compareAction:
  3113                 [
  3279 		[
  3114                     v := DiffCodeView
  3280 		    v := DiffCodeView
  3115                             openOn:codeView contentsAsString
  3281 			    openOn:codeView contentsAsString
  3116                             label:(resources string:'Changed definition (to be accepted ?)')
  3282 			    label:(resources string:'Changed definition (to be accepted ?)')
  3117                             and:currentMethod source
  3283 			    and:currentMethod source
  3118                             label:(resources string:'Method''s Original Code').
  3284 			    label:(resources string:'Method''s Original Code').
  3119                     v label:(resources string:'Changed Code in Debugger').
  3285 		    v label:(resources string:'Changed Code in Debugger').
  3120                     v waitUntilVisible.
  3286 		    v waitUntilVisible.
  3121                     "/ codeView requestFocus
  3287 		    "/ codeView requestFocus
  3122                 ].
  3288 		].
  3123             scrollableCodeView := v.
  3289 	    scrollableCodeView := v.
  3124         ]
  3290 	]
  3125     ].
  3291     ].
  3126 
  3292 
  3127     panel add:scrollableCodeView.
  3293     panel add:scrollableCodeView.
  3128     ^ scrollableCodeView
  3294     ^ scrollableCodeView
  3129 
  3295 
  3132 
  3298 
  3133 initializeContextListViewIn:panel
  3299 initializeContextListViewIn:panel
  3134     |v|
  3300     |v|
  3135 
  3301 
  3136     v := HVScrollableView
  3302     v := HVScrollableView
  3137                 for:SelectionInListView
  3303 		for:SelectionInListView
  3138                 miniScrollerH:true
  3304 		miniScrollerH:true
  3139                 miniScrollerV:false
  3305 		miniScrollerV:false
  3140                 in:panel.
  3306 		in:panel.
  3141     v autoHideHorizontalScrollBar:true.
  3307     v autoHideHorizontalScrollBar:true.
  3142 
  3308 
  3143     contextView := v scrolledView.
  3309     contextView := v scrolledView.
  3144     contextView action:[:lineNr | self showSelection:lineNr].
  3310     contextView action:[:lineNr | self showSelection:lineNr].
  3145     contextView doubleClickAction:[:line | self browseImplementingClass].
  3311     contextView doubleClickAction:[:line | self browseImplementingClass].
  3156     contextView middleButtonMenu:(self middleButtonMenu).
  3322     contextView middleButtonMenu:(self middleButtonMenu).
  3157 !
  3323 !
  3158 
  3324 
  3159 initializeContinueButtonIn:bpanel
  3325 initializeContinueButtonIn:bpanel
  3160     continueButton := Button
  3326     continueButton := Button
  3161                 label:(resources string:'Continue')
  3327 		label:(resources string:'Continue')
  3162                 action:[
  3328 		action:[
  3163                     continueButton turnOffWithoutRedraw.
  3329 		    continueButton turnOffWithoutRedraw.
  3164                     self doContinue
  3330 		    self doContinue
  3165                 ]
  3331 		]
  3166                 in:bpanel.
  3332 		in:bpanel.
  3167 
  3333 
  3168     "Created: / 17.11.2001 / 20:57:34 / cg"
  3334     "Created: / 17.11.2001 / 20:57:34 / cg"
  3169 !
  3335 !
  3170 
  3336 
  3171 initializeDefineButtonIn:bpanel
  3337 initializeDefineButtonIn:bpanel
  3172     defineButton := Button
  3338     defineButton := Button
  3173                 label:(resources string:'Define')
  3339 		label:(resources string:'Define')
  3174                 action:[
  3340 		action:[
  3175                     defineButton turnOffWithoutRedraw.
  3341 		    defineButton turnOffWithoutRedraw.
  3176                     self doDefine
  3342 		    self doDefine
  3177                 ]
  3343 		]
  3178                 in:bpanel.
  3344 		in:bpanel.
  3179     defineButton beInvisible
  3345     defineButton beInvisible
  3180 
  3346 
  3181     "Created: / 17.11.2001 / 21:02:48 / cg"
  3347     "Created: / 17.11.2001 / 21:02:48 / cg"
       
  3348 !
       
  3349 
       
  3350 initializeGotoApplicationActionMethodButtonIn:bpanel
       
  3351     gotoApplicationActionMethodButton := Button
       
  3352 		label:(resources string:'Goto Responsible Application Method')
       
  3353 		action:[
       
  3354 		    gotoApplicationActionMethodButton turnOffWithoutRedraw.
       
  3355 		    self doGotoApplicationActionMethod
       
  3356 		]
       
  3357 		in:bpanel.
       
  3358 
       
  3359     gotoApplicationActionMethodButton beInvisible
  3182 !
  3360 !
  3183 
  3361 
  3184 initializeGotoDialogOpenerButtonIn:bpanel
  3362 initializeGotoDialogOpenerButtonIn:bpanel
  3185     gotoDialogOpenerButton := Button
  3363     gotoDialogOpenerButton := Button
  3186                 label:(resources string:'Goto Dialog Opener')
  3364 		label:(resources string:'Goto Dialog Opener')
  3187                 action:[
  3365 		action:[
  3188                     gotoDialogOpenerButton turnOffWithoutRedraw.
  3366 		    gotoDialogOpenerButton turnOffWithoutRedraw.
  3189                     self doGotoDialogOpener
  3367 		    self doGotoDialogOpener
  3190                 ]
  3368 		]
  3191                 in:bpanel.
  3369 		in:bpanel.
  3192 
  3370 
  3193     gotoDialogOpenerButton beInvisible
  3371     gotoDialogOpenerButton beInvisible
  3194 !
  3372 !
  3195 
  3373 
  3196 initializeInspectorViewsIn:panel
  3374 initializeInspectorViewsIn:panel
  3197     |hpanel|
  3375     |hpanel|
  3198 
  3376 
  3199     hpanel := VariableHorizontalPanel in:panel.
  3377     hpanel := VariableHorizontalPanel in:panel.
  3200 
  3378 
  3201     receiverInspector := InspectorView
  3379     receiverInspector := InspectorView
  3202                                 origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)
  3380 				origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)
  3203                                     in:hpanel.
  3381 				    in:hpanel.
  3204     receiverInspector fieldListLabel:'Receiver'.
  3382     receiverInspector fieldListLabel:'Receiver'.
  3205 
  3383 
  3206     contextInspector := ContextInspectorView
  3384     contextInspector := ContextInspectorView
  3207                                 origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  3385 				origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  3208                                     in:hpanel.
  3386 				    in:hpanel.
  3209     contextInspector fieldListLabel:'Context'.
  3387     contextInspector fieldListLabel:'Context'.
  3210 
  3388 
  3211     ^ hpanel
  3389     ^ hpanel
  3212 !
  3390 !
  3213 
  3391 
  3214 initializeNextButtonIn:bpanel
  3392 initializeNextButtonIn:bpanel
  3215     nextButton := Button
  3393     nextButton := Button
  3216                 label:(resources string:'Debug_Next')
  3394 		label:(resources string:'Debug_Next')
  3217                 action:[
  3395 		action:[
  3218                     stepButton turnOff.
  3396 		    stepButton turnOff.
  3219                     self doNext
  3397 		    self doNext
  3220                 ]
  3398 		]
  3221                 in:bpanel.
  3399 		in:bpanel.
  3222 
  3400 
  3223     "Created: / 17.11.2001 / 20:59:38 / cg"
  3401     "Created: / 17.11.2001 / 20:59:38 / cg"
  3224 !
  3402 !
  3225 
  3403 
  3226 initializeReportButtonIn:bpanel
  3404 initializeReportButtonIn:bpanel
  3227     reportButton := Button
  3405     reportButton := Button
  3228                 label:(resources string:'Report by Mail...')
  3406 		label:(resources string:'Report by Mail...')
  3229                 action:[
  3407 		action:[
  3230                     reportButton turnOffWithoutRedraw.
  3408 		    reportButton turnOffWithoutRedraw.
  3231                     self doOpenReportMailApp.
  3409 		    self doOpenReportMailApp.
  3232                 ]
  3410 		]
  3233                 in:bpanel.
  3411 		in:bpanel.
  3234 
  3412 
  3235     "Created: / 17.11.2001 / 21:02:20 / cg"
  3413     "Created: / 17.11.2001 / 21:02:20 / cg"
  3236 !
  3414 !
  3237 
  3415 
  3238 initializeResendButtonIn:bpanel
  3416 initializeResendButtonIn:bpanel
  3239     resendButton := Button
  3417     resendButton := Button
  3240                 label:(resources string:'Resend')
  3418 		label:(resources string:'Resend')
  3241                 action:[
  3419 		action:[
  3242                     resendButton turnOff.
  3420 		    resendButton turnOff.
  3243                     self doResend
  3421 		    self doResend
  3244                 ]
  3422 		]
  3245                 in:bpanel.
  3423 		in:bpanel.
  3246 
  3424 
  3247     "/ if we have this, we do not need the restart button
  3425     "/ if we have this, we do not need the restart button
  3248     restartButton beInvisible.
  3426     restartButton beInvisible.
  3249 !
  3427 !
  3250 
  3428 
  3251 initializeRestartButtonIn:bpanel
  3429 initializeRestartButtonIn:bpanel
  3252     restartButton := Button
  3430     restartButton := Button
  3253                 label:(resources string:'Restart')
  3431 		label:(resources string:'Restart')
  3254                 action:[
  3432 		action:[
  3255                     restartButton turnOff.
  3433 		    restartButton turnOff.
  3256                     self doRestart
  3434 		    self doRestart
  3257                 ]
  3435 		]
  3258                 in:bpanel.
  3436 		in:bpanel.
  3259 
  3437 
  3260     "Created: / 17.11.2001 / 20:58:52 / cg"
  3438     "Created: / 17.11.2001 / 20:58:52 / cg"
  3261 !
  3439 !
  3262 
  3440 
  3263 initializeReturnButtonIn:bpanel
  3441 initializeReturnButtonIn:bpanel
  3264     returnButton := Button
  3442     returnButton := Button
  3265                 label:(resources string:'Return')
  3443 		label:(resources string:'Return')
  3266                 action:[
  3444 		action:[
  3267                     returnButton turnOff.
  3445 		    returnButton turnOff.
  3268                     self doReturn
  3446 		    self doReturn
  3269                 ]
  3447 		]
  3270                 in:bpanel.
  3448 		in:bpanel.
  3271 
  3449 
  3272     "Created: / 17.11.2001 / 20:58:22 / cg"
  3450     "Created: / 17.11.2001 / 20:58:22 / cg"
  3273 !
  3451 !
  3274 
  3452 
  3275 initializeSendButtonIn:bpanel
  3453 initializeSendButtonIn:bpanel
  3276     sendButton := Button
  3454     sendButton := Button
  3277                 label:(resources string:'Send')
  3455 		label:(resources string:'Send')
  3278                 action:[
  3456 		action:[
  3279                     sendButton turnOff.
  3457 		    sendButton turnOff.
  3280                     self doSend
  3458 		    self doSend
  3281                 ]
  3459 		]
  3282                 in:bpanel.
  3460 		in:bpanel.
  3283 
  3461 
  3284     "Created: / 17.11.2001 / 21:01:20 / cg"
  3462     "Created: / 17.11.2001 / 21:01:20 / cg"
  3285 !
  3463 !
  3286 
  3464 
  3287 initializeStepButtonIn:bpanel
  3465 initializeStepButtonIn:bpanel
  3288     stepButton := Button
  3466     stepButton := Button
  3289                 label:(resources string:'Debug_Step')
  3467 		label:(resources string:'Debug_Step')
  3290                 action:[
  3468 		action:[
  3291                     stepButton turnOff.
  3469 		    stepButton turnOff.
  3292                     self doStep
  3470 		    self doStep
  3293                 ]
  3471 		]
  3294                 in:bpanel.
  3472 		in:bpanel.
  3295 
  3473 
  3296     "Created: / 17.11.2001 / 21:00:13 / cg"
  3474     "Created: / 17.11.2001 / 21:00:13 / cg"
  3297 !
  3475 !
  3298 
  3476 
  3299 initializeTerminateButtonIn:bpanel
  3477 initializeTerminateButtonIn:bpanel
  3300     terminateButton := Button
  3478     terminateButton := Button
  3301                 label:(resources string:'Debug_Terminate')
  3479 		label:(resources string:'Debug_Terminate')
  3302                 action:[
  3480 		action:[
  3303                     terminateButton turnOffWithoutRedraw.
  3481 		    terminateButton turnOffWithoutRedraw.
  3304                     self doTerminate
  3482 		    self doTerminate
  3305                 ]
  3483 		]
  3306                 in:bpanel.
  3484 		in:bpanel.
  3307 
  3485 
  3308     terminateButton backgroundColor:Color red lightened.
  3486     terminateButton backgroundColor:Color red lightened.
  3309     "/ terminateButton foregroundColor:Color red.
  3487     "/ terminateButton foregroundColor:Color red.
  3310 
  3488 
  3311     "Created: / 17.11.2001 / 21:02:20 / cg"
  3489     "Created: / 17.11.2001 / 21:02:20 / cg"
  3313 
  3491 
  3314 postRealize
  3492 postRealize
  3315     super postRealize.
  3493     super postRealize.
  3316 
  3494 
  3317     inspecting ifTrue:[
  3495     inspecting ifTrue:[
  3318         inspectedProcess notNil ifTrue:[
  3496 	inspectedProcess notNil ifTrue:[
  3319             "
  3497 	    "
  3320              set prio somewhat higher (by 2, to allow walkBack-update process
  3498 	     set prio somewhat higher (by 2, to allow walkBack-update process
  3321              to run between mine and the debugged processes prio)
  3499 	     to run between mine and the debugged processes prio)
  3322             "
  3500 	    "
  3323             Processor activeProcess
  3501 	    Processor activeProcess
  3324                 priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)).
  3502 		priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)).
  3325         ]
  3503 	]
  3326     ].
  3504     ].
  3327 
  3505 
  3328     self sensor addEventListener:self.
  3506     self sensor addEventListener:self.
  3329 
  3507 
  3330     "Created: 24.7.1997 / 18:17:44 / cg"
  3508     "Created: 24.7.1997 / 18:17:44 / cg"
  3332 
  3510 
  3333 reinitialize
  3511 reinitialize
  3334     "/ redefined - since the debugView runs on top of
  3512     "/ redefined - since the debugView runs on top of
  3335     "/ the debuggee, there would be no event loop for me.
  3513     "/ the debuggee, there would be no event loop for me.
  3336 
  3514 
  3337     drawableId notNil ifTrue:[
  3515     self drawableId notNil ifTrue:[
  3338         ^ self
  3516 	^ self
  3339     ].
  3517     ].
  3340     "physically create the view & subviews"
  3518     "physically create the view & subviews"
  3341     self recreate.
  3519     self recreate.
  3342 
       
  3343 !
  3520 !
  3344 
  3521 
  3345 releaseDebuggee
  3522 releaseDebuggee
  3346     "We have to be careful to release all refs to the debuggee,
  3523     "We have to be careful to release all refs to the debuggee,
  3347      because we may be in the cache.
  3524      because we may be in the cache.
  3356     receiverInspector release.
  3533     receiverInspector release.
  3357     contextInspector release.
  3534     contextInspector release.
  3358     inspectedProcess := nil.
  3535     inspectedProcess := nil.
  3359     contextArray := nil.
  3536     contextArray := nil.
  3360     ((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[
  3537     ((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[
  3361         selectedContext := nil.
  3538 	selectedContext := nil.
  3362     ].
  3539     ].
  3363     actualContext := firstContext := nil.
  3540     actualContext := firstContext := nil.
  3364     steppedContext := wrapperContext := nil.
  3541     steppedContext := wrapperContext := nil.
  3365     catchBlock := nil.
  3542     catchBlock := nil.
  3366     grabber := nil.
  3543     grabber := nil.
  3373 setLabelFor:aMessage in:aProcess
  3550 setLabelFor:aMessage in:aProcess
  3374     |l lines processNameOrNil pidOrNil osPidString|
  3551     |l lines processNameOrNil pidOrNil osPidString|
  3375 
  3552 
  3376     lines := aMessage asStringCollection.
  3553     lines := aMessage asStringCollection.
  3377     lines size > 1 ifTrue:[
  3554     lines size > 1 ifTrue:[
  3378         l := lines first
  3555 	l := lines first
  3379     ] ifFalse:[
  3556     ] ifFalse:[
  3380         l := aMessage.
  3557 	l := aMessage.
  3381     ].
  3558     ].
  3382 
  3559 
  3383     l := l , ' ('.
  3560     l := l , ' ('.
  3384     Error handle:[:ex |
  3561     Error handle:[:ex |
  3385         l := l , '???'
  3562 	l := l , '???'
  3386     ] do:[
  3563     ] do:[
  3387         processNameOrNil := aProcess name.
  3564 	processNameOrNil := aProcess name.
  3388         processNameOrNil notNil ifTrue:[
  3565 	processNameOrNil notNil ifTrue:[
  3389             l := l , (processNameOrNil contractTo:20) , ''.
  3566 	    l := l , (processNameOrNil contractTo:20) , ''.
  3390         ].
  3567 	].
  3391         pidOrNil := aProcess id printString.
  3568 	pidOrNil := aProcess id printString.
  3392         l := l , '[' , pidOrNil , ']'.
  3569 	l := l , '[' , pidOrNil , ']'.
  3393     ].
  3570     ].
  3394     l := l , ')'.
  3571     l := l , ')'.
  3395     self label:l.
  3572     self label:l.
  3396 
  3573 
  3397     ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[
  3574     ((ShowThreadID == true) and:[OperatingSystem isMSDOSlike]) ifTrue:[
  3398         osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'.
  3575 	osPidString := ' {threadID: ',OperatingSystem getThreadId printString,'}'.
  3399     ].
  3576     ].
  3400 
  3577 
  3401     exceptionInfoLabel notNil ifTrue:[
  3578     exceptionInfoLabel notNil ifTrue:[
  3402         exceptionInfoLabel
  3579 	exceptionInfoLabel
  3403             label:(resources
  3580 	    label:(resources
  3404                     string:'%1 in process %2 [%3]%4'
  3581 		    string:'%1 in process %2 [%3]%4'
  3405                     with:(lines first colorizeAllWith:Color red)
  3582 		    with:(lines first colorizeAllWith:Color red)
  3406                     with:(processNameOrNil ? '')
  3583 		    with:(processNameOrNil ? '')
  3407                     with:(pidOrNil ? '')
  3584 		    with:(pidOrNil ? '')
  3408                     with:(osPidString ? ''))
  3585 		    with:(osPidString ? ''))
  3409     ].
  3586     ].
  3410 
  3587 
  3411     "Modified: / 06-07-2006 / 12:43:19 / cg"
  3588     "Modified: / 06-07-2006 / 12:43:19 / cg"
  3412 ! !
  3589 ! !
  3413 
  3590 
  3414 !DebugView methodsFor:'interrupt handling'!
  3591 !DebugView methodsFor:'interrupt handling'!
  3415 
  3592 
  3416 contextInterrupt
  3593 contextInterrupt
  3417     DebuggingDebugger == true ifTrue:[
  3594     DebuggingDebugger == true ifTrue:[
  3418         'contextIRQ' printCR.
  3595 	'contextIRQ' printCR.
  3419         thisContext methodHome sender fullPrint.
  3596 	thisContext methodHome sender fullPrint.
  3420     ].
  3597     ].
  3421     self stepOrNext
  3598     self stepOrNext
  3422 
  3599 
  3423     "Modified: / 30.10.1997 / 21:22:25 / cg"
  3600     "Modified: / 30.10.1997 / 21:22:25 / cg"
  3424 !
  3601 !
  3425 
  3602 
  3426 stepInterrupt
  3603 stepInterrupt
  3427     DebuggingDebugger == true ifTrue:[
  3604     DebuggingDebugger == true ifTrue:[
  3428         'stepIRQ' print.
  3605 	'stepIRQ' print.
  3429         "/ ' in ' print. thisContext sender fullPrint.
  3606 	"/ ' in ' print. thisContext sender fullPrint.
  3430         '' printCR.
  3607 	'' printCR.
  3431     ].
  3608     ].
  3432     Processor yield.
  3609     Processor yield.
  3433     self stepOrNext
  3610     self stepOrNext
  3434 
  3611 
  3435     "Modified: / 20-07-2012 / 14:06:54 / cg"
  3612     "Modified: / 20-07-2012 / 14:06:54 / cg"
  3436 !
  3613 !
  3437 
  3614 
  3438 stepOrNext
  3615 stepOrNext
  3439     |where here con s isWrap method wrappedMethod 
  3616     |where here con s isWrap method wrappedMethod
  3440      originalMethodOfWrappedMethod originalMethodsContext
  3617      originalMethodOfWrappedMethod originalMethodsContext
  3441      inBlock subBlockLeft ignore contextBelow wrapContext
  3618      inBlock subBlockLeft ignore contextBelow wrapContext
  3442      leftWrap enteredWrap anyStepBlocks
  3619      leftWrap enteredWrap anyStepBlocks
  3443      oneMore initiallyShown inBlockBelow receiver processName|
  3620      oneMore initiallyShown inBlockBelow receiver processName|
  3444 
  3621 
  3450     "/ '' printCR
  3627     "/ '' printCR
  3451 
  3628 
  3452     processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'.
  3629     processName := (Processor activeProcess nameOrId),' [',Processor activeProcess id printString,']'.
  3453 
  3630 
  3454     skipLineNr == #return ifTrue:[
  3631     skipLineNr == #return ifTrue:[
  3455         self label:('stepping context returned ' , ' (process: ' , processName , ')').
  3632 	self label:('stepping context returned ' , ' (process: ' , processName , ')').
  3456         here := thisContext sender sender.
  3633 	here := thisContext sender sender.
  3457         here setLineNumber:nil.
  3634 	here setLineNumber:nil.
  3458         here := nil.
  3635 	here := nil.
  3459         con := thisContext sender sender sender.
  3636 	con := thisContext sender sender sender.
  3460 
  3637 
  3461         HaltInterrupt handle:[:ex |
  3638 	HaltInterrupt handle:[:ex |
  3462             ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR.
  3639 	    ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [stepOrNext]' bindWith:ex suspendedContext) infoPrintCR.
  3463             ex proceed
  3640 	    ex proceed
  3464         ] do:[
  3641 	] do:[
  3465             self enter:con select:nil.
  3642 	    self enter:con select:nil.
  3466         ].
  3643 	].
  3467         con := nil.
  3644 	con := nil.
  3468         ^ self
  3645 	^ self
  3469     ].
  3646     ].
  3470 
  3647 
  3471 "/    "/
  3648 "/    "/
  3472 "/    "/ should no longer happen
  3649 "/    "/ should no longer happen
  3473 "/    "/
  3650 "/    "/
  3476 "/        self enter:thisContext sender.
  3653 "/        self enter:thisContext sender.
  3477 "/        ^ self
  3654 "/        ^ self
  3478 "/    ].
  3655 "/    ].
  3479 
  3656 
  3480     Processor activeProcess ~~ inspectedProcess ifTrue:[
  3657     Processor activeProcess ~~ inspectedProcess ifTrue:[
  3481         'DebugView [info]: stray step interrupt' infoPrintCR.
  3658 	'DebugView [info]: stray step interrupt' infoPrintCR.
  3482         ^ self
  3659 	^ self
  3483     ].
  3660     ].
  3484 
  3661 
  3485     here := thisContext.        "stepInterrupt"
  3662     here := thisContext.        "stepInterrupt"
  3486     here := here sender.        "the caller; step- or contextIRQ"
  3663     here := here sender.        "the caller; step- or contextIRQ"
  3487     here := here sender.        "the interrupted context"
  3664     here := here sender.        "the interrupted context"
  3488 
  3665 
  3489     DebuggingDebugger2 == true ifTrue:[
  3666     DebuggingDebugger2 == true ifTrue:[
  3490         '***************************' printCR.
  3667 	'***************************' printCR.
  3491         'here in ' print.
  3668 	'here in ' print.
  3492         inWrap ifTrue:['(wrap) ' print.].
  3669 	inWrap ifTrue:['(wrap) ' print.].
  3493         ((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print.
  3670 	((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print.
  3494         here selector printCR.
  3671 	here selector printCR.
  3495         'stepping in ' print. 
  3672 	'stepping in ' print.
  3496         steppedContext notNil ifTrue:[    
  3673 	steppedContext notNil ifTrue:[
  3497             ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print.
  3674 	    ((ObjectMemory addressOf:steppedContext) printStringRadix:16) print. ' ' print.
  3498         ].
  3675 	].
  3499         steppedContext printCR.
  3676 	steppedContext printCR.
  3500     ].
  3677     ].
  3501 
  3678 
  3502     "/ when single stepping, ignore breakpoints
  3679     "/ when single stepping, ignore breakpoints
  3503     here selector == #break ifTrue:[
  3680     here selector == #break ifTrue:[
  3504         (here receiver isKindOf:Breakpoint) ifTrue:[
  3681 	(here receiver isKindOf:Breakpoint) ifTrue:[
  3505             false "here receiver isEnabled" ifFalse:[
  3682 	    false "here receiver isEnabled" ifFalse:[
  3506                 con := nil.
  3683 		con := nil.
  3507                 where := nil. here := nil.
  3684 		where := nil. here := nil.
  3508                 StepInterruptPending := 1.
  3685 		StepInterruptPending := 1.
  3509                 InterruptPending := 1.
  3686 		InterruptPending := 1.
  3510                 InStepInterrupt := nil.
  3687 		InStepInterrupt := nil.
  3511                 ^ self
  3688 		^ self
  3512             ]
  3689 	    ]
  3513         ].
  3690 	].
  3514     ].
  3691     ].
  3515 
  3692 
  3516     "/ kludge: a bug-workaround;
  3693     "/ kludge: a bug-workaround;
  3517     "/ I should not see those...
  3694     "/ I should not see those...
  3518 
  3695 
  3519     here selector == #ioInterrupt ifTrue:[
  3696     here selector == #ioInterrupt ifTrue:[
  3520         DebuggingDebugger2 == true ifTrue:[
  3697 	DebuggingDebugger2 == true ifTrue:[
  3521             'oops - should not get that one' printCR.
  3698 	    'oops - should not get that one' printCR.
  3522         ].
  3699 	].
  3523         Processor ioInterrupt.
  3700 	Processor ioInterrupt.
  3524         StepInterruptPending := 1.
  3701 	StepInterruptPending := 1.
  3525         InterruptPending := 1.
  3702 	InterruptPending := 1.
  3526         where := nil. here := nil.
  3703 	where := nil. here := nil.
  3527         InStepInterrupt := nil.
  3704 	InStepInterrupt := nil.
  3528         ^ self
  3705 	^ self
  3529     ].
  3706     ].
  3530 
  3707 
  3531     stepUntilEntering notNil ifTrue:[
  3708     stepUntilEntering notNil ifTrue:[
  3532         DebuggingDebugger2 == true ifTrue:[
  3709 	DebuggingDebugger2 == true ifTrue:[
  3533             'check if entering ' print. stepUntilEntering printCR.
  3710 	    'check if entering ' print. stepUntilEntering printCR.
  3534         ].
  3711 	].
  3535         (stepUntilEntering match:here selector) ifTrue:[
  3712 	(stepUntilEntering match:here selector) ifTrue:[
  3536             DebuggingDebugger2 == true ifTrue:[
  3713 	    DebuggingDebugger2 == true ifTrue:[
  3537                 'entering...' printCR.
  3714 		'entering...' printCR.
  3538             ].
  3715 	    ].
  3539             self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')').
  3716 	    self label:('arrived at ' , stepUntilEntering , ' (process: ' , processName , ')').
  3540 
  3717 
  3541             lastStepUntilEntering := stepUntilEntering.
  3718 	    lastStepUntilEntering := stepUntilEntering.
  3542             stepUntilEntering := nil.
  3719 	    stepUntilEntering := nil.
  3543             self enter:here select:nil.
  3720 	    self enter:here select:nil.
  3544             con := nil.
  3721 	    con := nil.
  3545             ^ self
  3722 	    ^ self
  3546         ].
  3723 	].
  3547         "/ see if stepping context is still active ...
  3724 	"/ see if stepping context is still active ...
  3548 
  3725 
  3549         con := here.
  3726 	con := here.
  3550 
  3727 
  3551         DebuggingDebugger2 == true ifTrue:[
  3728 	DebuggingDebugger2 == true ifTrue:[
  3552             'start searching at: ' print.
  3729 	    'start searching at: ' print.
  3553             con fullPrint.
  3730 	    con fullPrint.
  3554         ].
  3731 	].
  3555         [con notNil and:[con ~~ steppedContext]] whileTrue:[
  3732 	[con notNil and:[con ~~ steppedContext]] whileTrue:[
  3556             con := con sender
  3733 	    con := con sender
  3557         ].
  3734 	].
  3558         con notNil ifTrue:[
  3735 	con notNil ifTrue:[
  3559             DebuggingDebugger2 == true ifTrue:[
  3736 	    DebuggingDebugger2 == true ifTrue:[
  3560                 'steppingContext still active - continue stepping' printCR.
  3737 		'steppingContext still active - continue stepping' printCR.
  3561             ].
  3738 	    ].
  3562             con := nil.
  3739 	    con := nil.
  3563             where := nil. here := nil.
  3740 	    where := nil. here := nil.
  3564             StepInterruptPending := 1.
  3741 	    StepInterruptPending := 1.
  3565             InterruptPending := 1.
  3742 	    InterruptPending := 1.
  3566             InStepInterrupt := nil.
  3743 	    InStepInterrupt := nil.
  3567             ^ self
  3744 	    ^ self
  3568         ].
  3745 	].
  3569         stepUntilEntering := nil.
  3746 	stepUntilEntering := nil.
  3570     ].
  3747     ].
  3571 
  3748 
  3572     "
  3749     "
  3573      kludge to hide breakpoint wrappers in the context list and when single stepping:
  3750      kludge to hide breakpoint wrappers in the context list and when single stepping:
  3574          check if we are in a wrapper method's hidden setup-sequence
  3751 	 check if we are in a wrapper method's hidden setup-sequence
  3575          if so, ignore the interrupt and continue single sending.
  3752 	 if so, ignore the interrupt and continue single sending.
  3576          Assume we are in a wrappers setup code, if there is another context above,
  3753 	 Assume we are in a wrappers setup code, if there is another context above,
  3577          which is for the wrapper method (i.e. if there is context with an originalmethod
  3754 	 which is for the wrapper method (i.e. if there is context with an originalmethod
  3578          of some other context higher in the caller chain
  3755 	 of some other context higher in the caller chain
  3579     "
  3756     "
  3580     isWrap := false.
  3757     isWrap := false.
  3581     subBlockLeft := false.
  3758     subBlockLeft := false.
  3582     leftWrap := enteredWrap := false.
  3759     leftWrap := enteredWrap := false.
  3583 
  3760 
  3584     inWrap ifTrue:[
  3761     inWrap ifTrue:[
  3585         "/ situation1:
  3762 	"/ situation1:
  3586         "/   valueWithReceiver or other
  3763 	"/   valueWithReceiver or other
  3587         "/   foo (wrapped)                 <- wrapContext
  3764 	"/   foo (wrapped)                 <- wrapContext
  3588         "/
  3765 	"/
  3589         "/ situation2:
  3766 	"/ situation2:
  3590         "/   foo (original)                <- originalMethodsContext
  3767 	"/   foo (original)                <- originalMethodsContext
  3591         "/   valueWithReceiver
  3768 	"/   valueWithReceiver
  3592         "/   foo (wrapped)                 <- wrapContext
  3769 	"/   foo (wrapped)                 <- wrapContext
  3593         "/
  3770 	"/
  3594         "/ situation3:
  3771 	"/ situation3:
  3595         "/   other
  3772 	"/   other
  3596         "/   foo (original)                <- originalMethodsContext
  3773 	"/   foo (original)                <- originalMethodsContext
  3597         "/   valueWithReceiver
  3774 	"/   valueWithReceiver
  3598         "/   foo (wrapped)                 <- wrapContext
  3775 	"/   foo (wrapped)                 <- wrapContext
  3599         "/
  3776 	"/
  3600         "/ situation4:
  3777 	"/ situation4:
  3601         "/   ... many-contexts ... (more than 8)
  3778 	"/   ... many-contexts ... (more than 8)
  3602         "/   possibly foo (original)  
  3779 	"/   possibly foo (original)
  3603         "/   valueWithReceiver or other
  3780 	"/   valueWithReceiver or other
  3604         "/   foo (wrapped)                 
  3781 	"/   foo (wrapped)
  3605         "/
  3782 	"/
  3606 
  3783 
  3607         "/ search for the wrapped method's context and extract the original method 
  3784 	"/ search for the wrapped method's context and extract the original method
  3608         where := here.
  3785 	where := here.
  3609         8 timesRepeat:[
  3786 	8 timesRepeat:[
  3610             wrapContext isNil ifTrue:[
  3787 	    wrapContext isNil ifTrue:[
  3611                 where notNil ifTrue:[
  3788 		where notNil ifTrue:[
  3612                     DebuggingDebugger2 == true ifTrue:[ 
  3789 		    DebuggingDebugger2 == true ifTrue:[
  3613                         ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print.
  3790 			((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print.
  3614                         where printCR 
  3791 			where printCR
  3615                     ].
  3792 		    ].
  3616                     where isBlockContext ifFalse:[
  3793 		    where isBlockContext ifFalse:[
  3617                         method := where method.
  3794 			method := where method.
  3618                         (method notNil and:[method isWrapped]) ifTrue:[
  3795 			(method notNil and:[method isWrapped]) ifTrue:[
  3619                             originalMethodOfWrappedMethod := method originalMethod.
  3796 			    originalMethodOfWrappedMethod := method originalMethod.
  3620                             wrappedMethod := method.
  3797 			    wrappedMethod := method.
  3621                             wrapContext := where.
  3798 			    wrapContext := where.
  3622                         ].
  3799 			].
  3623                     ].
  3800 		    ].
  3624                     where := where sender
  3801 		    where := where sender
  3625                 ]
  3802 		]
  3626             ]
  3803 	    ]
  3627         ].
  3804 	].
  3628         DebuggingDebugger2 == true ifTrue:[ 
  3805 	DebuggingDebugger2 == true ifTrue:[
  3629             'wrap-context is: ' print.
  3806 	    'wrap-context is: ' print.
  3630             wrapContext notNil ifTrue:[    
  3807 	    wrapContext notNil ifTrue:[
  3631                 ((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print.
  3808 		((ObjectMemory addressOf:wrapContext) printStringRadix:16) print. ' ' print.
  3632             ].
  3809 	    ].
  3633             wrapContext printCR 
  3810 	    wrapContext printCR
  3634         ].
  3811 	].
  3635         originalMethodOfWrappedMethod isNil ifTrue:[
  3812 	originalMethodOfWrappedMethod isNil ifTrue:[
  3636             'oops no wrap?' errorPrintCR.
  3813 	    'oops no wrap?' errorPrintCR.
  3637         ].
  3814 	].
  3638     ].
  3815     ].
  3639 
  3816 
  3640     (inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[
  3817     (inWrap and:[ originalMethodOfWrappedMethod notNil ]) ifTrue:[
  3641         isWrap := false.
  3818 	isWrap := false.
  3642         "/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ].
  3819 	"/ DebuggingDebugger2 ifTrue:[ '----------->' print. originalMethodOfWrappedMethod printCR ].
  3643         where := here.
  3820 	where := here.
  3644         8 timesRepeat:[
  3821 	8 timesRepeat:[
  3645             originalMethodsContext isNil ifTrue:[
  3822 	    originalMethodsContext isNil ifTrue:[
  3646                 where notNil ifTrue:[
  3823 		where notNil ifTrue:[
  3647                     DebuggingDebugger2 ifTrue:[ 
  3824 		    DebuggingDebugger2 ifTrue:[
  3648                         ((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print.
  3825 			((ObjectMemory addressOf:where) printStringRadix:16) print. ' ' print.
  3649                         where printCR 
  3826 			where printCR
  3650                     ].
  3827 		    ].
  3651                     where isBlockContext ifFalse:[
  3828 		    where isBlockContext ifFalse:[
  3652                         method := where method.
  3829 			method := where method.
  3653                         method == originalMethodOfWrappedMethod ifTrue:[
  3830 			method == originalMethodOfWrappedMethod ifTrue:[
  3654                             originalMethodsContext := here.
  3831 			    originalMethodsContext := here.
  3655                             where == here ifTrue:[
  3832 			    where == here ifTrue:[
  3656                                 "/ situation2
  3833 				"/ situation2
  3657                                 DebuggingDebugger2 ifTrue:[ 's2' printCR ].
  3834 				DebuggingDebugger2 ifTrue:[ 's2' printCR ].
  3658                                 isWrap := true.
  3835 				isWrap := true.
  3659                                 "/ here setSender:(wrapContext sender). --- leads to a crash
  3836 				"/ here setSender:(wrapContext sender). --- leads to a crash
  3660                             ] ifFalse: [
  3837 			    ] ifFalse: [
  3661                                 "/ situation3
  3838 				"/ situation3
  3662                                 DebuggingDebugger2 ifTrue:[ 's3' printCR ].
  3839 				DebuggingDebugger2 ifTrue:[ 's3' printCR ].
  3663                                 inWrap := false.
  3840 				inWrap := false.
  3664                                 isWrap := false. 
  3841 				isWrap := false.
  3665                             ].
  3842 			    ].
  3666                             steppedContext := where
  3843 			    steppedContext := where
  3667 "/                        ] ifFalse:[
  3844 "/                        ] ifFalse:[
  3668 "/                            where selector == wrapContext selector ifTrue:[
  3845 "/                            where selector == wrapContext selector ifTrue:[
  3669 "/                                where receiver == wrapContext receiver ifTrue:[
  3846 "/                                where receiver == wrapContext receiver ifTrue:[
  3670 "/                                    '!!!!!!!!!!!!!!!!!!!!!!!!' printCR.
  3847 "/                                    '!!!!!!!!!!!!!!!!!!!!!!!!' printCR.
  3671 "/                                    method printCR.
  3848 "/                                    method printCR.
  3672 "/                                    method originalMethod printCR.
  3849 "/                                    method originalMethod printCR.
  3673 "/                                    originalMethodOfWrappedMethod printCR.
  3850 "/                                    originalMethodOfWrappedMethod printCR.
  3674 "/                                    '!!!!!!!!!!!!!!!!!!!!!!!!' printCR.
  3851 "/                                    '!!!!!!!!!!!!!!!!!!!!!!!!' printCR.
  3675 "/                                ].
  3852 "/                                ].
  3676 "/                            ].
  3853 "/                            ].
  3677                         ].
  3854 			].
  3678                         where := where sender
  3855 			where := where sender
  3679                     ].
  3856 		    ].
  3680                 ].
  3857 		].
  3681             ].
  3858 	    ].
  3682         ].
  3859 	].
  3683         DebuggingDebugger2 ifTrue:[ 
  3860 	DebuggingDebugger2 ifTrue:[
  3684             'original method-context is: ' print.
  3861 	    'original method-context is: ' print.
  3685             originalMethodsContext notNil ifTrue:[
  3862 	    originalMethodsContext notNil ifTrue:[
  3686                 ((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print.
  3863 		((ObjectMemory addressOf:originalMethodsContext) printStringRadix:16) print. ' ' print.
  3687             ].
  3864 	    ].
  3688             originalMethodsContext printCR 
  3865 	    originalMethodsContext printCR
  3689         ].
  3866 	].
  3690         originalMethodsContext isNil ifTrue:[
  3867 	originalMethodsContext isNil ifTrue:[
  3691             originalMethodOfWrappedMethod isNil ifTrue:[
  3868 	    originalMethodOfWrappedMethod isNil ifTrue:[
  3692                 "/ situation4
  3869 		"/ situation4
  3693                 DebuggingDebugger2 ifTrue:[ 's4' printCR ].
  3870 		DebuggingDebugger2 ifTrue:[ 's4' printCR ].
  3694                 DebuggingDebugger2 ifTrue:[ steppedContext printCR ].
  3871 		DebuggingDebugger2 ifTrue:[ steppedContext printCR ].
  3695                 isWrap := false.
  3872 		isWrap := false.
  3696             ] ifFalse:[
  3873 	    ] ifFalse:[
  3697                 "/ situation1
  3874 		"/ situation1
  3698                 DebuggingDebugger2 ifTrue:[ 's1' printCR ].
  3875 		DebuggingDebugger2 ifTrue:[ 's1' printCR ].
  3699                 isWrap := true.
  3876 		isWrap := true.
  3700                 "/ steppedContext := wrapContext
  3877 		"/ steppedContext := wrapContext
  3701             ].
  3878 	    ].
  3702         ].
  3879 	].
  3703     ].
  3880     ].
  3704 
  3881 
  3705     isWrap ifTrue:[
  3882     isWrap ifTrue:[
  3706         DebuggingDebugger2 == true ifTrue:[
  3883 	DebuggingDebugger2 == true ifTrue:[
  3707             'ignore wrap' printCR.
  3884 	    'ignore wrap' printCR.
  3708         ].
  3885 	].
  3709 
  3886 
  3710         "/
  3887 	"/
  3711         "/ ignore, while in wrappers hidden setup
  3888 	"/ ignore, while in wrappers hidden setup
  3712         "/
  3889 	"/
  3713         where := nil. here := nil.
  3890 	where := nil. here := nil.
  3714         ObjectMemory flushInlineCaches.
  3891 	ObjectMemory flushInlineCaches.
  3715 
  3892 
  3716         DebuggingDebugger2 == true ifTrue:[
  3893 	DebuggingDebugger2 == true ifTrue:[
  3717             skipLineNr == #return ifTrue:[
  3894 	    skipLineNr == #return ifTrue:[
  3718                 'skipRet in wrap' printCR.
  3895 		'skipRet in wrap' printCR.
  3719             ]
  3896 	    ]
  3720         ].
  3897 	].
  3721 
  3898 
  3722         StepInterruptPending := 1.
  3899 	StepInterruptPending := 1.
  3723         InterruptPending := 1.
  3900 	InterruptPending := 1.
  3724         InStepInterrupt := nil.
  3901 	InStepInterrupt := nil.
  3725         ^ self
  3902 	^ self
  3726     ].
  3903     ].
  3727 
  3904 
  3728     inBlock := inBlockBelow := anyStepBlocks := false.
  3905     inBlock := inBlockBelow := anyStepBlocks := false.
  3729 
  3906 
  3730     DebuggingDebugger2 == true ifTrue:[
  3907     DebuggingDebugger2 == true ifTrue:[
  3731         'bigStep is: ' print. bigStep printCR.
  3908 	'bigStep is: ' print. bigStep printCR.
  3732         'steppedContext is: ' print. steppedContext printCR.
  3909 	'steppedContext is: ' print. steppedContext printCR.
  3733     ].
  3910     ].
  3734 
  3911 
  3735     "/
  3912     "/
  3736     "/ is this for a send or a step/next ?
  3913     "/ is this for a send or a step/next ?
  3737     "/
  3914     "/
  3738     (bigStep
  3915     (bigStep
  3739     and:[steppedContext notNil]) ifTrue:[
  3916     and:[steppedContext notNil]) ifTrue:[
  3740         "
  3917 	"
  3741          a step or next - ignore all contexts below the interesting one
  3918 	 a step or next - ignore all contexts below the interesting one
  3742         "
  3919 	"
  3743         where := here.      "the interrupted context"
  3920 	where := here.      "the interrupted context"
  3744         contextBelow := nil.
  3921 	contextBelow := nil.
  3745 
  3922 
  3746         where home notNil ifTrue:[
  3923 	where home notNil ifTrue:[
  3747             "/
  3924 	    "/
  3748             "/ in a block called by 'our' context ?
  3925 	    "/ in a block called by 'our' context ?
  3749             "/
  3926 	    "/
  3750             where home == steppedContext ifTrue:[
  3927 	    where home == steppedContext ifTrue:[
  3751                 "/ '*block*' printCR.
  3928 		"/ '*block*' printCR.
  3752                 inBlock := true
  3929 		inBlock := true
  3753             ]
  3930 	    ]
  3754         ].
  3931 	].
  3755 
  3932 
  3756         where == steppedContext ifFalse:[
  3933 	where == steppedContext ifFalse:[
  3757             where := where sender.
  3934 	    where := where sender.
  3758 
  3935 
  3759             where notNil ifTrue:[
  3936 	    where notNil ifTrue:[
  3760                 where home == steppedContext ifTrue:[
  3937 		where home == steppedContext ifTrue:[
  3761                     "/ '*block*' printCR.
  3938 		    "/ '*block*' printCR.
  3762                     inBlock := true.
  3939 		    inBlock := true.
  3763                 ]
  3940 		]
  3764             ].
  3941 	    ].
  3765 
  3942 
  3766 "/ 'looking for ' print.
  3943 "/ 'looking for ' print.
  3767 "/  (steppedContextAddress printStringRadix:16)print. '' printCR.
  3944 "/  (steppedContextAddress printStringRadix:16)print. '' printCR.
  3768 
  3945 
  3769 "/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR.
  3946 "/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR.
  3770 "/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR.
  3947 "/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR.
  3771 
  3948 
  3772             where == steppedContext ifFalse:[
  3949 	    where == steppedContext ifFalse:[
  3773 
  3950 
  3774                 "/ check if we are in a context below steppedContext
  3951 		"/ check if we are in a context below steppedContext
  3775                 "/ (i.e. if steppedContext can be reached from
  3952 		"/ (i.e. if steppedContext can be reached from
  3776                 "/  interrupted context. Not using context-ref but its
  3953 		"/  interrupted context. Not using context-ref but its
  3777                 "/  address to avoid creation of many useless contexts.)
  3954 		"/  address to avoid creation of many useless contexts.)
  3778 
  3955 
  3779                 inBlock ifFalse:[
  3956 		inBlock ifFalse:[
  3780                     [where notNil] whileTrue:[
  3957 		    [where notNil] whileTrue:[
  3781 
  3958 
  3782                         "/ if either the receiver or any arg of this context
  3959 			"/ if either the receiver or any arg of this context
  3783                         "/ is a block of the steppedContext, we must really
  3960 			"/ is a block of the steppedContext, we must really
  3784                         "/ do a single step. Otherwise, stepping through a
  3961 			"/ do a single step. Otherwise, stepping through a
  3785                         "/ do:-loop would be very difficult.
  3962 			"/ do:-loop would be very difficult.
  3786                         receiver := where receiver.
  3963 			receiver := where receiver.
  3787 where selector == #critical: ifTrue:[
  3964 where selector == #critical: ifTrue:[
  3788 anyStepBlocks := true.
  3965 anyStepBlocks := true.
  3789 ] ifFalse:[
  3966 ] ifFalse:[
  3790                         (receiver isBlock
  3967 			(receiver isBlock
  3791                         and:[(receiver isKindOf:Block)
  3968 			and:[(receiver isKindOf:Block)
  3792                         and:[receiver homeMethod == steppedContext method
  3969 			and:[receiver homeMethod == steppedContext method
  3793                              "receiver home == steppedContext"]])
  3970 			     "receiver home == steppedContext"]])
  3794                         ifTrue:[
  3971 			ifTrue:[
  3795                             anyStepBlocks := true.
  3972 			    anyStepBlocks := true.
  3796                         ] ifFalse:[
  3973 			] ifFalse:[
  3797                             where args do:[:arg |
  3974 			    where args do:[:arg |
  3798                                 (arg isBlock
  3975 				(arg isBlock
  3799                                 and:[(arg isKindOf:Block)
  3976 				and:[(arg isKindOf:Block)
  3800                                 and:[arg homeMethod == steppedContext method
  3977 				and:[arg homeMethod == steppedContext method
  3801                                      "arg home == steppedContext"]])
  3978 				     "arg home == steppedContext"]])
  3802                                 ifTrue:[
  3979 				ifTrue:[
  3803                                     anyStepBlocks := true.
  3980 				    anyStepBlocks := true.
  3804                                 ] ifFalse:[
  3981 				] ifFalse:[
  3805                                     (where methodHome notNil
  3982 				    (where methodHome notNil
  3806                                     and:[where methodHome receiver isBlock
  3983 				    and:[where methodHome receiver isBlock
  3807                                     and:[(where methodHome receiver isKindOf:Block)
  3984 				    and:[(where methodHome receiver isKindOf:Block)
  3808                                     and:[where methodHome receiver homeMethod == steppedContext method
  3985 				    and:[where methodHome receiver homeMethod == steppedContext method
  3809                                          "where methodHome receiver home == steppedContext"]]])
  3986 					 "where methodHome receiver home == steppedContext"]]])
  3810                                     ifTrue:[
  3987 				    ifTrue:[
  3811                                         anyStepBlocks := true.
  3988 					anyStepBlocks := true.
  3812                                     ]
  3989 				    ]
  3813                                 ].
  3990 				].
  3814                             ]
  3991 			    ]
  3815                         ].
  3992 			].
  3816 ].
  3993 ].
  3817                         DebuggingDebugger2 == true ifTrue:[
  3994 			DebuggingDebugger2 == true ifTrue:[
  3818                             ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  3995 			    ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
  3819                             where selector printCR.
  3996 			    where selector printCR.
  3820                         ].
  3997 			].
  3821 
  3998 
  3822                         where == steppedContext ifTrue:[
  3999 			where == steppedContext ifTrue:[
  3823 "/ 'found it - below; ignore' printCR.
  4000 "/ 'found it - below; ignore' printCR.
  3824                             "
  4001 			    "
  3825                              found the interesting context somwehere up in the
  4002 			     found the interesting context somwehere up in the
  3826                              chain. We seem to be still below the interesting one ...
  4003 			     chain. We seem to be still below the interesting one ...
  3827                             "
  4004 			    "
  3828                             tracing == true ifTrue:[
  4005 			    tracing == true ifTrue:[
  3829                                 here printString printCR
  4006 				here printString printCR
  3830                             ].
  4007 			    ].
  3831                             "
  4008 			    "
  3832                               yes, a context below
  4009 			      yes, a context below
  3833                               - continue and schedule another stepInterrupt.
  4010 			      - continue and schedule another stepInterrupt.
  3834                               Must flush caches since optimized methods not always
  4011 			      Must flush caches since optimized methods not always
  3835                               look for pending interrupts
  4012 			      look for pending interrupts
  3836                             "
  4013 			    "
  3837 
  4014 
  3838                             contextBelow notNil ifTrue:[
  4015 			    contextBelow notNil ifTrue:[
  3839 "/ 'prepare for unwind-catch' printCR.
  4016 "/ 'prepare for unwind-catch' printCR.
  3840 "/ 'con= ' print. contextBelow printCR.
  4017 "/ 'con= ' print. contextBelow printCR.
  3841 "/                                contextBelow selector notNil ifTrue:[
  4018 "/                                contextBelow selector notNil ifTrue:[
  3842 "/                                    self label:'single stepping - please wait ...(' , contextBelow selector , ')'.
  4019 "/                                    self label:'single stepping - please wait ...(' , contextBelow selector , ')'.
  3843 "/                                ].
  4020 "/                                ].
  3844 
  4021 
  3845                                 DebuggingDebugger2 == true ifTrue:[
  4022 				DebuggingDebugger2 == true ifTrue:[
  3846                                     'below stepCon; continue until unwind of: ' print.
  4023 				    'below stepCon; continue until unwind of: ' print.
  3847                                     contextBelow printCR.
  4024 				    contextBelow printCR.
  3848                                 ].
  4025 				].
  3849                                 Processor activeProcess forceInterruptOnReturnOf:contextBelow.
  4026 				Processor activeProcess forceInterruptOnReturnOf:contextBelow.
  3850                                 StepInterruptPending := nil.
  4027 				StepInterruptPending := nil.
  3851                             ] ifFalse:[
  4028 			    ] ifFalse:[
  3852                                 ObjectMemory flushInlineCaches.
  4029 				ObjectMemory flushInlineCaches.
  3853 
  4030 
  3854 "/                                here selector notNil ifTrue:[
  4031 "/                                here selector notNil ifTrue:[
  3855 "/                                    self label:'single stepping - please wait ...(' , here selector , ')'.
  4032 "/                                    self label:'single stepping - please wait ...(' , here selector , ')'.
  3856 "/                                ].
  4033 "/                                ].
  3857 
  4034 
  3858                                 DebuggingDebugger2 == true ifTrue:[
  4035 				DebuggingDebugger2 == true ifTrue:[
  3859                                     'in stepCon; continue single stepping' printCR.
  4036 				    'in stepCon; continue single stepping' printCR.
  3860                                 ].
  4037 				].
  3861                                 StepInterruptPending := 1.
  4038 				StepInterruptPending := 1.
  3862                                 InterruptPending := 1.
  4039 				InterruptPending := 1.
  3863                             ].
  4040 			    ].
  3864                             where := nil. here := nil.
  4041 			    where := nil. here := nil.
  3865                             InStepInterrupt := nil.
  4042 			    InStepInterrupt := nil.
  3866 
  4043 
  3867                             ^ self
  4044 			    ^ self
  3868                         ].
  4045 			].
  3869 
  4046 
  3870                         (steppedContext notNil and:[
  4047 			(steppedContext notNil and:[
  3871                          where methodHome == steppedContext methodHome]) ifTrue:[
  4048 			 where methodHome == steppedContext methodHome]) ifTrue:[
  3872                             inBlockBelow := true.
  4049 			    inBlockBelow := true.
  3873                         ].
  4050 			].
  3874 
  4051 
  3875                         anyStepBlocks ifFalse:[
  4052 			anyStepBlocks ifFalse:[
  3876                             inBlock ifFalse:[
  4053 			    inBlock ifFalse:[
  3877 "/ workaround a VM bug,
  4054 "/ workaround a VM bug,
  3878 "/ which does not honor interrupt-on-return of block contexts
  4055 "/ which does not honor interrupt-on-return of block contexts
  3879 "/ sigh
  4056 "/ sigh
  3880 where isBlockContext ifFalse:[
  4057 where isBlockContext ifFalse:[
  3881                                 contextBelow := where
  4058 				contextBelow := where
  3882 ].
  4059 ].
  3883                             ]
  4060 			    ]
  3884                         ].
  4061 			].
  3885                         where := where sender
  4062 			where := where sender
  3886                     ].
  4063 		    ].
  3887                     s := 'context returned'.
  4064 		    s := 'Debugger: context returned'.
  3888                     subBlockLeft := true.
  4065 		    subBlockLeft := true.
  3889                 ].
  4066 		].
  3890             ] ifTrue:[
  4067 	    ] ifTrue:[
  3891 "/ 'found it right in sender' printCR.
  4068 "/ 'found it right in sender' printCR.
  3892                 s := 'after step'
  4069 		s := 'Debugger: after step'
  3893             ].
  4070 	    ].
  3894         ] ifTrue:[
  4071 	] ifTrue:[
  3895 "/ 'found it right away' printCR.
  4072 "/ 'found it right away' printCR.
  3896             s := 'after step'
  4073 	    s := 'Debugger: after step'
  3897         ].
  4074 	].
  3898     ] ifFalse:[
  4075     ] ifFalse:[
  3899 "/ ' send' printCR.
  4076 "/ ' send' printCR.
  3900         "
  4077 	"
  3901          a send
  4078 	 a send
  3902         "
  4079 	"
  3903         DebuggingDebugger2 == true ifTrue:[
  4080 	DebuggingDebugger2 == true ifTrue:[
  3904             'clear steppedContext' printCR.
  4081 	    'clear steppedContext' printCR.
  3905         ].
  4082 	].
  3906         steppedContext := nil.
  4083 	steppedContext := nil.
  3907         s := 'after send'
  4084 	s := 'Debugger: after send'
  3908     ].
  4085     ].
  3909 
  4086 
  3910     ignore := false.
  4087     ignore := false.
  3911     (inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[
  4088     (inBlock and:[stepHow == #nextOver or:[stepHow == #nextOut]]) ifTrue:[
  3912         ignore := true.
  4089 	ignore := true.
  3913     ].
  4090     ].
  3914 
  4091 
  3915     "/ handle the case, when a subBlock leaves;
  4092     "/ handle the case, when a subBlock leaves;
  3916     "/ continue stepping in the home context.
  4093     "/ continue stepping in the home context.
  3917 
  4094 
  3918     subBlockLeft ifTrue:[
  4095     subBlockLeft ifTrue:[
  3919         steppedContext home notNil ifTrue:[
  4096 	steppedContext home notNil ifTrue:[
  3920             steppedContext := steppedContext home.
  4097 	    steppedContext := steppedContext home.
  3921             s := 'after step'.
  4098 	    s := 'Debugger: after step'.
  3922             subBlockLeft := false.
  4099 	    subBlockLeft := false.
  3923 "/ DebugView enterUnconditional:thisContext withMessage:'debug'.
  4100 "/ DebugView enterUnconditional:thisContext withMessage:'debug'.
  3924 
  4101 
  3925         ]
  4102 	]
  3926     ].
  4103     ].
  3927 
  4104 
  3928     "
  4105     "
  3929      kludge to hide breakpoint wrappers in the context list:
  4106      kludge to hide breakpoint wrappers in the context list:
  3930          check if we are in a wrapper methods hidden exit-sequence
  4107 	 check if we are in a wrapper methods hidden exit-sequence
  3931          if so, ignore the interrupt and continue single sending
  4108 	 if so, ignore the interrupt and continue single sending
  3932     "
  4109     "
  3933     (where isNil
  4110     (where isNil
  3934     and:[wrapperContext notNil])
  4111     and:[wrapperContext notNil])
  3935     ifTrue:[
  4112     ifTrue:[
  3936         "/ did not find our steppedContext along the chain;
  4113 	"/ did not find our steppedContext along the chain;
  3937         "/ could be in a wrappedMethods exitBlock ...
  4114 	"/ could be in a wrappedMethods exitBlock ...
  3938 
  4115 
  3939         leftWrap ifFalse:[
  4116 	leftWrap ifFalse:[
  3940             where := here.
  4117 	    where := here.
  3941             wrappedMethod := nil.
  4118 	    wrappedMethod := nil.
  3942             5 timesRepeat:[
  4119 	    5 timesRepeat:[
  3943                 where notNil ifTrue:[
  4120 		where notNil ifTrue:[
  3944                     where isBlockContext ifFalse:[
  4121 		    where isBlockContext ifFalse:[
  3945                         method := where method.
  4122 			method := where method.
  3946                         (method notNil and:[method isWrapped]) ifTrue:[
  4123 			(method notNil and:[method isWrapped]) ifTrue:[
  3947                             where == wrapperContext ifTrue:[
  4124 			    where == wrapperContext ifTrue:[
  3948                                 DebuggingDebugger2 == true ifTrue:[
  4125 				DebuggingDebugger2 == true ifTrue:[
  3949                                     'change stepCon fromWrapped: ' print.
  4126 				    'change stepCon fromWrapped: ' print.
  3950                                     steppedContext print.
  4127 				    steppedContext print.
  3951                                     ' to: ' print.
  4128 				    ' to: ' print.
  3952                                     wrapperContext printCR.
  4129 				    wrapperContext printCR.
  3953                                 ].
  4130 				].
  3954 
  4131 
  3955                                 inWrap := true.
  4132 				inWrap := true.
  3956                                 enteredWrap := true.
  4133 				enteredWrap := true.
  3957                                 steppedContext := wrapperContext.
  4134 				steppedContext := wrapperContext.
  3958                                 wrapperContext := nil.
  4135 				wrapperContext := nil.
  3959                             ]
  4136 			    ]
  3960                         ].
  4137 			].
  3961                     ].
  4138 		    ].
  3962                     where := where sender
  4139 		    where := where sender
  3963                 ]
  4140 		]
  3964             ].
  4141 	    ].
  3965         ].
  4142 	].
  3966         enteredWrap ifTrue:[
  4143 	enteredWrap ifTrue:[
  3967             ignore := true
  4144 	    ignore := true
  3968         ]
  4145 	]
  3969     ].
  4146     ].
  3970 
  4147 
  3971     "/
  4148     "/
  3972 
  4149 
  3973     subBlockLeft ifTrue:[
  4150     subBlockLeft ifTrue:[
  3974         "/ special care for stepInterrupt in send,
  4151 	"/ special care for stepInterrupt in send,
  3975         "/ when created a dummy context (lineNr == 1)
  4152 	"/ when created a dummy context (lineNr == 1)
  3976 
  4153 
  3977         steppedContext lineNumber isNil ifTrue:[
  4154 	steppedContext lineNumber isNil ifTrue:[
  3978             steppedContext selector == here sender selector ifTrue:[
  4155 	    steppedContext selector == here sender selector ifTrue:[
  3979                 subBlockLeft := false.
  4156 		subBlockLeft := false.
  3980                 s := 'after step'.
  4157 		s := 'Debugger: after step'.
  3981                 steppedContext := here sender.
  4158 		steppedContext := here sender.
  3982             ].
  4159 	    ].
  3983         ].
  4160 	].
  3984         oneMore := true
  4161 	oneMore := true
  3985     ].
  4162     ].
  3986 
  4163 
  3987     inBlock ifTrue:[
  4164     inBlock ifTrue:[
  3988         DebuggingDebugger2 == true ifTrue:[
  4165 	DebuggingDebugger2 == true ifTrue:[
  3989             'inBlock' printCR.
  4166 	    'inBlock' printCR.
  3990         ].
  4167 	].
  3991         s := 'in block'.
  4168 	s := 'Debugger: in block'.
  3992     ].
  4169     ].
  3993     inBlockBelow ifTrue:[
  4170     inBlockBelow ifTrue:[
  3994         DebuggingDebugger2 == true ifTrue:[
  4171 	DebuggingDebugger2 == true ifTrue:[
  3995             'inBlockBelow' printCR.
  4172 	    'inBlockBelow' printCR.
  3996         ].
  4173 	].
  3997         ignore := true
  4174 	ignore := true
  3998     ].
  4175     ].
  3999 
  4176 
  4000     DebuggingDebugger2 == true ifTrue:[
  4177     DebuggingDebugger2 == true ifTrue:[
  4001         where notNil ifTrue:[
  4178 	where notNil ifTrue:[
  4002             '(' print. steppedContextLineno print. ') ' print.
  4179 	    '(' print. steppedContextLineno print. ') ' print.
  4003             where printCR.
  4180 	    where printCR.
  4004         ].
  4181 	].
  4005     ].
  4182     ].
  4006 
  4183 
  4007     ignore ifFalse:[
  4184     ignore ifFalse:[
  4008         (bigStep
  4185 	(bigStep
  4009         and:[steppedContextLineno notNil
  4186 	and:[steppedContextLineno notNil
  4010         and:[where notNil
  4187 	and:[where notNil
  4011         and:[where lineNumber == steppedContextLineno]]]) ifTrue:[
  4188 	and:[where lineNumber == steppedContextLineno]]]) ifTrue:[
  4012             (here isBlockContext
  4189 	    (here isBlockContext
  4013             and:[(here methodHome == steppedContext)
  4190 	    and:[(here methodHome == steppedContext)
  4014                  or:[here home == steppedContext]]) ifTrue:[
  4191 		 or:[here home == steppedContext]]) ifTrue:[
  4015                 DebuggingDebugger2 == true ifTrue:[
  4192 		DebuggingDebugger2 == true ifTrue:[
  4016                     'same line but in block' printCR.
  4193 		    'same line but in block' printCR.
  4017                 ].
  4194 		].
  4018 
  4195 
  4019                 steppedContext := actualContext := here.
  4196 		steppedContext := actualContext := here.
  4020                 steppedContextLineno := here lineNumber.
  4197 		steppedContextLineno := here lineNumber.
  4021             ] ifFalse:[
  4198 	    ] ifFalse:[
  4022                 "/ kludge - I only have the info for up to 255 lines
  4199 		"/ kludge - I only have the info for up to 255 lines
  4023                 steppedContextLineno ~~ 255 ifTrue:[
  4200 		steppedContextLineno ~~ 255 ifTrue:[
  4024                     DebuggingDebugger2 == true ifTrue:[
  4201 		    DebuggingDebugger2 == true ifTrue:[
  4025                         'same line - ignored' printCR.
  4202 			'same line - ignored' printCR.
  4026                     ].
  4203 		    ].
  4027                     ignore := true
  4204 		    ignore := true
  4028                 ].
  4205 		].
  4029             ].
  4206 	    ].
  4030         ].
  4207 	].
  4031 
  4208 
  4032         (subBlockLeft not
  4209 	(subBlockLeft not
  4033         and:[skipLineNr notNil
  4210 	and:[skipLineNr notNil
  4034         and:[where notNil
  4211 	and:[where notNil
  4035         and:[where lineNumber notNil
  4212 	and:[where lineNumber notNil
  4036         and:[where lineNumber < skipLineNr]]]]) ifTrue:[
  4213 	and:[where lineNumber < skipLineNr]]]]) ifTrue:[
  4037             DebuggingDebugger2 == true ifTrue:[
  4214 	    DebuggingDebugger2 == true ifTrue:[
  4038                 'skip (' print. skipLineNr print. ' unreached - ignored' printCR.
  4215 		'skip (' print. skipLineNr print. ' unreached - ignored' printCR.
  4039             ].
  4216 	    ].
  4040             ignore := true
  4217 	    ignore := true
  4041         ].
  4218 	].
  4042 
  4219 
  4043         (steppedContextLineno isNil
  4220 	(steppedContextLineno isNil
  4044         and:[skipLineNr isNil
  4221 	and:[skipLineNr isNil
  4045         and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[
  4222 	and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[
  4046             DebuggingDebugger2 == true ifTrue:[
  4223 	    DebuggingDebugger2 == true ifTrue:[
  4047                 'same line2 (after conIRQ) - ignored' printCR.
  4224 		'same line2 (after conIRQ) - ignored' printCR.
  4048             ].
  4225 	    ].
  4049             ignore := true
  4226 	    ignore := true
  4050         ].
  4227 	].
  4051     ].
  4228     ].
  4052 
  4229 
  4053     ignore ifTrue:[
  4230     ignore ifTrue:[
  4054 "/' ' printCR.
  4231 "/' ' printCR.
  4055         where := nil. here := nil.
  4232 	where := nil. here := nil.
  4056         "
  4233 	"
  4057          yes, a context below
  4234 	 yes, a context below
  4058           - continue and schedule another stepInterrupt.
  4235 	  - continue and schedule another stepInterrupt.
  4059           Must flush caches since optimized methods not always
  4236 	  Must flush caches since optimized methods not always
  4060           look for pending interrupts
  4237 	  look for pending interrupts
  4061         "
  4238 	"
  4062         ObjectMemory flushInlineCaches.
  4239 	ObjectMemory flushInlineCaches.
  4063         StepInterruptPending := 1.
  4240 	StepInterruptPending := 1.
  4064         InterruptPending := 1.
  4241 	InterruptPending := 1.
  4065         InStepInterrupt := nil.
  4242 	InStepInterrupt := nil.
  4066         ^ self
  4243 	^ self
  4067     ].
  4244     ].
  4068 
  4245 
  4069 "/ ' ' printCR.
  4246 "/ ' ' printCR.
  4070 
  4247 
  4071     self label:(s , ' (process: ' , processName , ')').
  4248     self label:(s , ' (process: ' , processName , ')').
  4076     "release refs to context"
  4253     "release refs to context"
  4077     where := nil. here := nil.
  4254     where := nil. here := nil.
  4078 "/'enter' printCR.
  4255 "/'enter' printCR.
  4079 
  4256 
  4080     DebuggingDebugger2 == true ifTrue:[
  4257     DebuggingDebugger2 == true ifTrue:[
  4081         '==> enter on: ' print. thisContext sender sender printCR.
  4258 	'==> enter on: ' print. thisContext sender sender printCR.
  4082     ].
  4259     ].
  4083 
  4260 
  4084     initiallyShown := nil.
  4261     initiallyShown := nil.
  4085     (oneMore == true) ifTrue:[
  4262     (oneMore == true) ifTrue:[
  4086         (thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[
  4263 	(thisContext sender sender lineNumber ? 0) <= 1 ifTrue:[
  4087             initiallyShown := 2
  4264 	    initiallyShown := 2
  4088         ] ifFalse:[
  4265 	] ifFalse:[
  4089             initiallyShown := 1
  4266 	    initiallyShown := 1
  4090         ]
  4267 	]
  4091     ].
  4268     ].
  4092     con := thisContext sender sender.
  4269     con := thisContext sender sender.
  4093 
  4270 
  4094     HaltInterrupt handle:[:ex |
  4271     HaltInterrupt handle:[:ex |
  4095         'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR.
  4272 	'DebugView [info]: halt/breakpoint in debugger ignored [stepOpNext 2]' infoPrintCR.
  4096         ex proceed
  4273 	ex proceed
  4097     ] do:[
  4274     ] do:[
  4098         self enter:con select:initiallyShown
  4275 	self enter:con select:initiallyShown
  4099     ].
  4276     ].
  4100     con := nil
  4277     con := nil
  4101 
  4278 
  4102     "Created: / 14-10-1996 / 12:53:39 / cg"
  4279     "Created: / 14-10-1996 / 12:53:39 / cg"
  4103     "Modified: / 20-07-2012 / 15:26:26 / cg"
  4280     "Modified: / 20-07-2012 / 15:26:26 / cg"
  4113     selectedContext isNil ifTrue:[^ self].
  4290     selectedContext isNil ifTrue:[^ self].
  4114 
  4291 
  4115     cls := selectedContext receiver class.
  4292     cls := selectedContext receiver class.
  4116     sel := selectedContext selector.
  4293     sel := selectedContext selector.
  4117     (cls includesSelector:sel) ifFalse:[
  4294     (cls includesSelector:sel) ifFalse:[
  4118         sel := nil
  4295 	sel := nil
  4119     ].
  4296     ].
  4120     Tools::NewSystemBrowser addToBookMarks:cls selector:sel
  4297     Tools::NewSystemBrowser addToBookMarks:cls selector:sel
  4121 !
  4298 !
  4122 
  4299 
  4123 autoRaiseView
  4300 autoRaiseView
  4134 
  4311 
  4135 autoUpdateOff
  4312 autoUpdateOff
  4136     "stop the update process"
  4313     "stop the update process"
  4137 
  4314 
  4138     updateProcess notNil ifTrue:[
  4315     updateProcess notNil ifTrue:[
  4139         monitorToggle lampColor:(Color yellow).
  4316 	monitorToggle lampColor:(Color yellow).
  4140         updateProcess terminate.
  4317 	updateProcess terminate.
  4141         updateProcess := nil
  4318 	updateProcess := nil
  4142     ]
  4319     ]
  4143 !
  4320 !
  4144 
  4321 
  4145 autoUpdateOn
  4322 autoUpdateOn
  4146     "fork a subprocess which updates the contextList in regular intervals"
  4323     "fork a subprocess which updates the contextList in regular intervals"
  4147 
  4324 
  4148     updateProcess isNil ifTrue:[
  4325     updateProcess isNil ifTrue:[
  4149         updateProcess :=
  4326 	updateProcess :=
  4150             [
  4327 	    [
  4151                 [true] whileTrue:[
  4328 		[true] whileTrue:[
  4152                     monitorToggle showLamp ifTrue:[
  4329 		    monitorToggle showLamp ifTrue:[
  4153                         monitorToggle lampColor:(Color yellow).
  4330 			monitorToggle lampColor:(Color yellow).
  4154                     ] ifFalse:[
  4331 		    ] ifFalse:[
  4155                         monitorToggle activeForegroundColor:Color black.
  4332 			monitorToggle activeForegroundColor:Color black.
  4156                     ].
  4333 		    ].
  4157                     (Delay forSeconds:0.25) wait.
  4334 		    (Delay forSeconds:0.25) wait.
  4158                     self updateContext.
  4335 		    self updateContext.
  4159                     monitorToggle showLamp ifTrue:[
  4336 		    monitorToggle showLamp ifTrue:[
  4160                         monitorToggle lampColor:(Color red).
  4337 			monitorToggle lampColor:(Color red).
  4161                     ] ifFalse:[
  4338 		    ] ifFalse:[
  4162                         monitorToggle activeForegroundColor:Color red.
  4339 			monitorToggle activeForegroundColor:Color red.
  4163                     ].
  4340 		    ].
  4164                     (Delay forSeconds:0.25) wait.
  4341 		    (Delay forSeconds:0.25) wait.
  4165                     self updateContext.
  4342 		    self updateContext.
  4166                 ]
  4343 		]
  4167             ] forkAt:(Processor activePriority - 1)
  4344 	    ] forkAt:(Processor activePriority - 1)
  4168     ]
  4345     ]
  4169 
  4346 
  4170 !
  4347 !
  4171 
  4348 
  4172 browseBlocksHome
  4349 browseBlocksHome
  4180     mthd := block method.
  4357     mthd := block method.
  4181     cls := mthd mclass.
  4358     cls := mthd mclass.
  4182     sel := mthd selector.
  4359     sel := mthd selector.
  4183 
  4360 
  4184     (cls notNil and:[(cls includesSelector:sel)]) ifTrue:[
  4361     (cls notNil and:[(cls includesSelector:sel)]) ifTrue:[
  4185         cls browserClass openInClass:cls selector:sel.
  4362 	cls browserClass openInClass:cls selector:sel.
  4186         ^ self
  4363 	^ self
  4187     ].
  4364     ].
  4188 
  4365 
  4189     mthd source notEmptyOrNil ifTrue:[
  4366     mthd source notEmptyOrNil ifTrue:[
  4190         (Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs)
  4367 	(Dialog confirm:'Block''s home method is (no longer) present in any class.\Do you want to see the method anyway?' withCRs)
  4191         ifTrue:[
  4368 	ifTrue:[
  4192             UserPreferences current systemBrowserClass 
  4369 	    UserPreferences current systemBrowserClass
  4193                 browseMethods:{ mthd } title:'Unbound Method' sort:false
  4370 		browseMethods:{ mthd } title:'Unbound Method' sort:false
  4194             "/ TextView openWith:mthd source title:'Unbound Method''s Source'.
  4371 	    "/ TextView openWith:mthd source title:'Unbound Method''s Source'.
  4195         ].
  4372 	].
  4196         ^ self
  4373 	^ self
  4197     ].
  4374     ].
  4198     cls notNil ifTrue:[
  4375     cls notNil ifTrue:[
  4199         (Dialog confirm:'Block''s home method is (no longer) present in any class and no source can be shown.\Do you want to browse the method''s last class instead?' withCRs)
  4376 	(Dialog confirm:'Block''s home method is (no longer) present in any class and no source can be shown.\Do you want to browse the method''s last class instead?' withCRs)
  4200         ifTrue:[
  4377 	ifTrue:[
  4201             cls browserClass openInClass:cls selector:nil.
  4378 	    cls browserClass openInClass:cls selector:nil.
  4202         ].
  4379 	].
  4203         ^ self
  4380 	^ self
  4204     ].
  4381     ].
  4205     Dialog information:'Block''s home method is (no longer) present in any class.'.
  4382     Dialog information:'Block''s home method is (no longer) present in any class.'.
  4206 !
  4383 !
  4207 
  4384 
  4208 browseClass
  4385 browseClass
  4213     selectedContext isNil ifTrue:[^ self].
  4390     selectedContext isNil ifTrue:[^ self].
  4214 
  4391 
  4215     cls := selectedContext receiver class.
  4392     cls := selectedContext receiver class.
  4216     sel := selectedContext selector.
  4393     sel := selectedContext selector.
  4217     (cls includesSelector:sel) ifFalse:[
  4394     (cls includesSelector:sel) ifFalse:[
  4218         sel := nil
  4395 	sel := nil
  4219     ].
  4396     ].
  4220     cls browserClass openInClass:cls selector:sel.
  4397     cls browserClass openInClass:cls selector:sel.
  4221 
  4398 
  4222     "Modified: / 3.2.1998 / 20:23:36 / cg"
  4399     "Modified: / 3.2.1998 / 20:23:36 / cg"
  4223 !
  4400 !
  4229 
  4406 
  4230     selectedContext isNil ifTrue:[^ self].
  4407     selectedContext isNil ifTrue:[^ self].
  4231 
  4408 
  4232     mthd := selectedContext method.
  4409     mthd := selectedContext method.
  4233     mthd notNil ifTrue:[
  4410     mthd notNil ifTrue:[
  4234         cls := mthd containingClass.
  4411 	cls := mthd containingClass.
  4235         "/ still nil if unbound - then use receivers class
  4412 	"/ still nil if unbound - then use receivers class
  4236     ].
  4413     ].
  4237     cls isNil ifTrue:[
  4414     cls isNil ifTrue:[
  4238         cls := selectedContext receiver class
  4415 	cls := selectedContext receiver class
  4239     ].
  4416     ].
  4240     cls browserClass browseClassHierarchy:cls.
  4417     cls browserClass browseClassHierarchy:cls.
  4241 
  4418 
  4242     "Modified: / 17.11.2001 / 19:43:06 / cg"
  4419     "Modified: / 17.11.2001 / 19:43:06 / cg"
  4243 !
  4420 !
  4249 
  4426 
  4250     selectedContext isNil ifTrue:[^ self].
  4427     selectedContext isNil ifTrue:[^ self].
  4251 
  4428 
  4252     mthd := selectedContext method.
  4429     mthd := selectedContext method.
  4253     mthd notNil ifTrue:[
  4430     mthd notNil ifTrue:[
  4254         cls := mthd containingClass.
  4431 	cls := mthd containingClass.
  4255         "/ still nil if unbound - then use receivers class
  4432 	"/ still nil if unbound - then use receivers class
  4256     ].
  4433     ].
  4257     cls isNil ifTrue:[
  4434     cls isNil ifTrue:[
  4258         cls := selectedContext receiver class
  4435 	cls := selectedContext receiver class
  4259     ].
  4436     ].
  4260     cls browserClass browseFullClassProtocol:cls.
  4437     cls browserClass browseFullClassProtocol:cls.
  4261 
  4438 
  4262     "Modified: / 17.11.2001 / 19:43:43 / cg"
  4439     "Modified: / 17.11.2001 / 19:43:43 / cg"
  4263 !
  4440 !
  4270     con := selectedContext ? actualContext.
  4447     con := selectedContext ? actualContext.
  4271     con isNil ifTrue:[^ self].
  4448     con isNil ifTrue:[^ self].
  4272 
  4449 
  4273     mthd := con method.
  4450     mthd := con method.
  4274     mthd notNil ifTrue:[
  4451     mthd notNil ifTrue:[
  4275         who := mthd who.
  4452 	who := mthd who.
  4276         who notNil ifTrue:[
  4453 	who notNil ifTrue:[
  4277             cls := who methodClass.
  4454 	    cls := who methodClass.
  4278             sel := who methodSelector.
  4455 	    sel := who methodSelector.
  4279         ] ifFalse:[
  4456 	] ifFalse:[
  4280             "might have been re-accepted"
  4457 	    "might have been re-accepted"
  4281             (home := con methodHome) notNil ifTrue:[
  4458 	    (home := con methodHome) notNil ifTrue:[
  4282                 (sel := home selector) notNil ifTrue:[
  4459 		(sel := home selector) notNil ifTrue:[
  4283                     cls := home receiver class 
  4460 		    cls := home receiver class
  4284                             whichClassImplements:selectedContext selector.
  4461 			    whichClassImplements:selectedContext selector.
  4285                     cls notNil ifTrue:[
  4462 		    cls notNil ifTrue:[
  4286                         Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs.
  4463 			Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs.
  4287                     ].
  4464 		    ].
  4288                 ]
  4465 		]
  4289             ].
  4466 	    ].
  4290         ].
  4467 	].
  4291     ].
  4468     ].
  4292     cls isNil ifTrue:[
  4469     cls isNil ifTrue:[
  4293         "/ class not found - try receiver
  4470 	"/ class not found - try receiver
  4294         cls := con receiver class
  4471 	cls := con receiver class
  4295     ].
  4472     ].
  4296 
  4473 
  4297     cls browserClass openInClass:cls selector:sel.
  4474     cls browserClass openInClass:cls selector:sel.
  4298 
  4475 
  4299     "Created: / 22-11-1995 / 21:27:01 / cg"
  4476     "Created: / 22-11-1995 / 21:27:01 / cg"
  4302 
  4479 
  4303 browseImplementors
  4480 browseImplementors
  4304     "open a browser on the implementors of the selected method's selector"
  4481     "open a browser on the implementors of the selected method's selector"
  4305 
  4482 
  4306     selectedContext isNil ifTrue:[
  4483     selectedContext isNil ifTrue:[
  4307         ^ self showError:'** select a context first **'
  4484 	^ self showError:'** select a context first **'
  4308     ].
  4485     ].
  4309     "/ selectedContext receiver class browserClass
  4486     "/ selectedContext receiver class browserClass
  4310     self withWaitCursorDo:[
  4487     self withWaitCursorDo:[
  4311         UserPreferences systemBrowserClass
  4488 	UserPreferences systemBrowserClass
  4312              browseImplementorsOf:selectedContext selector.
  4489 	     browseImplementorsOf:selectedContext selector.
  4313     ]
  4490     ]
  4314 
  4491 
  4315     "Modified: / 19-07-2012 / 11:44:03 / cg"
  4492     "Modified: / 19-07-2012 / 11:44:03 / cg"
  4316 !
  4493 !
  4317 
  4494 
  4319     "open a browser on the implementors of some selector"
  4496     "open a browser on the implementors of some selector"
  4320 
  4497 
  4321     |initial selector sel|
  4498     |initial selector sel|
  4322 
  4499 
  4323     (sel := codeView selection) notNil ifTrue:[
  4500     (sel := codeView selection) notNil ifTrue:[
  4324         initial := SystemBrowser extractSelectorFrom:sel
  4501 	initial := SystemBrowser extractSelectorFrom:sel
  4325     ].
  4502     ].
  4326     initial isNil ifTrue:[
  4503     initial isNil ifTrue:[
  4327         initial := selectedContext isNil
  4504 	initial := selectedContext isNil
  4328                             ifTrue:[nil]
  4505 			    ifTrue:[nil]
  4329                             ifFalse:[selectedContext selector].
  4506 			    ifFalse:[selectedContext selector].
  4330     ].
  4507     ].
  4331     selector := Dialog
  4508     selector := Dialog
  4332                     requestSelector:'Selector to browse implementors of:'
  4509 		    requestSelector:'Selector to browse implementors of:'
  4333                     initialAnswer:initial.
  4510 		    initialAnswer:initial.
  4334 
  4511 
  4335     selector notEmptyOrNil ifTrue:[
  4512     selector notEmptyOrNil ifTrue:[
  4336         self withWaitCursorDo:[
  4513 	self withWaitCursorDo:[
  4337             UserPreferences systemBrowserClass
  4514 	    UserPreferences systemBrowserClass
  4338                 browseImplementorsMatching:selector.
  4515 		browseImplementorsMatching:selector.
  4339         ]
  4516 	]
  4340     ]
  4517     ]
  4341 
  4518 
  4342     "Modified: / 19-07-2012 / 11:43:52 / cg"
  4519     "Modified: / 19-07-2012 / 11:43:52 / cg"
  4343 !
  4520 !
  4344 
  4521 
  4346     "browse the application class (of the process, if it is a GUI process)"
  4523     "browse the application class (of the process, if it is a GUI process)"
  4347 
  4524 
  4348     |app appClass|
  4525     |app appClass|
  4349 
  4526 
  4350     (app := self processesApplication) notNil ifTrue:[
  4527     (app := self processesApplication) notNil ifTrue:[
  4351         appClass := app class.
  4528 	appClass := app class.
  4352         appClass browserClass openInClass:appClass selector:nil.
  4529 	appClass browserClass openInClass:appClass selector:nil.
  4353         ^ self
  4530 	^ self
  4354     ].
  4531     ].
  4355 !
  4532 !
  4356 
  4533 
  4357 browseReceiversClass
  4534 browseReceiversClass
  4358     "browse the receiver's class (of the selected context's message)"
  4535     "browse the receiver's class (of the selected context's message)"
  4360     |cls sel|
  4537     |cls sel|
  4361 
  4538 
  4362     selectedContext isNil ifTrue:[^ self].
  4539     selectedContext isNil ifTrue:[^ self].
  4363 
  4540 
  4364     selectedContext isCheapBlockContext ifTrue:[
  4541     selectedContext isCheapBlockContext ifTrue:[
  4365         cls := selectedContext method mclass.
  4542 	cls := selectedContext method mclass.
  4366         sel := selectedContext method selector.
  4543 	sel := selectedContext method selector.
  4367     ] ifFalse:[
  4544     ] ifFalse:[
  4368         cls := selectedContext receiver class.
  4545 	cls := selectedContext receiver class.
  4369         sel := selectedContext selector.
  4546 	sel := selectedContext selector.
  4370     ].
  4547     ].
  4371     (cls includesSelector:sel) ifFalse:[
  4548     (cls includesSelector:sel) ifFalse:[
  4372         sel := nil
  4549 	sel := nil
  4373     ].
  4550     ].
  4374     cls browserClass openInClass:cls selector:sel.
  4551     cls browserClass openInClass:cls selector:sel.
  4375 
  4552 
  4376     "Modified: / 19-07-2012 / 11:29:48 / cg"
  4553     "Modified: / 19-07-2012 / 11:29:48 / cg"
  4377 !
  4554 !
  4378 
  4555 
  4379 browseSenders
  4556 browseSenders
  4380     "open a browser on the senders of the selected method's selector"
  4557     "open a browser on the senders of the selected method's selector"
  4381 
  4558 
  4382     selectedContext isNil ifTrue:[
  4559     selectedContext isNil ifTrue:[
  4383         ^ self showError:'** select a context first **'
  4560 	^ self showError:'** select a context first **'
  4384     ].
  4561     ].
  4385     self withWaitCursorDo:[
  4562     self withWaitCursorDo:[
  4386         UserPreferences systemBrowserClass
  4563 	UserPreferences systemBrowserClass
  4387             browseAllCallsOn:selectedContext selector.
  4564 	    browseAllCallsOn:selectedContext selector.
  4388     ]
  4565     ]
  4389 
  4566 
  4390     "Modified: / 19-07-2012 / 11:43:02 / cg"
  4567     "Modified: / 19-07-2012 / 11:43:02 / cg"
  4391 !
  4568 !
  4392 
  4569 
  4394     "open a browser on the senders of some selector"
  4571     "open a browser on the senders of some selector"
  4395 
  4572 
  4396     |initial selector sel|
  4573     |initial selector sel|
  4397 
  4574 
  4398     (sel := codeView selection) notNil ifTrue:[
  4575     (sel := codeView selection) notNil ifTrue:[
  4399         initial := SystemBrowser extractSelectorFrom:sel
  4576 	initial := SystemBrowser extractSelectorFrom:sel
  4400     ].
  4577     ].
  4401     initial isNil ifTrue:[
  4578     initial isNil ifTrue:[
  4402         initial := selectedContext isNil
  4579 	initial := selectedContext isNil
  4403                             ifTrue:[nil]
  4580 			    ifTrue:[nil]
  4404                             ifFalse:[selectedContext selector].
  4581 			    ifFalse:[selectedContext selector].
  4405     ].
  4582     ].
  4406     selector := Dialog
  4583     selector := Dialog
  4407                     requestSelector:'Selector to browse senders of:'
  4584 		    requestSelector:'Selector to browse senders of:'
  4408                     initialAnswer:initial.
  4585 		    initialAnswer:initial.
  4409 
  4586 
  4410     selector notEmptyOrNil ifTrue:[
  4587     selector notEmptyOrNil ifTrue:[
  4411         self withWaitCursorDo:[
  4588 	self withWaitCursorDo:[
  4412             UserPreferences systemBrowserClass
  4589 	    UserPreferences systemBrowserClass
  4413                 browseAllCallsOn:selector asSymbol.
  4590 		browseAllCallsOn:selector asSymbol.
  4414         ]
  4591 	]
  4415     ]
  4592     ]
  4416 
  4593 
  4417     "Modified: / 19-07-2012 / 11:43:29 / cg"
  4594     "Modified: / 19-07-2012 / 11:43:29 / cg"
  4418 !
  4595 !
  4419 
  4596 
  4426 !
  4603 !
  4427 
  4604 
  4428 closeAllDebuggers
  4605 closeAllDebuggers
  4429     (Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?')
  4606     (Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?')
  4430     ifFalse:[
  4607     ifFalse:[
  4431         ^ self
  4608 	^ self
  4432     ].
  4609     ].
  4433 
  4610 
  4434     self class allInstancesDo:[:debugger | 
  4611     self class allInstancesDo:[:debugger |
  4435         debugger ~~ self ifTrue:[
  4612 	debugger ~~ self ifTrue:[
  4436             debugger busy ifTrue:[
  4613 	    debugger busy ifTrue:[
  4437                 debugger destroyWithConfirmation:true.
  4614 		debugger destroyWithConfirmation:true.
  4438             ].
  4615 	    ].
  4439         ].
  4616 	].
  4440     ].
  4617     ].
  4441     self closeRequest.
  4618     self closeRequest.
  4442 
  4619 
  4443     "Created: / 23-03-2012 / 12:40:22 / cg"
  4620     "Created: / 23-03-2012 / 12:40:22 / cg"
  4444 !
  4621 !
  4458      Show the full verbose context without filtering."
  4635      Show the full verbose context without filtering."
  4459 
  4636 
  4460     |infoText|
  4637     |infoText|
  4461 
  4638 
  4462     firstContext isNil ifTrue:[
  4639     firstContext isNil ifTrue:[
  4463         infoText := 'No context, no walkback'.
  4640 	infoText := 'No context, no walkback'.
  4464     ] ifFalse:[
  4641     ] ifFalse:[
  4465         infoText := firstContext fullPrintAllString asStringCollection.
  4642 	exceptionInfoLabel notNil ifTrue:[
       
  4643 	    infoText := exceptionInfoLabel label , '\\' withCRs.
       
  4644 	] ifFalse:[
       
  4645 	    infoText := ''
       
  4646 	].
       
  4647 	infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection.
  4466     ].
  4648     ].
  4467 
  4649 
  4468     self setClipboardText:infoText
  4650     self setClipboardText:infoText
  4469 
  4651 
  4470     "Modified: 28.8.1995 / 15:31:59 / claus"
  4652     "Modified: 28.8.1995 / 15:31:59 / claus"
  4474     "abort - send Object>>abortSignal, which is usually caught
  4656     "abort - send Object>>abortSignal, which is usually caught
  4475      at save places (for example: in the event loop) and returns back
  4657      at save places (for example: in the event loop) and returns back
  4476      from whatever the process is doing, but does not terminate it."
  4658      from whatever the process is doing, but does not terminate it."
  4477 
  4659 
  4478     self checkIfCodeIsReallyModified ifTrue:[
  4660     self checkIfCodeIsReallyModified ifTrue:[
  4479         (self confirm:('Code modified - abort anyway ?'))
  4661 	(self confirm:('Code modified - abort anyway ?'))
  4480         ifFalse:[
  4662 	ifFalse:[
  4481             ^ self
  4663 	    ^ self
  4482         ]
  4664 	]
  4483     ].
  4665     ].
  4484 
  4666 
  4485     inspecting ifTrue:[
  4667     inspecting ifTrue:[
  4486         inspectedProcess isDead ifTrue:[
  4668 	inspectedProcess isDead ifTrue:[
  4487             self showTerminated.
  4669 	    self showTerminated.
  4488             ^ self
  4670 	    ^ self
  4489         ].
  4671 	].
  4490         (AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[
  4672 	(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[
  4491             self showError:'** the process does not handle the abort signal **'
  4673 	    self showError:'** the process does not handle the abort signal **'
  4492         ] ifTrue:[
  4674 	] ifTrue:[
  4493             self interruptProcessWith:[AbortOperationRequest raise].
  4675 	    self interruptProcessWith:[AbortOperationRequest raise].
  4494         ].
  4676 	].
  4495         ^ self
  4677 	^ self
  4496     ].
  4678     ].
  4497 
  4679 
  4498     steppedContext := wrapperContext := nil.
  4680     steppedContext := wrapperContext := nil.
  4499     haveControl := false.
  4681     haveControl := false.
  4500     exitAction := #abort.
  4682     exitAction := #abort.
  4501 
  4683 
  4502     "exit private event-loop"
  4684     "exit private event-loop"
  4503     catchBlock notNil ifTrue:[
  4685     catchBlock notNil ifTrue:[
  4504         abortButton turnOff.
  4686 	abortButton turnOff.
  4505         catchBlock value.
  4687 	catchBlock value.
  4506 
  4688 
  4507         "/ not reached
  4689 	"/ not reached
  4508         'DebugView [warning]: abort failed' errorPrintCR.
  4690 	'DebugView [warning]: abort failed' errorPrintCR.
  4509     ].
  4691     ].
  4510 
  4692 
  4511     ^ self.
  4693     ^ self.
  4512 
  4694 
  4513     "Modified: / 17.11.2001 / 22:53:22 / cg"
  4695     "Modified: / 17.11.2001 / 22:53:22 / cg"
  4517     "abortAll - send Object>>abortAllSignal, which is usually caught
  4699     "abortAll - send Object>>abortAllSignal, which is usually caught
  4518      at save places (for example: in the event loop) and returns back
  4700      at save places (for example: in the event loop) and returns back
  4519      from whatever the process is doing, but does not terminate it."
  4701      from whatever the process is doing, but does not terminate it."
  4520 
  4702 
  4521     self checkIfCodeIsReallyModified ifTrue:[
  4703     self checkIfCodeIsReallyModified ifTrue:[
  4522         (self confirm:('Code modified - abort anyway ?'))
  4704 	(self confirm:('Code modified - abort anyway ?'))
  4523         ifFalse:[
  4705 	ifFalse:[
  4524             ^ self
  4706 	    ^ self
  4525         ]
  4707 	]
  4526     ].
  4708     ].
  4527 
  4709 
  4528     inspecting ifTrue:[
  4710     inspecting ifTrue:[
  4529         inspectedProcess isDead ifTrue:[
  4711 	inspectedProcess isDead ifTrue:[
  4530             self showTerminated.
  4712 	    self showTerminated.
  4531             ^ self
  4713 	    ^ self
  4532         ].
  4714 	].
  4533         (AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[
  4715 	(AbortOperationRequest isHandledIn:inspectedProcess suspendedContext) ifFalse:[
  4534             self showError:'** the process does not handle the abort signal **'
  4716 	    self showError:'** the process does not handle the abort signal **'
  4535         ] ifTrue:[
  4717 	] ifTrue:[
  4536             self interruptProcessWith:[AbortAllOperationRequest raise].
  4718 	    self interruptProcessWith:[AbortAllOperationRequest raise].
  4537         ].
  4719 	].
  4538         ^ self
  4720 	^ self
  4539     ].
  4721     ].
  4540 
  4722 
  4541     steppedContext := wrapperContext := nil.
  4723     steppedContext := wrapperContext := nil.
  4542     haveControl := false.
  4724     haveControl := false.
  4543     exitAction := #abortAll.
  4725     exitAction := #abortAll.
  4544 
  4726 
  4545     "exit private event-loop"
  4727     "exit private event-loop"
  4546     catchBlock notNil ifTrue:[
  4728     catchBlock notNil ifTrue:[
  4547         abortButton turnOff.
  4729 	abortButton turnOff.
  4548         catchBlock value.
  4730 	catchBlock value.
  4549 
  4731 
  4550         "/ not reached
  4732 	"/ not reached
  4551         'DebugView [warning]: abort failed' errorPrintCR.
  4733 	'DebugView [warning]: abort failed' errorPrintCR.
  4552     ].
  4734     ].
  4553 
  4735 
  4554     ^ self.
  4736     ^ self.
  4555 
  4737 
  4556     "Modified: / 17.11.2001 / 22:53:22 / cg"
  4738     "Modified: / 17.11.2001 / 22:53:22 / cg"
  4562     |oldPrio newPrio s|
  4744     |oldPrio newPrio s|
  4563 
  4745 
  4564     oldPrio := (inspectedProcess ? Processor activeProcess) priority.
  4746     oldPrio := (inspectedProcess ? Processor activeProcess) priority.
  4565 
  4747 
  4566     [
  4748     [
  4567         s := Dialog 
  4749 	s := Dialog
  4568                 request:(resources stringWithCRs:'Change the processes priority to (proceed with prio):\\    2 - system background\    4 - user background\    8 - normal\    9 - high\   16 - I/O (danger alert)\')
  4750 		request:(resources stringWithCRs:'Change the processes priority to (proceed with prio):\\    2 - system background\    4 - user background\    8 - normal\    9 - high\   16 - I/O (danger alert)\')
  4569                 initialAnswer:oldPrio printString.
  4751 		initialAnswer:oldPrio printString.
  4570         s isEmptyOrNil ifTrue:[^ self].
  4752 	s isEmptyOrNil ifTrue:[^ self].
  4571         newPrio := Integer readFrom:s onError:nil.
  4753 	newPrio := Integer readFrom:s onError:nil.
  4572         newPrio isNil
  4754 	newPrio isNil
  4573     ] whileTrue.
  4755     ] whileTrue.
  4574 
  4756 
  4575     newPrio := newPrio max:(Processor lowestPriority).
  4757     newPrio := newPrio max:(Processor lowestPriority).
  4576     newPrio := newPrio min:(Processor highestPriority).
  4758     newPrio := newPrio min:(Processor highestPriority).
  4577     newPrio >= Processor highIOPriority ifTrue:[
  4759     newPrio >= Processor highIOPriority ifTrue:[
  4578         (Dialog 
  4760 	(Dialog
  4579                 confirm:(resources 
  4761 		confirm:(resources
  4580                             stringWithCRs:'Attention: event handling takes place at prio 16.\An ever running high priority process\could block the system and make the UI unusable.\\Proceed?'))
  4762 			    stringWithCRs:'Attention: event handling takes place at prio 16.\An ever running high priority process\could block the system and make the UI unusable.\\Proceed?'))
  4581         ifFalse:[^ self].
  4763 	ifFalse:[^ self].
  4582     ].
  4764     ].
  4583     (inspectedProcess ? Processor activeProcess) priority:newPrio.
  4765     (inspectedProcess ? Processor activeProcess) priority:newPrio.
  4584 
  4766 
  4585     "Created: / 07-03-2012 / 14:15:09 / cg"
  4767     "Created: / 07-03-2012 / 14:15:09 / cg"
  4586 !
  4768 !
  4589     "continue from menu"
  4771     "continue from menu"
  4590 
  4772 
  4591     |proc exContext ex answer|
  4773     |proc exContext ex answer|
  4592 
  4774 
  4593     self checkIfCodeIsReallyModified ifTrue:[
  4775     self checkIfCodeIsReallyModified ifTrue:[
  4594         (self confirm:('Code modified - continue anyway ?')) ifFalse:[
  4776 	(self confirm:('Code modified - continue anyway ?')) ifFalse:[
  4595             ^ self
  4777 	    ^ self
  4596         ]
  4778 	]
  4597     ].
  4779     ].
  4598 
  4780 
  4599     inspecting ifTrue:[
  4781     inspecting ifTrue:[
  4600         device hasColors ifTrue:[
  4782 	self graphicsDevice hasColors ifTrue:[
  4601             continueButton foregroundColor:Color red darkened.
  4783 	    continueButton foregroundColor:Color red darkened.
  4602         ].
  4784 	].
  4603         continueButton label:(resources string:'Stop').
  4785 	continueButton label:(resources string:'Stop').
  4604         continueButton action:[self doStop].
  4786 	continueButton action:[self doStop].
  4605 
  4787 
  4606         self processPerform:#resume.
  4788 	self processPerform:#resume.
  4607 
  4789 
  4608         ^ self
  4790 	^ self
  4609     ].
  4791     ].
  4610     canContinue ifTrue:[
  4792     canContinue ifTrue:[
  4611         exContext := thisContext findSpecialHandle:false raise:true.
  4793 	exContext := thisContext findSpecialHandle:false raise:true.
  4612 
  4794 
  4613         (exContext notNil
  4795 	(exContext notNil
  4614         and:[ (ex := exContext receiver) isLazyValue not
  4796 	and:[ (ex := exContext receiver) isLazyValue not
  4615         and:[ ex isException
  4797 	and:[ ex isException
  4616         and:[ ex creator == NoHandlerError
  4798 	and:[ ex creator == NoHandlerError
  4617         and:[ ex exception creator == RecursionError]]]])
  4799 	and:[ ex exception creator == RecursionError]]]])
  4618         ifTrue:[
  4800 	ifTrue:[
  4619             "/ debug due to unhandled recursionInterrupt.
  4801 	    "/ debug due to unhandled recursionInterrupt.
  4620             "/ ask if we should proceed with more stack.
  4802 	    "/ ask if we should proceed with more stack.
  4621 
  4803 
  4622             answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs.
  4804 	    answer := self confirm:'Debugger entered due to a stack overflow.\\Continue with more stack ?' withCRs.
  4623             answer == true ifTrue:[
  4805 	    answer == true ifTrue:[
  4624                 proc := Processor activeProcess.
  4806 		proc := Processor activeProcess.
  4625                 proc setMaximumStackSize:(proc maximumStackSize * 2).
  4807 		proc setMaximumStackSize:(proc maximumStackSize * 2).
  4626             ].
  4808 	    ].
  4627         ].
  4809 	].
  4628 
  4810 
  4629         steppedContext := wrapperContext := nil.
  4811 	steppedContext := wrapperContext := nil.
  4630         tracing := false.
  4812 	tracing := false.
  4631         haveControl := false.
  4813 	haveControl := false.
  4632         exitAction := #continue.
  4814 	exitAction := #continue.
  4633 
  4815 
  4634         "exit private event-loop"
  4816 	"exit private event-loop"
  4635         catchBlock value.
  4817 	catchBlock value.
  4636 
  4818 
  4637         "/ not reached.
  4819 	"/ not reached.
  4638         'DebugView [warning]: continue failed' errorPrintCR.
  4820 	'DebugView [warning]: continue failed' errorPrintCR.
  4639         continueButton turnOff.
  4821 	continueButton turnOff.
  4640 
  4822 
  4641     ] ifFalse:[
  4823     ] ifFalse:[
  4642         inspecting ifFalse:[
  4824 	inspecting ifFalse:[
  4643             'DebugView [info]: resuming top context' infoPrintCR.
  4825 	    'DebugView [info]: resuming top context' infoPrintCR.
  4644             self showSelection:1.
  4826 	    self showSelection:1.
  4645             self doReturn
  4827 	    self doReturn
  4646         ]
  4828 	]
  4647     ]
  4829     ]
  4648 
  4830 
  4649     "Modified: / 5.10.1998 / 13:03:47 / cg"
  4831     "Modified: / 5.10.1998 / 13:03:47 / cg"
  4650     "Modified: / 26.7.1999 / 15:38:45 / stefan"
  4832     "Modified: / 26.7.1999 / 15:38:45 / stefan"
  4651 !
  4833 !
  4661 
  4843 
  4662     selectionIndex := contextView selection.
  4844     selectionIndex := contextView selection.
  4663     restart := true.
  4845     restart := true.
  4664 
  4846 
  4665     selectorToDefine notNil ifTrue:[
  4847     selectorToDefine notNil ifTrue:[
  4666         selector := selectorToDefine.
  4848 	selector := selectorToDefine.
  4667         receiversClass := classToDefineIn.
  4849 	receiversClass := classToDefineIn.
  4668     ] ifFalse:[
  4850     ] ifFalse:[
  4669         selector := actualContext selector.
  4851 	selector := actualContext selector.
  4670         receiversClass := actualContext receiver class.
  4852 	receiversClass := actualContext receiver class.
  4671     ].
  4853     ].
  4672 
  4854 
  4673     implClass := actualContext receiver class whichClassIncludesSelector:selector.
  4855     implClass := actualContext receiver class whichClassIncludesSelector:selector.
  4674     implClass notNil ifTrue:[
  4856     implClass notNil ifTrue:[
  4675         "/ must be a subclassResponsibility
  4857 	"/ must be a subclassResponsibility
  4676 
  4858 
  4677         idx := contextArray identityIndexOf:actualContext.
  4859 	idx := contextArray identityIndexOf:actualContext.
  4678         idx > 1 ifTrue:[
  4860 	idx > 1 ifTrue:[
  4679             callee := contextArray at:idx-1.
  4861 	    callee := contextArray at:idx-1.
  4680 
  4862 
  4681             callee selector == #subclassResponsibility ifTrue:[
  4863 	    callee selector == #subclassResponsibility ifTrue:[
  4682                 restart := false.
  4864 		restart := false.
  4683             ]
  4865 	    ]
  4684         ].
  4866 	].
  4685     ].
  4867     ].
  4686 
  4868 
  4687     "generate nice argument names"
  4869     "generate nice argument names"
  4688     bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag.
  4870     bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag.
  4689     bagOfUsedClassNames := Bag new.
  4871     bagOfUsedClassNames := Bag new.
  4690     argNames := actualContext args
  4872     argNames := actualContext args
  4691                     collect:
  4873 		    collect:
  4692                         [:eachArg |
  4874 			[:eachArg |
  4693                             |nm|
  4875 			    |nm|
  4694 
  4876 
  4695                             nm := eachArg class nameWithoutPrefix.
  4877 			    nm := eachArg class nameWithoutPrefix.
  4696                             (bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[
  4878 			    (bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[
  4697                                 nm article , nm
  4879 				nm article , nm
  4698                             ] ifFalse:[
  4880 			    ] ifFalse:[
  4699                                 bagOfUsedClassNames add:nm.
  4881 				bagOfUsedClassNames add:nm.
  4700                                 nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString
  4882 				nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString
  4701                             ].
  4883 			    ].
  4702                         ].
  4884 			].
  4703 
  4885 
  4704     proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames.
  4886     proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames.
  4705 
  4887 
  4706     haltStmtDef := '    self halt:''please define %2 here''.'.
  4888     haltStmtDef := '    self halt:''please define %2 here''.'.
  4707     haltStmtFix := '    self halt:''please change %2 as required''.'.
  4889     haltStmtFix := '    self halt:''please change %2 as required''.'.
  4708 
  4890 
  4709 
  4891 
  4710     ( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[
  4892     ( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[
  4711         (self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?')
  4893 	(self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?')
  4712         ifFalse:[
  4894 	ifFalse:[
  4713             ^ self
  4895 	    ^ self
  4714         ]
  4896 	]
  4715     ].
  4897     ].
  4716 
  4898 
  4717 
  4899 
  4718     "/ code for a getter
  4900     "/ code for a getter
  4719     (receiversClass instVarNames includes:selector) ifTrue:[
  4901     (receiversClass instVarNames includes:selector) ifTrue:[
  4720         code := '%1\' , haltStmtFix , '\    ^ %2'.
  4902 	code := '%1\' , haltStmtFix , '\    ^ %2'.
  4721         cat := 'accessing'.
  4903 	cat := 'accessing'.
  4722     ].
  4904     ].
  4723 
  4905 
  4724     "/ code for a setter
  4906     "/ code for a setter
  4725     (selector numArgs == 1
  4907     (selector numArgs == 1
  4726     and:[(selector endsWith:':')
  4908     and:[(selector endsWith:':')
  4727     and:[receiversClass instVarNames includes:(selector copyButLast:1)]])
  4909     and:[receiversClass instVarNames includes:(selector copyButLast:1)]])
  4728     ifTrue:[
  4910     ifTrue:[
  4729         varName := selector copyButLast:1.
  4911 	varName := selector copyButLast:1.
  4730         argName := argNames first.
  4912 	argName := argNames first.
  4731         code := '%1\' , haltStmtFix , '\    %3 := %4.'.
  4913 	code := '%1\' , haltStmtFix , '\    %3 := %4.'.
  4732         cat := 'accessing'.
  4914 	cat := 'accessing'.
  4733     ].
  4915     ].
  4734 
  4916 
  4735     "/ code for a tester
  4917     "/ code for a tester
  4736     (selector numArgs == 0
  4918     (selector numArgs == 0
  4737     and:[(selector startsWith:'is')
  4919     and:[(selector startsWith:'is')
  4738     and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]])
  4920     and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]])
  4739     ifTrue:[
  4921     ifTrue:[
  4740         (receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[
  4922 	(receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[
  4741             code := '%1\' , haltStmtFix , '\    ^ true.'.
  4923 	    code := '%1\' , haltStmtFix , '\    ^ true.'.
  4742         ] ifFalse:[
  4924 	] ifFalse:[
  4743             code := '%1\' , haltStmtFix , '\    ^ false.'.
  4925 	    code := '%1\' , haltStmtFix , '\    ^ false.'.
  4744         ].
  4926 	].
  4745         cat := 'testing'.
  4927 	cat := 'testing'.
  4746     ].
  4928     ].
  4747 
  4929 
  4748 "/    actualContext receiver isClass ifTrue:[
  4930 "/    actualContext receiver isClass ifTrue:[
  4749 "/        selector == #new ifTrue:[
  4931 "/        selector == #new ifTrue:[
  4750 "/            code := '%1\' , haltStmt , '\    ^ self basicNew initialize'
  4932 "/            code := '%1\' , haltStmt , '\    ^ self basicNew initialize'
  4752 "/        selector == #'new:' ifTrue:[
  4934 "/        selector == #'new:' ifTrue:[
  4753 "/            code := '%1\' , haltStmt , '\    ^ (self basicNew:arg) initialize'
  4935 "/            code := '%1\' , haltStmt , '\    ^ (self basicNew:arg) initialize'
  4754 "/        ].
  4936 "/        ].
  4755 "/    ].
  4937 "/    ].
  4756     code isNil ifTrue:[
  4938     code isNil ifTrue:[
  4757         code := '%1\' , haltStmtDef
  4939 	code := '%1\' , haltStmtDef
  4758     ].
  4940     ].
  4759 
  4941 
  4760     self
  4942     self
  4761         codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs
  4943 	codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs
  4762         inClass:receiversClass
  4944 	inClass:receiversClass
  4763         unwind:false
  4945 	unwind:false
  4764         category:cat
  4946 	category:cat
  4765         onCancel:[^ self].
  4947 	onCancel:[^ self].
  4766 
  4948 
  4767     self doShowSelection:selectionIndex.
  4949     self doShowSelection:selectionIndex.
  4768     restart ifTrue:[
  4950     restart ifTrue:[
  4769         self doRestart
  4951 	self doRestart
  4770     ]
  4952     ]
  4771 
  4953 
  4772     "Modified: / 23-03-2012 / 09:49:31 / cg"
  4954     "Modified: / 23-03-2012 / 09:49:31 / cg"
  4773 !
  4955 !
  4774 
  4956 
       
  4957 doGotoApplicationActionMethod
       
  4958     "select the first application-model context.
       
  4959      This is another great helper, when you hit an exception,
       
  4960      to quickly navigate to the responsible code of you application"
       
  4961 
       
  4962     contextArray keysAndValuesDo:[:i :c |
       
  4963 	|nextCon nextRcvr dialog|
       
  4964 
       
  4965 	"/ find the first appModel context
       
  4966 	nextCon := contextArray at:i+1.
       
  4967 	"/
       
  4968 	"/ while not in the appModel
       
  4969 	"/
       
  4970 	[
       
  4971 	    nextRcvr := nextCon receiver.
       
  4972 	    (nextRcvr isKindOf:ApplicationModel)
       
  4973 	] whileFalse:[
       
  4974 	    nextCon := nextCon sender
       
  4975 	].
       
  4976 	self selectContext:nextCon.
       
  4977 	^ self.
       
  4978     ].
       
  4979     "/ not found
       
  4980     gotoApplicationActionMethodButton disable.
       
  4981 !
       
  4982 
  4775 doGotoDialogOpener
  4983 doGotoDialogOpener
  4776     "select the context where the dialog was opened"
  4984     "select the context where the dialog was opened.
       
  4985      This is a great helper, when you press interrupt while a modal dialog
       
  4986      is open, to quickly navigate to the corresponding opening code of you application"
  4777 
  4987 
  4778     contextArray keysAndValuesDo:[:i :c |
  4988     contextArray keysAndValuesDo:[:i :c |
  4779         |nextCon nextRcvr dialog|
  4989 	|nextCon nextRcvr dialog|
  4780 
  4990 
  4781         "/ find the openModal, then walk upward
  4991 	"/ find the openModal, then walk upward
  4782         ((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[
  4992 	((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[
  4783             dialog := c receiver.
  4993 	    dialog := c receiver.
  4784             nextCon := contextArray at:i+1.
  4994 	    nextCon := contextArray at:i+1.
  4785             "/ while still in dialog code
  4995 	    "/
  4786             [ 
  4996 	    "/ while still in dialog code
  4787                 nextRcvr := nextCon receiver.
  4997 	    "/
  4788                 (nextRcvr == dialog)
  4998 	    [
  4789                 or:[ nextRcvr == dialog class
  4999 		nextRcvr := nextCon receiver.
  4790                 or:[ nextRcvr == DialogBox ]]
  5000 		(nextRcvr == dialog)
  4791             ] whileTrue:[
  5001 		or:[ nextRcvr == dialog class
  4792                 (nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[ 
  5002 		or:[ nextRcvr == DialogBox ]]
  4793                     nextCon := nextCon methodHome 
  5003 	    ] whileTrue:[
  4794                 ].
  5004 		(nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[
  4795                 nextCon := nextCon sender.
  5005 		    nextCon := nextCon methodHome
  4796             ].
  5006 		].
  4797             "/ while still in a Notification
  5007 		nextCon := nextCon sender.
  4798             [ 
  5008 	    ].
  4799                 nextRcvr := nextCon receiver.
  5009 	    "/
  4800                 (nextRcvr isKindOf:UserInformation)
  5010 	    "/ while still in a Notification
  4801                 or:[ nextRcvr isBehavior
  5011 	    "/
  4802                      and:[nextRcvr includesBehavior:UserInformation]]
  5012 	    [
  4803             ] whileTrue:[
  5013 		nextRcvr := nextCon receiver.
  4804                 nextCon := nextCon sender
  5014 		(nextRcvr isKindOf:UserInformation)
  4805             ].
  5015 		or:[ nextRcvr isBehavior
  4806             self selectContext:nextCon.
  5016 		     and:[nextRcvr includesBehavior:UserInformation]]
  4807             ^ self.            
  5017 	    ] whileTrue:[
  4808         ]
  5018 		nextCon := nextCon sender
       
  5019 	    ].
       
  5020 	    "/
       
  5021 	    "/ while still in UIBuilder
       
  5022 	    "/
       
  5023 	    [
       
  5024 		nextRcvr := nextCon receiver.
       
  5025 		(nextRcvr isKindOf:WindowBuilder)
       
  5026 	    ] whileTrue:[
       
  5027 		nextCon := nextCon sender
       
  5028 	    ].
       
  5029 	    "/
       
  5030 	    "/ while still in SimpleDialog
       
  5031 	    "/
       
  5032 	    [
       
  5033 		nextRcvr := nextCon receiver.
       
  5034 		(nextRcvr class == SimpleDialog)
       
  5035 	    ] whileTrue:[
       
  5036 		nextCon := nextCon sender
       
  5037 	    ].
       
  5038 	    "/
       
  5039 	    "/ while still in applicationModel support code
       
  5040 	    "/
       
  5041 	    [
       
  5042 		(nextCon selector startsWith:'openDialogSpec').
       
  5043 	    ] whileTrue:[
       
  5044 		nextCon := nextCon sender
       
  5045 	    ].
       
  5046 	    self selectContext:nextCon.
       
  5047 	    ^ self.
       
  5048 	]
  4809     ].
  5049     ].
  4810     "/ not found
  5050     "/ not found
  4811     gotoDialogOpenerButton disable.
  5051     gotoDialogOpenerButton disable.
  4812 !
  5052 !
  4813 
  5053 
  4819     "single send; reenter with next message send"
  5059     "single send; reenter with next message send"
  4820 
  5060 
  4821     inspecting ifTrue:[^ self].
  5061     inspecting ifTrue:[^ self].
  4822 
  5062 
  4823     self checkIfCodeIsReallyModified ifTrue:[
  5063     self checkIfCodeIsReallyModified ifTrue:[
  4824         (self confirm:('Code modified - step anyway ?'))
  5064 	(self confirm:('Code modified - step anyway ?'))
  4825         ifFalse:[
  5065 	ifFalse:[
  4826             ^ self
  5066 	    ^ self
  4827         ]
  5067 	]
  4828     ].
  5068     ].
  4829 
  5069 
  4830     canContinue ifTrue:[
  5070     canContinue ifTrue:[
  4831         steppedContext := wrapperContext := nil.
  5071 	steppedContext := wrapperContext := nil.
  4832         haveControl := false.
  5072 	haveControl := false.
  4833         exitAction := #step.
  5073 	exitAction := #step.
  4834 
  5074 
  4835         "exit private event-loop"
  5075 	"exit private event-loop"
  4836         catchBlock value.
  5076 	catchBlock value.
  4837 
  5077 
  4838         "/ not reached
  5078 	"/ not reached
  4839         'DebugView [warning]: send failed' errorPrintCR.
  5079 	'DebugView [warning]: send failed' errorPrintCR.
  4840         sendButton turnOff.
  5080 	sendButton turnOff.
  4841     ]
  5081     ]
  4842 
  5082 
  4843     "Created: / 6.3.1997 / 21:09:36 / cg"
  5083     "Created: / 6.3.1997 / 21:09:36 / cg"
  4844     "Modified: / 29.7.1998 / 21:49:29 / cg"
  5084     "Modified: / 29.7.1998 / 21:49:29 / cg"
  4845 !
  5085 !
  4878     "Modified: 7.3.1997 / 18:39:00 / cg"
  5118     "Modified: 7.3.1997 / 18:39:00 / cg"
  4879 !
  5119 !
  4880 
  5120 
  4881 doNoTrace
  5121 doNoTrace
  4882     traceView notNil ifTrue:[
  5122     traceView notNil ifTrue:[
  4883         traceView topView destroy.
  5123 	traceView topView destroy.
  4884         traceView := nil.
  5124 	traceView := nil.
  4885     ].
  5125     ].
  4886     tracing := false
  5126     tracing := false
  4887 !
  5127 !
  4888 
  5128 
  4889 doOpenReportMailApp
  5129 doOpenReportMailApp
  4892     | str |
  5132     | str |
  4893 
  5133 
  4894     str := '' writeStream.
  5134     str := '' writeStream.
  4895 
  5135 
  4896     str nextPutLine:('Error notification from '
  5136     str nextPutLine:('Error notification from '
  4897                     , OperatingSystem getLoginName
  5137 		    , OperatingSystem getLoginName
  4898                     , '@'
  5138 		    , '@'
  4899                     , OperatingSystem getHostName).
  5139 		    , OperatingSystem getHostName).
  4900     str cr.
  5140     str cr.
  4901 
  5141 
  4902     str nextPutLine:('Time: ' , Timestamp now printString).
  5142     str nextPutLine:('Time: ' , Timestamp now printString).
  4903     str nextPutLine:('STX Version: ' , Smalltalk versionString).
  5143     str nextPutLine:('STX Version: ' , Smalltalk versionString).
  4904     str nextPutLine:('Description: ' , self label).
  5144     str nextPutLine:('Description: ' , self label).
  4907 "/    str nextPutLine:('Parameter: ', printedException parameter printString).
  5147 "/    str nextPutLine:('Parameter: ', printedException parameter printString).
  4908     str nextPutLine:'Backtrace:'.
  5148     str nextPutLine:'Backtrace:'.
  4909     str cr.
  5149     str cr.
  4910 
  5150 
  4911     firstContext notNil ifTrue:[
  5151     firstContext notNil ifTrue:[
  4912         firstContext fullPrintAllOn:str.
  5152 	firstContext fullPrintAllOn:str.
  4913     ].
  5153     ].
  4914     str cr;cr.
  5154     str cr;cr.
  4915 
  5155 
  4916     SendMailTool
  5156     SendMailTool
  4917         openForMessage:(str contents)
  5157 	openForMessage:(str contents)
  4918         withSubject:('STX Error:[', self label, ']')
  5158 	withSubject:('STX Error:[', self label, ']')
  4919         preOpenBlock:[:inst|
  5159 	preOpenBlock:[:inst|
  4920             inst recipientEntryField value:'error@exept.de'
  5160 	    inst recipientEntryField value:'error@exept.de'
  4921         ].
  5161 	].
  4922 
  5162 
  4923     "Modified: / 20-09-2007 / 12:40:40 / cg"
  5163     "Modified: / 20-09-2007 / 12:40:40 / cg"
  4924 !
  5164 !
  4925 
  5165 
  4926 doResend
  5166 doResend
  4927     "resend - the selected context is unwound and its message resent.
  5167     "resend - the selected context is unwound and its message resent.
  4928      To be done after a cde change, to get nto the new method"
  5168      To be done after a cde change, to get nto the new method"
  4929 
  5169 
  4930     self checkIfCodeIsReallyModified ifTrue:[
  5170     self checkIfCodeIsReallyModified ifTrue:[
  4931         (self confirm:('Code modified - resend anyway ?')) ifFalse:[
  5171 	(self confirm:('Code modified - resend anyway ?')) ifFalse:[
  4932             ^ self
  5172 	    ^ self
  4933         ]
  5173 	]
  4934     ].
  5174     ].
  4935     inspecting ifTrue:[
  5175     inspecting ifTrue:[
  4936         ^ self showError:'** not avail in inspecting debugger **'
  5176 	^ self showError:'** not avail in inspecting debugger **'
  4937     ].
  5177     ].
  4938     steppedContext := wrapperContext := nil.
  5178     steppedContext := wrapperContext := nil.
  4939     haveControl := false.
  5179     haveControl := false.
  4940     exitAction := #resend. "exit private event-loop"
  5180     exitAction := #resend. "exit private event-loop"
  4941 
  5181 
  4949 
  5189 
  4950 doRestart
  5190 doRestart
  4951     "restart - the selected context will be restarted"
  5191     "restart - the selected context will be restarted"
  4952 
  5192 
  4953     self checkIfCodeIsReallyModified ifTrue:[
  5193     self checkIfCodeIsReallyModified ifTrue:[
  4954         (self confirm:('Code modified - restart anyway ?')) ifFalse:[
  5194 	(self confirm:('Code modified - restart anyway ?')) ifFalse:[
  4955             ^ self
  5195 	    ^ self
  4956         ]
  5196 	]
  4957     ].
  5197     ].
  4958     inspecting ifTrue:[
  5198     inspecting ifTrue:[
  4959         selectedContext isNil ifTrue:[
  5199 	selectedContext isNil ifTrue:[
  4960             ^ self showError:'** select a context first **'
  5200 	    ^ self showError:'** select a context first **'
  4961         ].
  5201 	].
  4962         self interruptProcessWith:[ selectedContext unwindAndRestart ].
  5202 	self interruptProcessWith:[ selectedContext unwindAndRestart ].
  4963         ^ self
  5203 	^ self
  4964     ].
  5204     ].
  4965     steppedContext := wrapperContext := nil.
  5205     steppedContext := wrapperContext := nil.
  4966     haveControl := false.
  5206     haveControl := false.
  4967     exitAction := #restart. "exit private event-loop"
  5207     exitAction := #restart. "exit private event-loop"
  4968 
  5208 
  4978 
  5218 
  4979 doReturn
  5219 doReturn
  4980     "return - the selected context will do a ^nil"
  5220     "return - the selected context will do a ^nil"
  4981 
  5221 
  4982     self checkIfCodeIsReallyModified ifTrue:[
  5222     self checkIfCodeIsReallyModified ifTrue:[
  4983         (self confirm:('Code modified - return anyway ?'))
  5223 	(self confirm:('Code modified - return anyway ?'))
  4984         ifFalse:[
  5224 	ifFalse:[
  4985             ^ self
  5225 	    ^ self
  4986         ]
  5226 	]
  4987     ].
  5227     ].
  4988 
  5228 
  4989     inspecting ifTrue:[
  5229     inspecting ifTrue:[
  4990         selectedContext isNil ifTrue:[
  5230 	selectedContext isNil ifTrue:[
  4991             ^ self showError:'** select a context first **'
  5231 	    ^ self showError:'** select a context first **'
  4992         ].
  5232 	].
  4993         self interruptProcessWith:[selectedContext unwind:nil].
  5233 	self interruptProcessWith:[selectedContext unwind:nil].
  4994         ^ self
  5234 	^ self
  4995     ].
  5235     ].
  4996 
  5236 
  4997     steppedContext := wrapperContext := nil.
  5237     steppedContext := wrapperContext := nil.
  4998     haveControl := false.
  5238     haveControl := false.
  4999     exitAction := #return.
  5239     exitAction := #return.
  5049     |con method|
  5289     |con method|
  5050 
  5290 
  5051     inspecting ifTrue:[^ self].
  5291     inspecting ifTrue:[^ self].
  5052 
  5292 
  5053     self checkIfCodeIsReallyModified ifTrue:[
  5293     self checkIfCodeIsReallyModified ifTrue:[
  5054         (self confirm:('Code modified - step anyway ?'))
  5294 	(self confirm:('Code modified - step anyway ?'))
  5055         ifFalse:[
  5295 	ifFalse:[
  5056             ^ self
  5296 	    ^ self
  5057         ]
  5297 	]
  5058     ].
  5298     ].
  5059 
  5299 
  5060     canContinue ifTrue:[
  5300     canContinue ifTrue:[
  5061         selectedContext notNil ifTrue:[
  5301 	selectedContext notNil ifTrue:[
  5062             con := actualContext. "/ selectedContext.
  5302 	    con := actualContext. "/ selectedContext.
  5063             steppedContextLineno := actualContext lineNumber.
  5303 	    steppedContextLineno := actualContext lineNumber.
  5064         ] ifFalse:[
  5304 	] ifFalse:[
  5065             con := contextArray at:2.
  5305 	    con := contextArray at:2.
  5066             steppedContextLineno := con lineNumber.
  5306 	    steppedContextLineno := con lineNumber.
  5067         ].
  5307 	].
  5068 
  5308 
  5069         skipLineNr := lineNrOrNilOrMinus1.
  5309 	skipLineNr := lineNrOrNilOrMinus1.
  5070 
  5310 
  5071         lineNrOrNilOrMinus1 == -1 ifTrue:[
  5311 	lineNrOrNilOrMinus1 == -1 ifTrue:[
  5072             steppedContextLineno := skipLineNr := nil.
  5312 	    steppedContextLineno := skipLineNr := nil.
  5073         ].
  5313 	].
  5074 
  5314 
  5075         (stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[
  5315 	(stepUntilEntering isNil and:[stepHow == #send]) ifTrue:[
  5076             steppedContext := contextArray at:1.
  5316 	    steppedContext := contextArray at:1.
  5077             stepHow := #nextIn.
  5317 	    stepHow := #nextIn.
  5078         ] ifFalse:[
  5318 	] ifFalse:[
  5079             stepHow == #nextOut ifTrue:[
  5319 	    stepHow == #nextOut ifTrue:[
  5080                 steppedContext := con home.
  5320 		steppedContext := con home.
  5081             ] ifFalse:[
  5321 	    ] ifFalse:[
  5082                 steppedContext := con.
  5322 		steppedContext := con.
  5083             ].
  5323 	    ].
  5084         ].
  5324 	].
  5085 
  5325 
  5086         wrapperContext := nil.
  5326 	wrapperContext := nil.
  5087 
  5327 
  5088 "/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR.
  5328 "/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR.
  5089 
  5329 
  5090         "
  5330 	"
  5091          if we step in a wrapped method,
  5331 	 if we step in a wrapped method,
  5092          prepare to skip the prolog ...
  5332 	 prepare to skip the prolog ...
  5093         "
  5333 	"
  5094 
  5334 
  5095         inWrap := false.
  5335 	inWrap := false.
  5096         method := con method.
  5336 	method := con method.
  5097         (method notNil
  5337 	(method notNil
  5098         and:[method isWrapped
  5338 	and:[method isWrapped
  5099         and:[method originalMethod ~~ method]]) ifTrue:[
  5339 	and:[method originalMethod ~~ method]]) ifTrue:[
  5100             inWrap := true
  5340 	    inWrap := true
  5101         ].
  5341 	].
  5102 
  5342 
  5103         lineNrOrNilOrMinus1 == #return ifTrue:[
  5343 	lineNrOrNilOrMinus1 == #return ifTrue:[
  5104             Processor activeProcess forceInterruptOnReturnOf:con.
  5344 	    Processor activeProcess forceInterruptOnReturnOf:con.
  5105         ].
  5345 	].
  5106 
  5346 
  5107         con := nil.
  5347 	con := nil.
  5108         bigStep := true.
  5348 	bigStep := true.
  5109         haveControl := false.
  5349 	haveControl := false.
  5110         exitAction := #step.
  5350 	exitAction := #step.
  5111 
  5351 
  5112         "exit private event-loop"
  5352 	"exit private event-loop"
  5113         catchBlock value.
  5353 	catchBlock value.
  5114 
  5354 
  5115         "/ not reached
  5355 	"/ not reached
  5116         'DebugView [warning]: step failed' errorPrintCR.
  5356 	'DebugView [warning]: step failed' errorPrintCR.
  5117         stepButton turnOff. nextButton turnOff. sendButton turnOff.
  5357 	stepButton turnOff. nextButton turnOff. sendButton turnOff.
  5118     ]
  5358     ]
  5119 
  5359 
  5120     "Modified: / 29.7.1998 / 21:50:16 / cg"
  5360     "Modified: / 29.7.1998 / 21:50:16 / cg"
  5121 !
  5361 !
  5122 
  5362 
  5127 
  5367 
  5128 doStop
  5368 doStop
  5129     "stop the process (if its running, otherwise this is a no-op)"
  5369     "stop the process (if its running, otherwise this is a no-op)"
  5130 
  5370 
  5131     inspecting ifTrue:[
  5371     inspecting ifTrue:[
  5132         device hasColors ifTrue:[
  5372 	self graphicsDevice hasColors ifTrue:[
  5133             continueButton foregroundColor:Color green darkened darkened.
  5373 	    continueButton foregroundColor:Color green darkened darkened.
  5134         ].
  5374 	].
  5135         continueButton label:(resources string:'Continue').
  5375 	continueButton label:(resources string:'Continue').
  5136         continueButton action:[self doContinue].
  5376 	continueButton action:[self doContinue].
  5137 
  5377 
  5138         self processPerform:#stop.
  5378 	self processPerform:#stop.
  5139 
  5379 
  5140         ^ self
  5380 	^ self
  5141     ].
  5381     ].
  5142 
  5382 
  5143     "Modified: 20.10.1996 / 18:30:48 / cg"
  5383     "Modified: 20.10.1996 / 18:30:48 / cg"
  5144 !
  5384 !
  5145 
  5385 
  5146 doTerminate
  5386 doTerminate
  5147     "terminate - the process has a chance for cleanup"
  5387     "terminate - the process has a chance for cleanup"
  5148 
  5388 
  5149     self checkIfCodeIsReallyModified ifTrue:[
  5389     self checkIfCodeIsReallyModified ifTrue:[
  5150         (self confirm:('Code modified - terminate anyway ?'))
  5390 	(self confirm:('Code modified - terminate anyway ?'))
  5151         ifFalse:[
  5391 	ifFalse:[
  5152             ^ self
  5392 	    ^ self
  5153         ]
  5393 	]
  5154     ].
  5394     ].
  5155 
  5395 
  5156     inspecting ifTrue:[
  5396     inspecting ifTrue:[
  5157         self processPerform:#terminate.
  5397 	self processPerform:#terminate.
  5158         ^ self
  5398 	^ self
  5159     ].
  5399     ].
  5160 
  5400 
  5161     steppedContext := wrapperContext := nil.
  5401     steppedContext := wrapperContext := nil.
  5162     haveControl := false.
  5402     haveControl := false.
  5163     exitAction := #terminate.
  5403     exitAction := #terminate.
  5165     "exit private event-loop"
  5405     "exit private event-loop"
  5166     catchBlock value.
  5406     catchBlock value.
  5167 
  5407 
  5168     "/ not reached (normally)
  5408     "/ not reached (normally)
  5169     inspecting ifFalse:[
  5409     inspecting ifFalse:[
  5170         'DebugView [warning]: terminate failed' errorPrintCR.
  5410 	'DebugView [warning]: terminate failed' errorPrintCR.
  5171         (self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[
  5411 	(self confirm:'Regular terminate failed - do it the hard way ?') ifTrue:[
  5172             Debugger newDebugger.
  5412 	    Debugger newDebugger.
  5173             Processor activeProcess terminate.
  5413 	    Processor activeProcess terminate.
  5174         ]
  5414 	]
  5175     ].
  5415     ].
  5176     terminateButton turnOff.
  5416     terminateButton turnOff.
  5177 
  5417 
  5178     "Modified: / 29.7.1998 / 21:50:35 / cg"
  5418     "Modified: / 29.7.1998 / 21:50:35 / cg"
  5179 !
  5419 !
  5209 
  5449 
  5210 doTraceStep
  5450 doTraceStep
  5211     "tracestep - not implemented yet"
  5451     "tracestep - not implemented yet"
  5212 
  5452 
  5213     canContinue ifTrue:[
  5453     canContinue ifTrue:[
  5214         tracing := true.
  5454 	tracing := true.
  5215         self doStep
  5455 	self doStep
  5216     ]
  5456     ]
  5217 !
  5457 !
  5218 
  5458 
  5219 exit
  5459 exit
  5220     "exit from menu: immediate exit from smalltalk"
  5460     "exit from menu: immediate exit from smalltalk"
  5221 
  5461 
  5222     OperatingSystem exit
  5462     OperatingSystem exit:10
  5223 !
  5463 !
  5224 
  5464 
  5225 findContextForWhich:aBlock thenDo:additionalAction
  5465 findContextForWhich:aBlock thenDo:additionalAction
  5226     |con|
  5466     |con|
  5227 
  5467 
  5228     con := self selectedContext.
  5468     con := self selectedContext.
  5229     con isNil ifTrue:[^ self].
  5469     con isNil ifTrue:[^ self].
  5230 
  5470 
  5231     con := con sender.
  5471     con := con sender.
  5232     [con notNil] whileTrue:[
  5472     [con notNil] whileTrue:[
  5233         (aBlock value:con) ifTrue:[
  5473 	(aBlock value:con) ifTrue:[
  5234             (self selectContext:con) ifTrue:[
  5474 	    (self selectContext:con) ifTrue:[
  5235                 additionalAction value:con.
  5475 		additionalAction value:con.
  5236                 ^ self.
  5476 		^ self.
  5237             ] 
  5477 	    ]
  5238         ].
  5478 	].
  5239         con := con sender.
  5479 	con := con sender.
  5240     ].
  5480     ].
  5241 
  5481 
  5242     Dialog information:'None found'.
  5482     Dialog information:'None found'.
  5243 !
  5483 !
  5244 
  5484 
  5246     |stringToSearch source|
  5486     |stringToSearch source|
  5247 
  5487 
  5248     stringToSearch := Dialog request:'Search what:'.
  5488     stringToSearch := Dialog request:'Search what:'.
  5249     stringToSearch isEmptyOrNil ifTrue:[^ self].
  5489     stringToSearch isEmptyOrNil ifTrue:[^ self].
  5250 
  5490 
  5251     self 
  5491     self
  5252         findContextForWhich:[:con |
  5492 	findContextForWhich:[:con |
  5253             con method notNil
  5493 	    con method notNil
  5254             and:[ (source := con method source) notNil
  5494 	    and:[ (source := con method source) notNil
  5255             and:[ (source includesString:stringToSearch) ]]
  5495 	    and:[ (source includesString:stringToSearch) ]]
  5256         ]
  5496 	]
  5257         thenDo:[:con |
  5497 	thenDo:[:con |
  5258             codeView searchFwd:stringToSearch.
  5498 	    codeView searchFwd:stringToSearch.
  5259         ]
  5499 	]
  5260 !
  5500 !
  5261 
  5501 
  5262 findContextWithValueInVariable
  5502 findContextWithValueInVariable
  5263     |valueStringToSearch|
  5503     |valueStringToSearch|
  5264 
  5504 
  5265     valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'.
  5505     valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'.
  5266     valueStringToSearch isEmptyOrNil ifTrue:[^ self].
  5506     valueStringToSearch isEmptyOrNil ifTrue:[^ self].
  5267 
  5507 
  5268     self 
  5508     self
  5269         findContextForWhich:[:con |
  5509 	findContextForWhich:[:con |
  5270             con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase]
  5510 	    con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase]
  5271         ]
  5511 	]
  5272         thenDo:[:con | ]
  5512 	thenDo:[:con | ]
  5273 !
  5513 !
  5274 
  5514 
  5275 findHandlerFor
  5515 findHandlerFor
  5276     |exClass con|
  5516     |exClass con|
  5277 
  5517 
  5278     (con := self selectedContext) isNil ifTrue:[ 
  5518     (con := self selectedContext) isNil ifTrue:[
  5279         con := contextArray at:1
  5519 	con := contextArray at:1
  5280     ].
  5520     ].
  5281     con sender isNil ifTrue:[
  5521     con sender isNil ifTrue:[
  5282         self information:'Context has already returned'.
  5522 	self information:'Context has already returned'.
  5283         ^ self
  5523 	^ self
  5284     ].
  5524     ].
  5285 
  5525 
  5286     exClass := Dialog 
  5526     exClass := Dialog
  5287                 choose:'Exception class:'
  5527 		choose:'Exception class:'
  5288                 fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name])
  5528 		fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name])
  5289                 lines:25
  5529 		lines:25
  5290                 title:'Choose Exception class'.
  5530 		title:'Choose Exception class'.
  5291 
  5531     exClass isNil ifTrue:[^ self].
  5292     self 
  5532 
  5293         findContextForWhich:[:con |
  5533     self
  5294             con isHandleContext 
  5534 	findContextForWhich:[:con |
  5295             and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ] 
  5535 	    con isHandleContext
  5296         ]
  5536 	    and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ]
  5297         thenDo:[:con | 
  5537 	]
  5298             self selectContext:con sender.
  5538 	thenDo:[:con |
  5299         ]
  5539 	    self selectContext:con sender.
       
  5540 	]
       
  5541 !
       
  5542 
       
  5543 findHomeContext
       
  5544     |con home|
       
  5545 
       
  5546     (con := self selectedContext) isNil ifTrue:[
       
  5547 	self beep.
       
  5548 	^ self.
       
  5549     ].
       
  5550     (home := con home) isNil ifTrue:[
       
  5551 	self beep.
       
  5552 	^ self.
       
  5553     ].
       
  5554 
       
  5555     "/ still have to find it - home could be elsewhere (another process)
       
  5556     "/ (i.e. cannot simply select it)
       
  5557 
       
  5558     self
       
  5559 	findContextForWhich:[:con |
       
  5560 	    con == home
       
  5561 	]
       
  5562 	thenDo:[:con |
       
  5563 	    self selectContext:con.
       
  5564 	]
  5300 !
  5565 !
  5301 
  5566 
  5302 findNextExceptionHandlerContext
  5567 findNextExceptionHandlerContext
  5303     self 
  5568     self
  5304         findContextForWhich:[:con |
  5569 	findContextForWhich:[:con |
  5305             con isHandleContext 
  5570 	    con isHandleContext
  5306         ]
  5571 	]
  5307         thenDo:[:con | 
  5572 	thenDo:[:con |
  5308             self selectContext:con sender.
  5573 	    self selectContext:con sender.
  5309         ]
  5574 	]
  5310 !
  5575 !
  5311 
  5576 
  5312 inspectContext
  5577 inspectContext
  5313     "launch an inspector on the currently selected context"
  5578     "launch an inspector on the currently selected context"
  5314 
  5579 
  5315     |con|
  5580     |con|
  5316 
  5581 
  5317     (con := self selectedContext) notNil ifTrue:[
  5582     (con := self selectedContext) notNil ifTrue:[
  5318         con inspect.
  5583 	con inspect.
  5319     ]
  5584     ]
  5320 
  5585 
  5321     "Modified: / 17-07-2012 / 12:52:34 / cg"
  5586     "Modified: / 17-07-2012 / 12:52:34 / cg"
       
  5587 !
       
  5588 
       
  5589 inspectContextsMethod
       
  5590     "launch an inspector on the currently selected context's method"
       
  5591 
       
  5592     |con|
       
  5593 
       
  5594     (con := self selectedContext) notNil ifTrue:[
       
  5595 	con method inspect.
       
  5596     ]
  5322 !
  5597 !
  5323 
  5598 
  5324 inspectWidgetHierarchy
  5599 inspectWidgetHierarchy
  5325     |rcvr view|
  5600     |rcvr view|
  5326 
  5601 
  5327     selectedContext isNil ifTrue:[ ^ self ].
  5602     selectedContext isNil ifTrue:[ ^ self ].
  5328     Tools::ViewTreeInspectorApplication isNil ifTrue:[
  5603     Tools::ViewTreeInspectorApplication isNil ifTrue:[
  5329         Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'.
  5604 	Dialog warn:'Missing class: Tools::ViewTreeInspectorApplication'.
  5330         ^ self.
  5605 	^ self.
  5331     ].
  5606     ].
  5332 
  5607 
  5333     rcvr := selectedContext receiver.
  5608     rcvr := selectedContext receiver.
  5334     rcvr isView ifTrue:[
  5609     rcvr isView ifTrue:[
  5335         view := rcvr
  5610 	view := rcvr
  5336     ] ifFalse:[
  5611     ] ifFalse:[
  5337         view := rcvr window
  5612 	view := rcvr window
  5338     ].
  5613     ].
  5339     Tools::ViewTreeInspectorApplication openOn:view
  5614     Tools::ViewTreeInspectorApplication openOn:view
  5340 !
  5615 !
  5341 
  5616 
  5342 middleButtonMenu
  5617 middleButtonMenu
  5343     <resource: #programMenu >
  5618     <resource: #programMenu >
  5344 
  5619 
  5345     |items m nameOfExecutable|
  5620     |items m nameOfExecutable|
  5346 
  5621 
  5347     exclusive ifTrue:[
  5622     exclusive ifTrue:[
  5348         items := #(
  5623 	items := #(
  5349                     ('Show More WalkBack'               showMore                )
  5624 		    ('Show More WalkBack'               showMore                )
  5350                     ('-'                                                        )
  5625 		    ('-'                                                        )
  5351                     ('Add Breakpoint'                   addBreakpoint           )
  5626 		    ('Add Breakpoint'                   addBreakpoint           )
  5352                     ('Remove Breakpoint'                removeBreakpoint        )
  5627 		    ('Remove Breakpoint'                removeBreakpoint        )
  5353                     ('Remove all Break- && Tracepoints'  removeAllBreakpoints   )
  5628 		    ('Remove all Break- && Tracepoints'  removeAllBreakpoints   )
  5354                     ('-'                                                        )
  5629 		    ('-'                                                        )
  5355                   ).
  5630 		  ).
  5356     ] ifFalse:[
  5631     ] ifFalse:[
  5357         items := #(
  5632 	items := #(
  5358                     ('Show More WalkBack'               showMore                )
  5633 		    ('Show More WalkBack'               showMore                )
  5359                     ('-'                                                        )
  5634 		    ('-'                                                        )
  5360                     ('Skip'                             skip                    )
  5635 		    ('Skip'                             skip                    )
  5361                     ('Step Out'                         skipForReturn           )
  5636 		    ('Step Out'                         skipForReturn           )
  5362                     ('Skip until Entering...'           skipUntilEntering       )
  5637 		    ('Skip until Entering...'           skipUntilEntering       )
  5363                     ('-'                                                        )
  5638 		    ('-'                                                        )
  5364 "
  5639 "
  5365                     ('Continue'                         doContinue              )
  5640 		    ('Continue'                         doContinue              )
  5366                     ('Terminate'                        doTerminate             )
  5641 		    ('Terminate'                        doTerminate             )
  5367                     ('Abort'                            doAbort                 )
  5642 		    ('Abort'                            doAbort                 )
  5368                     ('-'                                                        )
  5643 		    ('-'                                                        )
  5369                     ('Step'                             doStep                  )
  5644 		    ('Step'                             doStep                  )
  5370                     ('Send'                             doSend                  )
  5645 		    ('Send'                             doSend                  )
  5371                     ('-'                                                        )
  5646 		    ('-'                                                        )
  5372                     ('Return'                           doReturn                )
  5647 		    ('Return'                           doReturn                )
  5373                     ('Restart'                          doRestart               )
  5648 		    ('Restart'                          doRestart               )
  5374                     ('-'                                                        )
  5649 		    ('-'                                                        )
  5375 "
  5650 "
  5376                     ('Add Breakpoint'                   addBreakpoint           )
  5651 		    ('Add Breakpoint'                   addBreakpoint           )
  5377                     ('Remove Breakpoint'                removeBreakpoint        )
  5652 		    ('Remove Breakpoint'                removeBreakpoint        )
  5378                     ('Remove all Break- & Tracepoints'  removeAllBreakpoints    )
  5653 		    ('Remove all Break- & Tracepoints'  removeAllBreakpoints    )
  5379                 ).
  5654 		).
  5380 
  5655 
  5381 "/        self allowBreakPointsInDebugger ifFalse:[
  5656 "/        self allowBreakPointsInDebugger ifFalse:[
  5382 "/            items := items , #(
  5657 "/            items := items , #(
  5383 "/                        ('Allow Breakpoints & halt in Debugger'      doNotIgnoreBreakpoints  )
  5658 "/                        ('Allow Breakpoints & halt in Debugger'      doNotIgnoreBreakpoints  )
  5384 "/                    ).
  5659 "/                    ).
  5386 "/            items := items , #(
  5661 "/            items := items , #(
  5387 "/                        ('Ignore Breakpoints & halt in Debugger'     doIgnoreBreakpoints  )
  5662 "/                        ('Ignore Breakpoints & halt in Debugger'     doIgnoreBreakpoints  )
  5388 "/                    ).
  5663 "/                    ).
  5389 "/        ].
  5664 "/        ].
  5390 
  5665 
  5391         items := items , #(
  5666 	items := items , #(
  5392                     ('-'                                                        )
  5667 		    ('-'                                                        )
  5393                     ('Browse Implementing Class'      browseImplementingClass )
  5668 		    ('Browse Implementing Class'      browseImplementingClass )
  5394                     ('Browse Receiver''s Class'             browseReceiversClass    )
  5669 		    ('Browse Receiver''s Class'             browseReceiversClass    )
  5395                     ('Browse Blocks''s Home'                browseBlocksHome    )
  5670 		    ('Browse Blocks''s Home'                browseBlocksHome    )
  5396 "/                    ('Browse Receivers Class Hierarchy'   browseClassHierarchy    )
  5671 "/                    ('Browse Receivers Class Hierarchy'   browseClassHierarchy    )
  5397 "/                    ('Browse Receivers Full Protocol'     browseFullClassProtocol )
  5672 "/                    ('Browse Receivers Full Protocol'     browseFullClassProtocol )
  5398                     ('Implementors'                     browseImplementors      )
  5673 		    ('Implementors'                     browseImplementors      )
  5399                     ('Implementors Of...'               browseImplementorsOf    )
  5674 		    ('Implementors Of...'               browseImplementorsOf    )
  5400                     ('Senders'                          browseSenders           )
  5675 		    ('Senders'                          browseSenders           )
  5401                     ('Senders Of...'                    browseSendersOf         )
  5676 		    ('Senders Of...'                    browseSendersOf         )
  5402                     ('-'                                                        )
  5677 		    ('-'                                                        )
  5403                     ('Inspect Context'                  inspectContext          )
  5678 		    ('Inspect Context'                  inspectContext          )
  5404                   ).
  5679 		  ).
  5405     ].
  5680     ].
  5406 
  5681 
  5407     items := items , #(
  5682     items := items , #(
  5408                 ('Copy WalkBack Text'               copyWalkbackText        )
  5683 		('Copy WalkBack Text'               copyWalkbackText        )
  5409                 ('-'                                                        )
  5684 		('-'                                                        )
  5410                 ('Hard Terminate (Danger)'          quickTerminate          )
  5685 		('Hard Terminate (Danger)'          quickTerminate          )
  5411                 ('='                                                        )).
  5686 		('='                                                        )).
  5412 
  5687 
  5413     nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName.
  5688     nameOfExecutable := OperatingSystem nameOfSTXExecutable asFilename withoutSuffix baseName.
  5414     nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ].
  5689     nameOfExecutable = 'stx' ifTrue:[ nameOfExecutable := 'Smalltalk' ].
  5415 
  5690 
  5416     items := items , {
  5691     items := items , {
  5417         { 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit                 }}.
  5692 	{ 'Exit %1 (No Confirmation)' bindWith:nameOfExecutable. #exit                 }}.
  5418 
  5693 
  5419     m := PopUpMenu
  5694     m := PopUpMenu
  5420                 itemList:items
  5695 		itemList:items
  5421                 resources:resources
  5696 		resources:resources
  5422                 receiver:self
  5697 		receiver:self
  5423                 for:contextView.
  5698 		for:contextView.
  5424 
  5699 
  5425     inspecting ifTrue:[
  5700     inspecting ifTrue:[
  5426         m notNil ifTrue:[
  5701 	m notNil ifTrue:[
  5427             m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass
  5702 	    m disableAll:#(doTraceStep removeBreakpoint browseImplementingClass browseReceiversClass
  5428                            browseClassHierarchy browseFullClassProtocol
  5703 			   browseClassHierarchy browseFullClassProtocol
  5429                            browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut).
  5704 			   browseImplementors browseSenders browseBlocksHome inspectContext skip doStepOut).
  5430         ].
  5705 	].
  5431     ].
  5706     ].
  5432     self updateMenuItems.
  5707     self updateMenuItems.
  5433 
  5708 
  5434     ^ m.
  5709     ^ m.
  5435 
  5710 
  5436     "Modified: / 22-07-2013 / 15:30:05 / cg"
  5711     "Modified: / 22-07-2013 / 15:30:05 / cg"
       
  5712 !
       
  5713 
       
  5714 notShowingDenseWalkbackHolder
       
  5715     ^ BlockValue forLogicalNot: self showingDenseWalkbackHolder.
  5437 !
  5716 !
  5438 
  5717 
  5439 notShowingSupportCode
  5718 notShowingSupportCode
  5440     ^ hideSupportCode == true.
  5719     ^ hideSupportCode == true.
  5441 
  5720 
  5449 
  5728 
  5450     "Modified: / 12-09-2006 / 17:20:38 / cg"
  5729     "Modified: / 12-09-2006 / 17:20:38 / cg"
  5451 !
  5730 !
  5452 
  5731 
  5453 openSettingsDialog
  5732 openSettingsDialog
  5454     |settingsList settingsApp|
  5733     |settingsList|
  5455 
  5734 
  5456     settingsList :=
  5735     settingsList :=
  5457         #(
  5736 	#(
  5458            #('Debugger'       #'AbstractSettingsApplication::DebuggerSettingsAppl'            )
  5737 	   #('Debugger'       #'AbstractSettingsApplication::DebuggerSettingsAppl'            )
  5459            #('Editor'         #'AbstractSettingsApplication::EditSettingsAppl'                )
  5738 	   #('Editor'         #'AbstractSettingsApplication::EditSettingsAppl'                )
  5460            #('Syntax Color'   #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
  5739 	   #('Syntax Color'   #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
  5461            #('Code Format'    #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
  5740 	   #('Code Format'    #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
  5462         ).
  5741 	).
  5463 
  5742 
  5464     settingsApp := SettingsDialog new.
  5743     SettingsDialog
  5465     "/ settingsApp requestor:self.
  5744 	openWithList:settingsList
  5466     settingsApp installSettingsEntries:settingsList.
  5745 	label:(resources string:'Debugger Settings').
  5467     settingsApp allButOpen.
       
  5468     settingsApp window label:('Debugger Settings').
       
  5469     settingsApp openWindow.
       
  5470 !
  5746 !
  5471 
  5747 
  5472 processesApplication
  5748 processesApplication
  5473     "if the debugged process is a GUI process,
  5749     "if the debugged process is a GUI process,
  5474      AND it has an applicaiton, return it.
  5750      AND it has an applicaiton, return it.
  5475      Otherwise, return nil"
  5751      Otherwise, return nil"
  5476 
  5752 
  5477     |p wgs app|
  5753     |p wgs app nonModalWGs|
  5478 
  5754 
  5479     p := inspectedProcess ? Processor activeProcess.
  5755     p := inspectedProcess ? Processor activeProcess.
  5480     (p notNil and:[p isGUIProcess]) ifTrue:[
  5756     (p notNil and:[p isGUIProcess]) ifTrue:[
  5481         wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p].
  5757 	wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p].
  5482         wgs do:[:wg |
  5758 	nonModalWGs := wgs reject:[:wg | wg isModal].
  5483             |wgi|
  5759 	nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application].
  5484 
  5760 
  5485             wgi := wg.
  5761 	wgs do:[:wg |
  5486             [wgi notNil] whileTrue:[
  5762 	    |wgi|
  5487                 (app := wgi application) notNil ifTrue:[^ app].
  5763 
  5488                 wgi isModal ifTrue:[
  5764 	    wgi := wg.
  5489                     wgi := wgi previousGroup
  5765 	    [wgi notNil] whileTrue:[
  5490                 ] ifFalse:[
  5766 		(app := wgi application) notNil ifTrue:[^ app].
  5491                     wgi := nil.
  5767 		wgi isModal ifTrue:[
  5492                 ]
  5768 		    wgi := wgi previousGroup
  5493             ]
  5769 		] ifFalse:[
  5494         ]
  5770 		    wgi := nil.
       
  5771 		]
       
  5772 	    ]
       
  5773 	]
  5495     ].
  5774     ].
  5496     ^ nil
  5775     ^ nil
  5497 !
  5776 !
  5498 
  5777 
  5499 quickTerminate
  5778 quickTerminate
  5500     "quick terminate - the process will get no chance for cleanup actions"
  5779     "quick terminate - the process will get no chance for cleanup actions"
  5501 
  5780 
  5502     inspecting ifTrue:[
  5781     inspecting ifTrue:[
  5503         self processPerform:#terminateNoSignal.
  5782 	self processPerform:#terminateNoSignal.
  5504         ^ self
  5783 	^ self
  5505     ].
  5784     ].
  5506 
  5785 
  5507     steppedContext := wrapperContext := nil.
  5786     steppedContext := wrapperContext := nil.
  5508     haveControl := false.
  5787     haveControl := false.
  5509     exitAction := #quickTerminate.
  5788     exitAction := #quickTerminate.
  5511     "exit private event-loop"
  5790     "exit private event-loop"
  5512     catchBlock value.
  5791     catchBlock value.
  5513 
  5792 
  5514     "/ not reached (normally)
  5793     "/ not reached (normally)
  5515     inspecting ifFalse:[
  5794     inspecting ifFalse:[
  5516         'DebugView [warning]: quick terminate failed' errorPrintCR.
  5795 	'DebugView [warning]: quick terminate failed' errorPrintCR.
  5517         (self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[
  5796 	(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[
  5518             Debugger newDebugger.
  5797 	    Debugger newDebugger.
  5519             Processor activeProcess terminateNoSignal.
  5798 	    Processor activeProcess terminateNoSignal.
  5520         ]
  5799 	]
  5521     ].
  5800     ].
  5522     terminateButton turnOff.
  5801     terminateButton turnOff.
  5523 
  5802 
  5524     "Modified: 10.1.1997 / 17:42:10 / cg"
  5803     "Modified: 10.1.1997 / 17:42:10 / cg"
  5525 !
  5804 !
  5538 selectContext:aContext
  5817 selectContext:aContext
  5539     |idx|
  5818     |idx|
  5540 
  5819 
  5541     idx := contextArray identityIndexOf:aContext.
  5820     idx := contextArray identityIndexOf:aContext.
  5542     idx == 0 ifTrue:[
  5821     idx == 0 ifTrue:[
  5543         "/ some contexts hidden?
  5822 	"/ some contexts hidden?
  5544         (self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[
  5823 	(self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[
  5545             Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'.
  5824 	    Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'.
  5546             self showFullWalkback.
  5825 	    self showFullWalkback.
  5547             self showingDenseWalkback:false.
  5826 	    self showingDenseWalkback:false.
  5548             self showingSupportCode:true.
  5827 	    self showingSupportCode:true.
  5549         ].
  5828 	].
  5550         idx := contextArray identityIndexOf:aContext.
  5829 	idx := contextArray identityIndexOf:aContext.
  5551     ].
  5830     ].
  5552     idx ~~ 0 ifTrue:[
  5831     idx ~~ 0 ifTrue:[
  5553         self selectContextWithIndex:idx.
  5832 	self selectContextWithIndex:idx.
  5554         ^ true.
  5833 	^ true.
  5555     ].
  5834     ].
  5556     ^ false
  5835     ^ false
  5557 !
  5836 !
  5558 
  5837 
  5559 selectedContext
  5838 selectedContext
  5560     contextView selection notNil ifTrue:[
  5839     contextView selection notNil ifTrue:[
  5561         (contextView selectionValue startsWith:'**') ifFalse:[
  5840 	(contextView selectionValue startsWith:'**') ifFalse:[
  5562             ^ (contextArray at:(contextView selection)).
  5841 	    ^ (contextArray at:(contextView selection)).
  5563         ]
  5842 	]
  5564     ].
  5843     ].
  5565     ^ nil
  5844     ^ nil
  5566 
  5845 
  5567     "Created: / 17-07-2012 / 12:52:10 / cg"
  5846     "Created: / 17-07-2012 / 12:52:10 / cg"
  5568 !
  5847 !
  5569 
  5848 
  5570 showFullWalkback
  5849 showFullWalkback
  5571     "double the number of contexts shown"
  5850     "double the number of contexts shown"
  5572 
  5851 
  5573     contextArray notNil ifTrue:[
  5852     contextArray notNil ifTrue:[
  5574         nChainShown := 9999.
  5853 	nChainShown := 9999.
  5575         self redisplayBacktrace.
  5854 	self redisplayBacktrace.
  5576     ]
  5855     ]
  5577 
  5856 
  5578     "Created: / 23-07-2012 / 12:24:02 / cg"
  5857     "Created: / 23-07-2012 / 12:24:02 / cg"
  5579 !
  5858 !
  5580 
  5859 
  5581 showMore
  5860 showMore
  5582     "double the number of contexts shown"
  5861     "double the number of contexts shown"
  5583 
  5862 
  5584     contextArray notNil ifTrue:[
  5863     contextArray notNil ifTrue:[
  5585         nChainShown := nChainShown * 2.
  5864 	nChainShown := nChainShown * 2.
  5586         self redisplayBacktrace.
  5865 	self redisplayBacktrace.
  5587     ]
  5866     ]
  5588 
  5867 
  5589     "Modified: / 17.11.2001 / 20:14:31 / cg"
  5868     "Modified: / 17.11.2001 / 20:14:31 / cg"
  5590 !
  5869 !
  5591 
  5870 
  5595 
  5874 
  5596     "Created: / 10-06-2012 / 21:27:53 / cg"
  5875     "Created: / 10-06-2012 / 21:27:53 / cg"
  5597 !
  5876 !
  5598 
  5877 
  5599 showingDenseWalkback
  5878 showingDenseWalkback
  5600     ^ verboseBacktrace == false.
  5879     ^ self verboseBacktraceHolder value not
  5601 
  5880 
  5602     "Created: / 17.11.2001 / 20:13:53 / cg"
  5881     "Created: / 17.11.2001 / 20:13:53 / cg"
  5603 !
  5882 !
  5604 
  5883 
  5605 showingDenseWalkback:aBoolean
  5884 showingDenseWalkback:aBoolean
  5606     verboseBacktrace := aBoolean not.
  5885     self verboseBacktraceHolder value:aBoolean not.
  5607     self redisplayBacktrace.
  5886     self redisplayBacktrace.
  5608 
  5887 
  5609     "Created: / 27-07-2012 / 14:58:00 / cg"
  5888     "Created: / 27-07-2012 / 14:58:00 / cg"
       
  5889 !
       
  5890 
       
  5891 showingDenseWalkbackHolder
       
  5892     ^ BlockValue forLogicalNot:self verboseBacktraceHolder
  5610 !
  5893 !
  5611 
  5894 
  5612 showingSupportCode
  5895 showingSupportCode
  5613     ^ hideSupportCode == false.
  5896     ^ hideSupportCode == false.
  5614 
  5897 
  5621 
  5904 
  5622     "Created: / 27-07-2012 / 14:58:00 / cg"
  5905     "Created: / 27-07-2012 / 14:58:00 / cg"
  5623 !
  5906 !
  5624 
  5907 
  5625 showingVerboseWalkback
  5908 showingVerboseWalkback
  5626     ^ verboseBacktrace == true.
  5909     ^ self verboseBacktraceHolder value
  5627 
  5910 
  5628     "Created: / 17.11.2001 / 20:13:46 / cg"
  5911     "Created: / 17.11.2001 / 20:13:46 / cg"
  5629 !
  5912 !
  5630 
  5913 
  5631 sizeChanged:how
  5914 sizeChanged:how
  5657     "skip until some particular method is invoked."
  5940     "skip until some particular method is invoked."
  5658 
  5941 
  5659     |selector|
  5942     |selector|
  5660 
  5943 
  5661     selector := Dialog
  5944     selector := Dialog
  5662                 request:'Skip until entering what (matchpattern):'
  5945 		request:'Skip until entering what (matchpattern):'
  5663                 initialAnswer:self goodSkipUntilSelector.
  5946 		initialAnswer:self goodSkipUntilSelector.
  5664     selector size == 0 ifTrue:[^ self].
  5947     selector size == 0 ifTrue:[^ self].
  5665 
  5948 
  5666     stepUntilEntering := selector asSymbol.
  5949     stepUntilEntering := selector asSymbol.
  5667     stepHow := #send.
  5950     stepHow := #send.
  5668     self doStep:-1.
  5951     self doStep:-1.
  5670     "Modified: 3.3.1997 / 20:56:32 / cg"
  5953     "Modified: 3.3.1997 / 20:56:32 / cg"
  5671 !
  5954 !
  5672 
  5955 
  5673 toggleShowSupportCode
  5956 toggleShowSupportCode
  5674     hideSupportCode ifTrue:[
  5957     hideSupportCode ifTrue:[
  5675         self showSupportCode
  5958 	self showSupportCode
  5676     ] ifFalse:[
  5959     ] ifFalse:[
  5677         self hideSupportCode
  5960 	self hideSupportCode
  5678     ].
  5961     ].
  5679 
  5962 
  5680     "Modified: / 17-11-2001 / 20:07:45 / cg"
  5963     "Modified: / 17-11-2001 / 20:07:45 / cg"
  5681     "Created: / 10-06-2012 / 21:28:17 / cg"
  5964     "Created: / 10-06-2012 / 21:28:17 / cg"
  5682 !
  5965 !
  5692 
  5975 
  5693     |m mthd cls mCls rCls|
  5976     |m mthd cls mCls rCls|
  5694 
  5977 
  5695     m := contextView middleButtonMenu.
  5978     m := contextView middleButtonMenu.
  5696     m notNil ifTrue:[
  5979     m notNil ifTrue:[
  5697         m disable:#removeBreakpoint.
  5980 	m disable:#removeBreakpoint.
  5698         m disable:#addBreakpoint.
  5981 	m disable:#addBreakpoint.
  5699         canShowMore ifFalse:[
  5982 	canShowMore ifFalse:[
  5700             m disable:#showMore
  5983 	    m disable:#showMore
  5701         ].
  5984 	].
  5702 
  5985 
  5703         selectedContext notNil ifTrue:[
  5986 	selectedContext notNil ifTrue:[
  5704             m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn).
  5987 	    m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn).
  5705 
  5988 
  5706             mthd := selectedContext method.
  5989 	    mthd := selectedContext method.
  5707             mthd notNil ifTrue:[
  5990 	    mthd notNil ifTrue:[
  5708                 cls := mCls := mthd containingClass.
  5991 		cls := mCls := mthd containingClass.
  5709                 mthd isBreakpointed ifTrue:[
  5992 		mthd isBreakpointed ifTrue:[
  5710                     m enable:#removeBreakpoint.
  5993 		    m enable:#removeBreakpoint.
  5711                 ] ifFalse:[
  5994 		] ifFalse:[
  5712                     m enable:#addBreakpoint.
  5995 		    m enable:#addBreakpoint.
  5713                 ]
  5996 		]
  5714             ].
  5997 	    ].
  5715             (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[
  5998 	    (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[
  5716                 "/ a cheap block's context
  5999 		"/ a cheap block's context
  5717             ] ifFalse:[
  6000 	    ] ifFalse:[
  5718                 rCls := selectedContext receiver class.
  6001 		rCls := selectedContext receiver class.
  5719                 cls isNil ifTrue:[
  6002 		cls isNil ifTrue:[
  5720                     cls := rCls
  6003 		    cls := rCls
  5721                 ].
  6004 		].
  5722             ].
  6005 	    ].
  5723             cls notNil ifTrue:[
  6006 	    cls notNil ifTrue:[
  5724                 m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  6007 		m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  5725                 rCls == mCls ifTrue:[
  6008 		rCls == mCls ifTrue:[
  5726                     m disable:#browseReceiversClass
  6009 		    m disable:#browseReceiversClass
  5727                 ].
  6010 		].
  5728                 mCls isNil ifTrue:[
  6011 		mCls isNil ifTrue:[
  5729                     m disable:#browseImplementingClass
  6012 		    m disable:#browseImplementingClass
  5730                 ]
  6013 		]
  5731 
  6014 
  5732             ] ifFalse:[
  6015 	    ] ifFalse:[
  5733                 m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  6016 		m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  5734             ].
  6017 	    ].
  5735             mthd notNil ifTrue:[
  6018 	    mthd notNil ifTrue:[
  5736                 m enableAll:#(browseImplementingClass).
  6019 		m enableAll:#(browseImplementingClass).
  5737             ].
  6020 	    ].
  5738             selectedContext isCheapBlockContext ifTrue:[
  6021 	    selectedContext isCheapBlockContext ifTrue:[
  5739                 m disableAll:#(browseReceiversClass).
  6022 		m disableAll:#(browseReceiversClass).
  5740             ].
  6023 	    ].
  5741             selectedContext receiver isBlock ifTrue:[
  6024 	    selectedContext receiver isBlock ifTrue:[
  5742                 m enableAll:#(browseBlocksHome).
  6025 		m enableAll:#(browseBlocksHome).
  5743             ] ifFalse:[
  6026 	    ] ifFalse:[
  5744                 m disableAll:#(browseBlocksHome).
  6027 		m disableAll:#(browseBlocksHome).
  5745             ].
  6028 	    ].
  5746         ] ifFalse:[
  6029 	] ifFalse:[
  5747             m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy 
  6030 	    m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy
  5748                            browseBlocksHome browseFullClassProtocol).
  6031 			   browseBlocksHome browseFullClassProtocol).
  5749         ]
  6032 	]
  5750     ]
  6033     ]
  5751 
  6034 
  5752     "Modified: / 19-07-2012 / 11:53:30 / cg"
  6035     "Modified: / 19-07-2012 / 11:53:30 / cg"
  5753 ! !
  6036 ! !
  5754 
  6037 
  5758     "add a breakpoint on the selected contexts method - if any"
  6041     "add a breakpoint on the selected contexts method - if any"
  5759 
  6042 
  5760     |implementorClass method|
  6043     |implementorClass method|
  5761 
  6044 
  5762     selectedContext isNil ifTrue:[
  6045     selectedContext isNil ifTrue:[
  5763         ^ self showError:'** select a context first **'
  6046 	^ self showError:'** select a context first **'
  5764     ].
  6047     ].
  5765     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6048     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  5766         ^ self
  6049 	^ self
  5767     ].
  6050     ].
  5768 
  6051 
  5769     implementorClass := selectedContext methodClass.
  6052     implementorClass := selectedContext methodClass.
  5770     implementorClass notNil ifTrue:[
  6053     implementorClass notNil ifTrue:[
  5771         method := implementorClass compiledMethodAt:selectedContext selector.
  6054 	method := implementorClass compiledMethodAt:selectedContext selector.
  5772         (method notNil and:[method isBreakpointed not]) ifTrue:[
  6055 	(method notNil and:[method isBreakpointed not]) ifTrue:[
  5773             method setBreakPoint
  6056 	    method setBreakPoint
  5774         ]
  6057 	]
  5775     ].
  6058     ].
  5776     contextView middleButtonMenu disable:#addBreakpoint.
  6059     contextView middleButtonMenu disable:#addBreakpoint.
  5777     contextView middleButtonMenu enable:#removeBreakpoint.
  6060     contextView middleButtonMenu enable:#removeBreakpoint.
  5778 
  6061 
  5779     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6062     "Modified: / 13.1.1998 / 00:24:47 / cg"
  5795 
  6078 
  5796 doNotIgnoreBreakpoints
  6079 doNotIgnoreBreakpoints
  5797     self allowBreakPointsInDebugger:true
  6080     self allowBreakPointsInDebugger:true
  5798 !
  6081 !
  5799 
  6082 
       
  6083 ignoreAllHaltsForCurrentProcess
       
  6084     self
       
  6085 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
       
  6086 	orThisReceiverClass:false orCurrentProcess:true
       
  6087 	orIfCalledFromMethod:nil
       
  6088 	forAll:true.
       
  6089 
       
  6090     "Created: / 27-01-2012 / 11:32:14 / cg"
       
  6091 !
       
  6092 
       
  6093 ignoreAllHaltsForThisReceiverClass
       
  6094     self
       
  6095 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
       
  6096 	orThisReceiverClass:true orCurrentProcess:false
       
  6097 	orIfCalledFromMethod:nil
       
  6098 	forAll:true.
       
  6099 
       
  6100     "Created: / 27-01-2012 / 11:32:14 / cg"
       
  6101 !
       
  6102 
  5800 ignoreAllHaltsForever
  6103 ignoreAllHaltsForever
  5801     self 
  6104     self
  5802         addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false 
  6105 	addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false
  5803         orThisReceiverClass:false orCurrentProcess:false 
  6106 	orThisReceiverClass:false orCurrentProcess:false
  5804         forAll:true.
  6107 	orIfCalledFromMethod:nil
       
  6108 	forAll:true.
  5805 
  6109 
  5806     "Created: / 08-05-2011 / 10:19:56 / cg"
  6110     "Created: / 08-05-2011 / 10:19:56 / cg"
  5807 !
  6111 !
  5808 
  6112 
       
  6113 ignoreAllHaltsIfCalledFromMethod:aMethod
       
  6114     self
       
  6115 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
       
  6116 	orThisReceiverClass:false orCurrentProcess:false
       
  6117 	orIfCalledFromMethod:aMethod
       
  6118 	forAll:true.
       
  6119 !
       
  6120 
  5809 ignoreAllHaltsUntilShiftKeyIsPressed
  6121 ignoreAllHaltsUntilShiftKeyIsPressed
  5810     self 
  6122     self
  5811         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true 
  6123 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  5812         orThisReceiverClass:false orCurrentProcess:false 
  6124 	orThisReceiverClass:false orCurrentProcess:false
  5813         forAll:true.
  6125 	orIfCalledFromMethod:nil
       
  6126 	forAll:true.
  5814 
  6127 
  5815     "Created: / 27-01-2012 / 11:32:14 / cg"
  6128     "Created: / 27-01-2012 / 11:32:14 / cg"
  5816 !
  6129 !
  5817 
  6130 
  5818 ignoreBreakpointsWithThisParameterForever
  6131 ignoreBreakpointsWithThisParameterForever
  5821 
  6134 
  5822     "Created: / 06-03-2012 / 12:35:48 / cg"
  6135     "Created: / 06-03-2012 / 12:35:48 / cg"
  5823 !
  6136 !
  5824 
  6137 
  5825 ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
  6138 ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
  5826     self 
  6139     self
  5827         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true 
  6140 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  5828         orThisReceiverClass:false orCurrentProcess:false 
  6141 	orThisReceiverClass:false orCurrentProcess:false
  5829         forAll:false.
  6142 	orIfCalledFromMethod:nil
       
  6143 	forAll:false.
  5830 
  6144 
  5831     "Created: / 06-03-2012 / 12:35:22 / cg"
  6145     "Created: / 06-03-2012 / 12:35:22 / cg"
  5832 !
  6146 !
  5833 
  6147 
  5834 ignoreHaltForCurrentProcess
  6148 ignoreHaltForCurrentProcess
  5835     self 
  6149     self
  5836         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false 
  6150 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  5837         orThisReceiverClass:false orCurrentProcess:true 
  6151 	orThisReceiverClass:false orCurrentProcess:true
  5838         forAll:false.
  6152 	orIfCalledFromMethod:nil
       
  6153 	forAll:false.
  5839 
  6154 
  5840     "Created: / 27-01-2012 / 11:32:14 / cg"
  6155     "Created: / 27-01-2012 / 11:32:14 / cg"
  5841 !
  6156 !
  5842 
  6157 
  5843 ignoreHaltForThisReceiverClass
  6158 ignoreHaltForThisReceiverClass
  5844     self 
  6159     self
  5845         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false 
  6160 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  5846         orThisReceiverClass:true orCurrentProcess:false 
  6161 	orThisReceiverClass:true orCurrentProcess:false
  5847         forAll:false.
  6162 	orIfCalledFromMethod:nil
       
  6163 	forAll:false.
  5848 
  6164 
  5849     "Created: / 27-01-2012 / 11:32:14 / cg"
  6165     "Created: / 27-01-2012 / 11:32:14 / cg"
  5850 !
  6166 !
  5851 
  6167 
  5852 ignoreHaltForever
  6168 ignoreHaltForever
  5853     self 
  6169     self
  5854         addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false 
  6170 	addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false
  5855         orThisReceiverClass:false orCurrentProcess:false 
  6171 	orThisReceiverClass:false orCurrentProcess:false
  5856         forAll:false.
  6172 	orIfCalledFromMethod:nil
       
  6173 	forAll:false.
  5857 
  6174 
  5858     "Modified: / 27-01-2012 / 11:31:37 / cg"
  6175     "Modified: / 27-01-2012 / 11:31:37 / cg"
  5859 !
  6176 !
  5860 
  6177 
       
  6178 ignoreHaltIfCalledFromMethod:aMethod
       
  6179     self
       
  6180 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
       
  6181 	orThisReceiverClass:false orCurrentProcess:false
       
  6182 	orIfCalledFromMethod:aMethod
       
  6183 	forAll:false.
       
  6184 !
       
  6185 
  5861 ignoreHaltUntilShiftKeyIsPressed
  6186 ignoreHaltUntilShiftKeyIsPressed
  5862     self 
  6187     self
  5863         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true 
  6188 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  5864         orThisReceiverClass:false orCurrentProcess:false 
  6189 	orThisReceiverClass:false orCurrentProcess:false
  5865         forAll:false.
  6190 	orIfCalledFromMethod:nil
       
  6191 	forAll:false.
  5866 
  6192 
  5867     "Created: / 27-01-2012 / 11:36:54 / cg"
  6193     "Created: / 27-01-2012 / 11:36:54 / cg"
       
  6194 !
       
  6195 
       
  6196 menuForIgnoreAllBreakpointsIfCalledFromAnyOf
       
  6197     <resource: #programMenu >
       
  6198 
       
  6199     ^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:true
       
  6200 !
       
  6201 
       
  6202 menuForIgnoreBreakpointIfCalledFromAnyOf
       
  6203     <resource: #programMenu >
       
  6204 
       
  6205     ^ self menuForIgnoreBreakpointIfCalledFromAnyOfForAll:false
       
  6206 !
       
  6207 
       
  6208 menuForIgnoreBreakpointIfCalledFromAnyOfForAll:forAllHaltsBoolean
       
  6209     <resource: #programMenu >
       
  6210 
       
  6211     |m count already|
       
  6212 
       
  6213     m := Menu new.
       
  6214     count := 0.
       
  6215     already := IdentitySet new.
       
  6216 
       
  6217     contextArray do:[:con |
       
  6218 	|mthd cls sel|
       
  6219 
       
  6220 	mthd := con method.
       
  6221 	mthd notNil ifTrue:[
       
  6222 	    mthd isWrapped ifFalse:[
       
  6223 		(already includes:already) ifFalse:[
       
  6224 		    already add:mthd.
       
  6225 		    m addItem:(MenuItem
       
  6226 				label: (mthd whoString)
       
  6227 				itemValue: [ forAllHaltsBoolean
       
  6228 						ifTrue:[self ignoreHaltIfCalledFromMethod:mthd]
       
  6229 						ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd]
       
  6230 					   ]
       
  6231 				translateLabel: false).
       
  6232 		    count := count + 1.
       
  6233 		    (count > 20) ifTrue:[
       
  6234 			^ m
       
  6235 		    ].
       
  6236 		]
       
  6237 	    ]
       
  6238 	]
       
  6239     ].
       
  6240     ^ m
  5868 !
  6241 !
  5869 
  6242 
  5870 openBreakPointBrowser
  6243 openBreakPointBrowser
  5871     Tools::BreakpointBrowser open
  6244     Tools::BreakpointBrowser open
  5872 
  6245 
  5875 
  6248 
  5876 openIgnoreAllHaltsUntilTimeElapsedDialog
  6249 openIgnoreAllHaltsUntilTimeElapsedDialog
  5877     |answer dT|
  6250     |answer dT|
  5878 
  6251 
  5879     [
  6252     [
  5880         answer := Dialog
  6253 	answer := Dialog
  5881                     request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?')
  6254 		    request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?')
  5882                     initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6255 		    initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  5883         answer isEmptyOrNil ifTrue:[^ self].
  6256 	answer isEmptyOrNil ifTrue:[^ self].
  5884 
  6257 
  5885         dT := TimeDuration readFrom:answer onError:[ nil ].
  6258 	dT := TimeDuration readFrom:answer onError:[ nil ].
  5886         dT notNil ifTrue:[
  6259 	dT notNil ifTrue:[
  5887             LastIgnoreHaltDuration := dT.
  6260 	    LastIgnoreHaltDuration := dT.
  5888             self 
  6261 	    self
  5889                 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false 
  6262 		addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  5890                 orThisReceiverClass:false orCurrentProcess:false 
  6263 		orThisReceiverClass:false orCurrentProcess:false
  5891                 forAll:true.
  6264 		orIfCalledFromMethod:nil
  5892             ^ self.
  6265 		forAll:true.
  5893         ].
  6266 	    ^ self.
       
  6267 	].
  5894     ] loop
  6268     ] loop
  5895 
  6269 
  5896     "Created: / 08-05-2011 / 10:19:20 / cg"
  6270     "Created: / 08-05-2011 / 10:19:20 / cg"
  5897 !
  6271 !
  5898 
  6272 
  5899 openIgnoreBreakpointsWithThisParameterNTimesDialog
  6273 openIgnoreBreakpointsWithThisParameterNTimesDialog
  5900     |answer n|
  6274     |answer n|
  5901 
  6275 
  5902     [
  6276     [
  5903         answer := Dialog
  6277 	answer := Dialog
  5904                     request:(resources 
  6278 		    request:(resources
  5905                                 string:'How often should breakpoints with parameter "%1" be ignored ?'
  6279 				string:'How often should breakpoints with parameter "%1" be ignored ?'
  5906                                 with:breakPointParameter)
  6280 				with:breakPointParameter)
  5907                     initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  6281 		    initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  5908         answer isEmptyOrNil ifTrue:[^ self].
  6282 	answer isEmptyOrNil ifTrue:[^ self].
  5909 
  6283 
  5910         n := Integer readFrom:answer onError:nil.
  6284 	n := Integer readFrom:answer onError:nil.
  5911         n notNil ifTrue:[
  6285 	n notNil ifTrue:[
  5912             LastIgnoreHaltNTimes := n.
  6286 	    LastIgnoreHaltNTimes := n.
  5913             self 
  6287 	    self
  5914                 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false 
  6288 		addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false
  5915                 orThisReceiverClass:false orCurrentProcess:false 
  6289 		orThisReceiverClass:false orCurrentProcess:false
  5916                 forAll:false.
  6290 		orIfCalledFromMethod:nil
  5917             ^ self.
  6291 		forAll:false.
  5918         ].
  6292 	    ^ self.
       
  6293 	].
  5919     ] loop.
  6294     ] loop.
  5920 
  6295 
  5921     "Modified: / 27-01-2012 / 11:31:44 / cg"
  6296     "Modified: / 27-01-2012 / 11:31:44 / cg"
  5922     "Created: / 06-03-2012 / 12:28:51 / cg"
  6297     "Created: / 06-03-2012 / 12:28:51 / cg"
  5923 !
  6298 !
  5924 
  6299 
  5925 openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
  6300 openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
  5926     |answer dT|
  6301     |answer dT|
  5927 
  6302 
  5928     [
  6303     [
  5929         answer := Dialog
  6304 	answer := Dialog
  5930                     request:(resources 
  6305 		    request:(resources
  5931                                 string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?'
  6306 				string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?'
  5932                                 with:breakPointParameter)
  6307 				with:breakPointParameter)
  5933                     initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6308 		    initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  5934         answer isEmptyOrNil ifTrue:[^ self].
  6309 	answer isEmptyOrNil ifTrue:[^ self].
  5935 
  6310 
  5936         dT := TimeDuration readFrom:answer onError:[ nil ].
  6311 	dT := TimeDuration readFrom:answer onError:[ nil ].
  5937         dT notNil ifTrue:[
  6312 	dT notNil ifTrue:[
  5938             LastIgnoreHaltDuration := dT.
  6313 	    LastIgnoreHaltDuration := dT.
  5939             self 
  6314 	    self
  5940                 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false 
  6315 		addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  5941                 orThisReceiverClass:false orCurrentProcess:false 
  6316 		orThisReceiverClass:false orCurrentProcess:false
  5942                 forAll:false.
  6317 		orIfCalledFromMethod:nil
  5943             ^ self.
  6318 		forAll:false.
  5944         ].
  6319 	    ^ self.
       
  6320 	].
  5945     ] loop
  6321     ] loop
  5946 
  6322 
  5947     "Created: / 06-03-2012 / 12:03:36 / cg"
  6323     "Created: / 06-03-2012 / 12:03:36 / cg"
  5948 !
  6324 !
  5949 
  6325 
  5950 openIgnoreHaltNTimesDialog
  6326 openIgnoreHaltNTimesDialog
  5951     |answer n|
  6327     |answer n|
  5952 
  6328 
  5953     [
  6329     [
  5954         answer := Dialog
  6330 	answer := Dialog
  5955                     request:(resources string:'How often should this halt be ignored ?')
  6331 		    request:(resources string:'How often should this halt be ignored ?')
  5956                     initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  6332 		    initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  5957         answer isEmptyOrNil ifTrue:[^ self].
  6333 	answer isEmptyOrNil ifTrue:[^ self].
  5958 
  6334 
  5959         n := Integer readFrom:answer onError:nil.
  6335 	n := Integer readFrom:answer onError:nil.
  5960         n notNil ifTrue:[
  6336 	n notNil ifTrue:[
  5961             LastIgnoreHaltNTimes := n.
  6337 	    LastIgnoreHaltNTimes := n.
  5962             self 
  6338 	    self
  5963                 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false 
  6339 		addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false
  5964                 orThisReceiverClass:false orCurrentProcess:false 
  6340 		orThisReceiverClass:false orCurrentProcess:false
  5965                 forAll:false.
  6341 		orIfCalledFromMethod:nil
  5966             ^ self.
  6342 		forAll:false.
  5967         ].
  6343 	    ^ self.
       
  6344 	].
  5968     ] loop.
  6345     ] loop.
  5969 
  6346 
  5970     "Modified: / 27-01-2012 / 11:31:44 / cg"
  6347     "Modified: / 27-01-2012 / 11:31:44 / cg"
  5971 !
  6348 !
  5972 
  6349 
  5973 openIgnoreHaltUntilTimeElapsedDialog
  6350 openIgnoreHaltUntilTimeElapsedDialog
  5974     |answer dT|
  6351     |answer dT|
  5975 
  6352 
  5976     [
  6353     [
  5977         answer := Dialog
  6354 	answer := Dialog
  5978                     request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?')
  6355 		    request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?')
  5979                     initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6356 		    initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  5980         answer isEmptyOrNil ifTrue:[^ self].
  6357 	answer isEmptyOrNil ifTrue:[^ self].
  5981 
  6358 
  5982         dT := TimeDuration readFrom:answer onError:[ nil ].
  6359 	dT := TimeDuration readFrom:answer onError:[ nil ].
  5983         dT notNil ifTrue:[
  6360 	dT notNil ifTrue:[
  5984             LastIgnoreHaltDuration := dT.
  6361 	    LastIgnoreHaltDuration := dT.
  5985             self 
  6362 	    self
  5986                 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false 
  6363 		addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  5987                 orThisReceiverClass:false orCurrentProcess:false 
  6364 		orThisReceiverClass:false orCurrentProcess:false
  5988                 forAll:false.
  6365 		orIfCalledFromMethod:nil
  5989             ^ self.
  6366 		forAll:false.
  5990         ].
  6367 	    ^ self.
       
  6368 	].
  5991     ] loop
  6369     ] loop
  5992 
  6370 
  5993     "Modified: / 27-01-2012 / 11:31:47 / cg"
  6371     "Modified: / 27-01-2012 / 11:31:47 / cg"
  5994 !
  6372 !
  5995 
  6373 
  5996 removeAllBreakpoints
  6374 removeAllBreakpoints
  5997     "remove all trace & breakpoints - if any"
  6375     "remove all trace & breakpoints - if any"
  5998 
  6376 
  5999     (MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[
  6377     self withExecuteCursorDo:[
  6000         self withExecuteCursorDo:[
  6378 	(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[
  6001             MessageTracer unwrapAllMethods
  6379 	    MessageTracer unwrapAllMethods
  6002         ]
  6380 	].
       
  6381 	(MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[
       
  6382 	    MethodWithBreakpoints removeAllBreakpoints
       
  6383 	].
  6003     ]
  6384     ]
  6004 
  6385 
  6005     "Modified: / 21.5.1998 / 01:44:43 / cg"
  6386     "Modified: / 21.5.1998 / 01:44:43 / cg"
  6006 !
  6387 !
  6007 
  6388 
  6009     "remove breakpoint on the selected contexts method - if any"
  6390     "remove breakpoint on the selected contexts method - if any"
  6010 
  6391 
  6011     |implementorClass method|
  6392     |implementorClass method|
  6012 
  6393 
  6013     selectedContext isNil ifTrue:[
  6394     selectedContext isNil ifTrue:[
  6014         ^ self showError:'** select a context first **'
  6395 	^ self showError:'** select a context first **'
  6015     ].
  6396     ].
  6016     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6397     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6017         ^ self
  6398 	^ self
  6018     ].
  6399     ].
  6019 
  6400 
  6020     implementorClass := selectedContext methodClass.
  6401     implementorClass := selectedContext methodClass.
  6021     implementorClass notNil ifTrue:[
  6402     implementorClass notNil ifTrue:[
  6022         method := implementorClass compiledMethodAt:selectedContext selector.
  6403 	method := implementorClass compiledMethodAt:selectedContext selector.
  6023         (method notNil and:[method isBreakpointed]) ifTrue:[
  6404 	(method notNil and:[method isBreakpointed]) ifTrue:[
  6024             method clearBreakPoint
  6405 	    method clearBreakPoint
  6025         ]
  6406 	]
  6026     ].
  6407     ].
  6027     contextView middleButtonMenu disable:#removeBreakpoint.
  6408     contextView middleButtonMenu disable:#removeBreakpoint.
  6028     contextView middleButtonMenu enable:#addBreakpoint.
  6409     contextView middleButtonMenu enable:#addBreakpoint.
  6029 
  6410 
  6030     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6411     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6053 explainSelection
  6434 explainSelection
  6054     |interval crsrPos|
  6435     |interval crsrPos|
  6055 
  6436 
  6056     interval := self selectedInterval.
  6437     interval := self selectedInterval.
  6057     interval isEmpty ifTrue:[
  6438     interval isEmpty ifTrue:[
  6058         crsrPos := codeView characterPositionOfCursor.
  6439 	crsrPos := codeView characterPositionOfCursor.
  6059         codeView characterUnderCursor isSeparator ifTrue:[
  6440 	codeView characterUnderCursor isSeparator ifTrue:[
  6060             crsrPos := (crsrPos - 1) max:1
  6441 	    crsrPos := (crsrPos - 1) max:1
  6061         ].
  6442 	].
  6062         interval := crsrPos to:crsrPos.
  6443 	interval := crsrPos to:crsrPos.
  6063     ].
  6444     ].
  6064     self
  6445     self
  6065         withNodeValueAtInterval:interval
  6446 	withNodeValueAtInterval:interval
  6066         do:[:value :description |
  6447 	do:[:value :description |
  6067             self showValue:value
  6448 	    self showValue:value
  6068         ].
  6449 	].
  6069 !
  6450 !
  6070 
  6451 
  6071 findNodeForInterval:interval
  6452 findNodeForInterval:interval
  6072     |source|
  6453     |source|
  6073 
  6454 
  6089     |node|
  6470     |node|
  6090 
  6471 
  6091 self obsoleteMethodWarning.
  6472 self obsoleteMethodWarning.
  6092     node := nil.
  6473     node := nil.
  6093     tree nodesDo:[:each |
  6474     tree nodesDo:[:each |
  6094         (each intersectsInterval:interval) ifTrue:[
  6475 	(each intersectsInterval:interval) ifTrue:[
  6095             (node isNil or:[node == each parent]) ifTrue:[
  6476 	    (node isNil or:[node == each parent]) ifTrue:[
  6096                 node := each
  6477 		node := each
  6097             ] ifFalse:[
  6478 	    ] ifFalse:[
  6098                 (node parent notNil
  6479 		(node parent notNil
  6099                     and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil]
  6480 		    and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil]
  6100             ]
  6481 	    ]
  6101         ]
  6482 	]
  6102     ].
  6483     ].
  6103     ^ node
  6484     ^ node
  6104 !
  6485 !
  6105 
  6486 
  6106 goodSkipUntilSelector
  6487 goodSkipUntilSelector
  6109     lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering].
  6490     lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering].
  6110     selectedContext isNil ifTrue:[^ nil].
  6491     selectedContext isNil ifTrue:[^ nil].
  6111     current := selectedContext selector.
  6492     current := selectedContext selector.
  6112     current isNil ifTrue:[^ nil].
  6493     current isNil ifTrue:[^ nil].
  6113     ('change:*' match:current) ifTrue:[
  6494     ('change:*' match:current) ifTrue:[
  6114         ^ 'update:*'
  6495 	^ 'update:*'
  6115     ].
  6496     ].
  6116     ^ nil
  6497     ^ nil
  6117 !
  6498 !
  6118 
  6499 
  6119 haltSelectors
  6500 haltSelectors
  6120     ^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break').
  6501     ^ #( #'halt' #'halt:' #'breakPoint:' #'breakPoint:info:' #'break').
  6121 
  6502 
  6122     "Modified (format): / 27-01-2012 / 11:10:00 / cg"
  6503     "Modified (format): / 27-01-2012 / 11:10:00 / cg"
  6123 !
  6504 !
  6124 
  6505 
  6125 inspectedProcess
       
  6126     ^ inspectedProcess
       
  6127 !
       
  6128 
       
  6129 interruptProcessWith:aBlock
  6506 interruptProcessWith:aBlock
  6130     "let inspected process do something, then update the context list"
  6507     "let inspected process do something, then update the context list"
  6131 
  6508 
  6132     inspectedProcess isDead ifTrue:[
  6509     inspectedProcess isDead ifTrue:[
  6133         self showTerminated.
  6510 	self showTerminated.
  6134         ^ self
  6511 	^ self
  6135     ].
  6512     ].
  6136     inspectedProcess interruptWith:aBlock.
  6513     inspectedProcess interruptWith:aBlock.
  6137     "
  6514     "
  6138      give the process a chance to run, then update
  6515      give the process a chance to run, then update
  6139     "
  6516     "
  6153 
  6530 
  6154 processPerform:aMessage
  6531 processPerform:aMessage
  6155     "do something, then update the context list"
  6532     "do something, then update the context list"
  6156 
  6533 
  6157     inspectedProcess isDead ifTrue:[
  6534     inspectedProcess isDead ifTrue:[
  6158         self showTerminated.
  6535 	self showTerminated.
  6159         ^ self
  6536 	^ self
  6160     ].
  6537     ].
  6161     inspectedProcess perform:aMessage.
  6538     inspectedProcess perform:aMessage.
  6162 
  6539 
  6163     "
  6540     "
  6164      give the process a chance to run, then update
  6541      give the process a chance to run, then update
  6172      verbose-flag setting is changed"
  6549      verbose-flag setting is changed"
  6173 
  6550 
  6174     |oldSelection oldContext con idx|
  6551     |oldSelection oldContext con idx|
  6175 
  6552 
  6176     contextArray notNil ifTrue:[
  6553     contextArray notNil ifTrue:[
  6177         self withExecuteCursorDo:[
  6554 	self withExecuteCursorDo:[
  6178             oldSelection := contextView selection.
  6555 	    oldSelection := contextView selection.
  6179             oldSelection notNil ifTrue:[
  6556 	    oldSelection notNil ifTrue:[
  6180                 oldContext := contextArray at:oldSelection ifAbsent:nil.
  6557 		oldContext := contextArray at:oldSelection ifAbsent:nil.
  6181             ].
  6558 	    ].
  6182 
  6559 
  6183             con := firstContext.
  6560 	    con := firstContext.
  6184 "/            con := contextArray at:1.
  6561 "/            con := contextArray at:1.
  6185             "/ force redeisplay, even if same by changing the first entry
  6562 	    "/ force redeisplay, even if same by changing the first entry
  6186             contextArray size > 0 ifTrue:[
  6563 	    contextArray size > 0 ifTrue:[
  6187                 contextArray at:1 put:nil.
  6564 		contextArray at:1 put:nil.
  6188             ].
  6565 	    ].
  6189             self setContext:con.
  6566 	    self setContext:con.
  6190 
  6567 
  6191             oldContext isNil ifTrue:[
  6568 	    oldContext isNil ifTrue:[
  6192                 idx := oldSelection
  6569 		idx := oldSelection
  6193             ] ifFalse:[
  6570 	    ] ifFalse:[
  6194                 idx := contextArray identityIndexOf:oldContext ifAbsent:nil.
  6571 		idx := contextArray identityIndexOf:oldContext ifAbsent:nil.
  6195             ].
  6572 	    ].
  6196             contextView setSelection:idx.
  6573 	    contextView setSelection:idx.
  6197             idx notNil ifTrue:[
  6574 	    idx notNil ifTrue:[
  6198                 self showSelection:idx
  6575 		self showSelection:idx
  6199             ]
  6576 	    ]
  6200         ]
  6577 	]
  6201     ]
  6578     ]
  6202 
  6579 
  6203     "Created: / 10.1.1997 / 21:36:46 / cg"
  6580     "Created: / 10.1.1997 / 21:36:46 / cg"
  6204     "Modified: / 21.5.1998 / 01:47:07 / cg"
  6581     "Modified: / 21.5.1998 / 01:47:07 / cg"
  6205 !
  6582 !
  6209 !
  6586 !
  6210 
  6587 
  6211 showError:message
  6588 showError:message
  6212     codeView contents:(resources string:message).
  6589     codeView contents:(resources string:message).
  6213     shown ifTrue:[
  6590     shown ifTrue:[
  6214         exclusive ifTrue:[
  6591 	exclusive ifTrue:[
  6215             "/ consider this a kludge:
  6592 	    "/ consider this a kludge:
  6216             "/ if exclusive, cannot use flash, since it suspends
  6593 	    "/ if exclusive, cannot use flash, since it suspends
  6217             "/ (but we cannot suspend here ...)
  6594 	    "/ (but we cannot suspend here ...)
  6218             codeView redrawInverted. device flush.
  6595 	    codeView redrawInverted. self flush.
  6219             OperatingSystem millisecondDelay:200.
  6596 	    OperatingSystem millisecondDelay:200.
  6220             codeView redraw
  6597 	    codeView redraw
  6221         ] ifFalse:[
  6598 	] ifFalse:[
  6222             codeView flash
  6599 	    codeView flash
  6223         ]
  6600 	]
  6224     ]
  6601     ]
  6225 
  6602 
  6226     "Modified: / 18.11.2001 / 00:01:13 / cg"
  6603     "Modified: / 18.11.2001 / 00:01:13 / cg"
  6227 !
  6604 !
  6228 
  6605 
  6251 updateButtonsAndMenuItemsForContext:aContext
  6628 updateButtonsAndMenuItemsForContext:aContext
  6252     |m|
  6629     |m|
  6253 
  6630 
  6254     m := contextView middleButtonMenu.
  6631     m := contextView middleButtonMenu.
  6255     m notNil ifTrue:[
  6632     m notNil ifTrue:[
  6256         self updateMenuItems.
  6633 	self updateMenuItems.
  6257 
  6634 
  6258         (inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[
  6635 	(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[
  6259             abortButton enable.
  6636 	    abortButton enable.
  6260             m enable:#doAbort.
  6637 	    m enable:#doAbort.
  6261         ] ifFalse:[
  6638 	] ifFalse:[
  6262             abortButton disable.
  6639 	    abortButton disable.
  6263             m disable:#doAbort.
  6640 	    m disable:#doAbort.
  6264         ].
  6641 	].
  6265         exclusive ifTrue:[
  6642 	exclusive ifTrue:[
  6266             terminateButton disable.
  6643 	    terminateButton disable.
  6267             m disable:#doTerminate.
  6644 	    m disable:#doTerminate.
  6268         ] ifFalse:[
  6645 	] ifFalse:[
  6269             terminateButton enable.
  6646 	    terminateButton enable.
  6270             m enable:#doTerminate.
  6647 	    m enable:#doTerminate.
  6271         ].
  6648 	].
  6272     ].
  6649     ].
  6273 
  6650 
  6274     mayProceed == false ifTrue:[
  6651     mayProceed == false ifTrue:[
  6275         continueButton disable.
  6652 	continueButton disable.
  6276         m notNil ifTrue:[m disable:#doContinue].
  6653 	m notNil ifTrue:[m disable:#doContinue].
  6277     ] ifFalse:[
  6654     ] ifFalse:[
  6278         continueButton enable.
  6655 	continueButton enable.
  6279         m notNil ifTrue:[m enable:#doContinue]
  6656 	m notNil ifTrue:[m enable:#doContinue]
  6280     ].
  6657     ].
  6281 
  6658 
  6282     isStoppedInModalDialog ifTrue:[
  6659     isStoppedInModalDialog ifTrue:[
  6283         gotoDialogOpenerButton enable.
  6660 	gotoDialogOpenerButton enable.
  6284         gotoDialogOpenerButton beVisible.
  6661 	gotoDialogOpenerButton beVisible.
  6285     ] ifFalse:[
  6662     ] ifFalse:[
  6286         gotoDialogOpenerButton beInvisible.
  6663 	gotoDialogOpenerButton beInvisible.
       
  6664     ].
       
  6665 
       
  6666     (isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[
       
  6667 	gotoApplicationActionMethodButton enable.
       
  6668 	gotoApplicationActionMethodButton beVisible.
       
  6669     ] ifFalse:[
       
  6670 	gotoApplicationActionMethodButton beInvisible.
  6287     ].
  6671     ].
  6288 
  6672 
  6289     "Created: / 06-07-2011 / 12:24:53 / cg"
  6673     "Created: / 06-07-2011 / 12:24:53 / cg"
  6290 !
  6674 !
  6291 
  6675 
  6292 updateContext
  6676 updateContext
  6293     |oldContext idx|
  6677     |oldContext idx|
  6294 
  6678 
  6295     inspectedProcess state == #dead ifTrue:[
  6679     inspectedProcess state == #dead ifTrue:[
  6296         self showTerminated.
  6680 	self showTerminated.
  6297         ^ self
  6681 	^ self
  6298     ].
  6682     ].
  6299 
  6683 
  6300     oldContext := selectedContext.
  6684     oldContext := selectedContext.
  6301     [
  6685     [
  6302         (self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[
  6686 	(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[
  6303             oldContext notNil ifTrue:[
  6687 	    oldContext notNil ifTrue:[
  6304                 contextArray notNil ifTrue:[
  6688 		contextArray notNil ifTrue:[
  6305                     idx := contextArray identityIndexOf:oldContext.
  6689 		    idx := contextArray identityIndexOf:oldContext.
  6306                     idx ~~ 0 ifTrue:[
  6690 		    idx ~~ 0 ifTrue:[
  6307                         self showSelection:idx
  6691 			self showSelection:idx
  6308                     ] ifFalse:[
  6692 		    ] ifFalse:[
  6309                         codeView contents:('** context returned **')
  6693 			codeView contents:('** context returned **')
  6310                     ]
  6694 		    ]
  6311                 ]
  6695 		]
  6312             ]
  6696 	    ]
  6313         ].
  6697 	].
  6314     ] valueUninterruptably.
  6698     ] valueUninterruptably.
  6315 
  6699 
  6316     "Modified: 20.10.1996 / 18:11:24 / cg"
  6700     "Modified: 20.10.1996 / 18:11:24 / cg"
  6317 !
  6701 !
  6318 
  6702 
  6319 withNodeValueAtInterval:interval do:aBlock
  6703 withNodeValueAtInterval:interval do:aBlock
  6320     |node definingNode nm nmBold varIdx parentNode receiver con receiversNonMetaClass|
  6704     "helper for flyByHelp and explan-selection"
  6321 
  6705 
  6322 "/interval printCR.
  6706     |node definingNode nm nmBold nameSymbol
       
  6707      varIdx parentNode receiver con receiversNonMetaClass|
       
  6708 
       
  6709     "/ interval printCR.
  6323     Error
  6710     Error
  6324         handle:[:ex | ]
  6711 	handle:[:ex | ]
  6325         do:[
  6712 	do:[
  6326             [
  6713 	    [
  6327                 node := self findNodeForInterval:interval
  6714 		node := self findNodeForInterval:interval
  6328             ] valueWithWatchDog:[ ^ self ] afterMilliseconds:50.
  6715 	    ] valueWithWatchDog:[ ^ self ] afterMilliseconds:50.
  6329         ].
  6716 	].
  6330 
  6717 
  6331     node isNil ifTrue:[ ^ self ].
  6718     node isNil ifTrue:[ ^ self ].
  6332     node isVariable ifFalse:[
  6719     node isVariable ifFalse:[
  6333         "/ Transcript showCR:node.
  6720 	"/ Transcript showCR:node.
  6334         ^ self
  6721 	^ self
  6335     ].
  6722     ].
  6336 
  6723 
  6337     nm := node name.
  6724     nm := node name.
  6338     nmBold := nm allBold.
  6725     nmBold := nm allBold.
  6339     actualContext isNil ifTrue:[^ self ].
  6726     actualContext isNil ifTrue:[^ self ].
  6340     actualContext methodHome isNil ifTrue:[^ self ].
  6727     actualContext methodHome isNil ifTrue:[^ self ].
  6341     receiver := actualContext methodHome receiver.
  6728     receiver := actualContext methodHome receiver.
  6342 
  6729 
  6343     (nm = 'self') ifTrue:[
  6730     (nm = 'self') ifTrue:[
  6344         aBlock value:receiver value:'receiver' allBold.
  6731 	aBlock value:receiver value:'receiver' allBold.
  6345         ^ self
  6732 	^ self
  6346     ].
  6733     ].
  6347     (nm = 'super') ifTrue:[
  6734     (nm = 'super') ifTrue:[
  6348         aBlock value:receiver value:'receiver' allBold.
  6735 	aBlock value:receiver value:'receiver' allBold.
  6349         ^ self
  6736 	^ self
  6350     ].
  6737     ].
  6351     (nm = 'thisContext') ifTrue:[
  6738     (nm = 'thisContext') ifTrue:[
  6352         aBlock value:actualContext value:'context' allBold.
  6739 	aBlock value:actualContext value:'context' allBold.
  6353         ^ self
  6740 	^ self
  6354     ].
  6741     ].
  6355 
  6742 
  6356     definingNode := node whoDefines:nm.
  6743     definingNode := node whoDefines:nm.
  6357     definingNode isNil ifTrue:[
  6744     definingNode isNil ifTrue:[
  6358         (receiver class allInstVarNames includes:nm) ifTrue:[
  6745 	(receiver class allInstVarNames includes:nm) ifTrue:[
  6359 "/aBlock value:'xIII' value:'instVar'.
  6746 "/aBlock value:'xIII' value:'instVar'.
  6360             receiver class isMetaclass ifTrue:[
  6747 	    receiver class isMetaclass ifTrue:[
  6361                 aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold.
  6748 		aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold.
  6362             ] ifFalse:[
  6749 	    ] ifFalse:[
  6363                 aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold.
  6750 		aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold.
  6364             ].
  6751 	    ].
  6365             ^ self
  6752 	    ^ self
  6366         ].
  6753 	].
  6367 
  6754 
  6368         receiversNonMetaClass := receiver class theNonMetaclass.
  6755 	receiversNonMetaClass := receiver class theNonMetaclass.
  6369         (receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[
  6756 	(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[
  6370             aBlock value:'' value:'private class ',nmBold.
  6757 	    aBlock value:'' value:'private class ',nmBold.
  6371             ^ self
  6758 	    ^ self
  6372         ].
  6759 	].
  6373         (receiversNonMetaClass classVarNames includes:nm) ifTrue:[
  6760 	(receiversNonMetaClass classVarNames includes:nm) ifTrue:[
  6374             aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold.
  6761 	    aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold.
  6375             ^ self
  6762 	    ^ self
  6376         ].
  6763 	].
  6377         receiversNonMetaClass sharedPoolNames do:[:eachPoolName |
  6764 	receiversNonMetaClass sharedPoolNames do:[:eachPoolName |
  6378             |pool|
  6765 	    |pool|
  6379 
  6766 
  6380             pool := Smalltalk at:eachPoolName.
  6767 	    pool := Smalltalk at:eachPoolName.
  6381             pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName].
  6768 	    pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName].
  6382             (pool classVarNames includes:nm) ifTrue:[
  6769 	    (pool classVarNames includes:nm) ifTrue:[
  6383                 aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '.
  6770 		aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '.
  6384                 ^ self
  6771 		^ self
  6385             ].
  6772 	    ].
  6386         ].
  6773 	].
  6387         (Smalltalk includesKey:nm asSymbol) ifTrue:[
  6774 	nameSymbol := nm asSymbolIfInterned.
  6388             (Smalltalk at:nm asSymbol) isClass ifTrue:[
  6775 	nameSymbol notNil ifTrue:[
  6389                 aBlock value:'class: ',nmBold value:nil.
  6776 	    (Smalltalk includesKey:nameSymbol) ifTrue:[
  6390             ] ifFalse:[
  6777 		(Smalltalk at:nameSymbol) isClass ifTrue:[
  6391                 aBlock value:(Smalltalk at:nm asSymbol) value:'global ',nmBold.
  6778 		    aBlock value:'class: ',nmBold value:nil.
  6392             ].
  6779 		] ifFalse:[
  6393             ^ self
  6780 		    aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold.
  6394         ].
  6781 		].
  6395         aBlock value:'' value:'unknown'.
  6782 		^ self
  6396         ^ self
  6783 	    ].
       
  6784 	].
       
  6785 	aBlock value:'' value:'unknown'.
       
  6786 	^ self
  6397     ].
  6787     ].
  6398 "/definingNode printCR.
  6788 "/definingNode printCR.
  6399 
  6789 
  6400     definingNode isMethod ifTrue:[
  6790     definingNode isMethod ifTrue:[
  6401         varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  6791 	varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  6402         varIdx ~~ 0 ifTrue:[
  6792 	varIdx ~~ 0 ifTrue:[
  6403             Error
  6793 	    Error
  6404                 handle:[:ex | ]
  6794 		handle:[:ex | ]
  6405                 do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ].
  6795 		do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ].
  6406             ^ self
  6796 	    ^ self
  6407         ].
  6797 	].
  6408         varIdx := definingNode temporaries findFirst:[:var | var name = nm].
  6798 	varIdx := definingNode temporaries findFirst:[:var | var name = nm].
  6409         varIdx ~~ 0 ifTrue:[
  6799 	varIdx ~~ 0 ifTrue:[
  6410             actualContext methodHome numVars >= varIdx ifTrue:[
  6800 	    actualContext methodHome numVars >= varIdx ifTrue:[
  6411                 Error
  6801 		Error
  6412                     handle:[:ex | ]
  6802 		    handle:[:ex | ]
  6413                     do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  6803 		    do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  6414                 ^ self
  6804 		^ self
  6415             ]
  6805 	    ]
  6416         ].
  6806 	].
  6417     ].
  6807     ].
  6418 
  6808 
  6419     definingNode isBlock ifTrue:[
  6809     definingNode isBlock ifTrue:[
  6420         varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  6810 	varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  6421         (definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[
  6811 	(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[
  6422             varIdx ~~ 0 ifTrue:[
  6812 	    varIdx ~~ 0 ifTrue:[
  6423                 "/ am I in this block ?
  6813 		"/ am I in this block ?
  6424                 (actualContext lineNumber notNil
  6814 		(actualContext lineNumber notNil
  6425                 and:[ definingNode lastLineNumber notNil
  6815 		and:[ definingNode lastLineNumber notNil
  6426                 and:[ (actualContext lineNumber
  6816 		and:[ (actualContext lineNumber
  6427                             between:definingNode firstLineNumber
  6817 			    between:definingNode firstLineNumber
  6428                             and:definingNode lastLineNumber)
  6818 			    and:definingNode lastLineNumber)
  6429                 and:[ varIdx <= actualContext numArgs ] ]])
  6819 		and:[ varIdx <= actualContext numArgs ] ]])
  6430                 ifTrue:[
  6820 		ifTrue:[
  6431                     aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold .
  6821 		    aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold .
  6432                     ^ self
  6822 		    ^ self
  6433                 ].
  6823 		].
  6434 aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  6824 		aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  6435                 ^ self
  6825 		^ self
  6436             ]
  6826 	    ]
  6437         ].
  6827 	].
  6438     ].
  6828     ].
  6439 
  6829 
  6440     parentNode := definingNode parent.
  6830     parentNode := definingNode parent.
  6441 
  6831 
  6442     [parentNode notNil] whileTrue:[
  6832     [parentNode notNil] whileTrue:[
  6443 "/'isMethod ' print. parentNode isMethod printCR.
  6833 	"/'isMethod ' print. parentNode isMethod printCR.
  6444         parentNode isMethod ifTrue:[
  6834 	parentNode isMethod ifTrue:[
  6445             varIdx := parentNode temporaries findFirst:[:var | var name = nm].
  6835 	    varIdx := parentNode temporaries findFirst:[:var | var name = nm].
  6446             varIdx ~~ 0 ifTrue:[
  6836 	    varIdx ~~ 0 ifTrue:[
  6447                 actualContext methodHome numVars >= varIdx ifTrue:[
  6837 		actualContext methodHome numVars >= varIdx ifTrue:[
  6448                     Error
  6838 		    Error
  6449                         handle:[:ex | ]
  6839 			handle:[:ex | ]
  6450                         do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  6840 			do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  6451                     ^ self
  6841 		    ^ self
  6452                 ]
  6842 		]
  6453             ].
  6843 	    ].
  6454         ].
  6844 	].
  6455 "/'isBlock ' print. parentNode isBlock printCR.
  6845 	"/'isBlock ' print. parentNode isBlock printCR.
  6456         parentNode isBlock ifTrue:[
  6846 	parentNode isBlock ifTrue:[
  6457             "/ we dont have any information on the inlineability
  6847 	    "/ we don't have any information on the inlineability
  6458             "/ of this block here (RBParser does not know what
  6848 	    "/ of this block here (RBParser does not know what
  6459             "/ the compiler does.
  6849 	    "/ the compiler does).
  6460             "/ therefore, it is questionable if we can use the
  6850 	    "/ therefore, it is questionable if we can use the
  6461             "/ contexts home context here.
  6851 	    "/ context's home context here.
  6462             "/ am I in this block ?
  6852 	    "/ am I in this block ?
  6463             con := actualContext.
  6853 	    con := actualContext.
  6464             [con notNil
  6854 	    [con notNil
  6465             and:[ parentNode lastLineNumber notNil
  6855 	    and:[ parentNode lastLineNumber notNil
  6466             and:[ con lineNumber notNil
  6856 	    and:[ con lineNumber notNil
  6467             and:[ con lineNumber
  6857 	    and:[ con lineNumber
  6468                     between:parentNode firstLineNumber
  6858 		    between:parentNode firstLineNumber
  6469                     and:parentNode lastLineNumber ]]]] whileTrue:[
  6859 		    and:parentNode lastLineNumber ]]]] whileTrue:[
  6470                 con := con sender.
  6860 		con := con sender.
  6471             ].
  6861 	    ].
  6472             con notNil ifTrue:[
  6862 	    con notNil ifTrue:[
  6473                 varIdx := parentNode arguments findFirst:[:arg | arg name = nm].
  6863 		varIdx := parentNode arguments findFirst:[:arg | arg name = nm].
  6474                 varIdx ~~ 0 ifTrue:[
  6864 		varIdx ~~ 0 ifTrue:[
  6475                     Error
  6865 		    Error
  6476                         handle:[:ex | ]
  6866 			handle:[:ex | ]
  6477                         do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ].
  6867 			do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ].
  6478                     ^ self
  6868 		    ^ self
  6479                 ].
  6869 		].
  6480                 varIdx := parentNode body temporaries findFirst:[:var | var name = nm].
  6870 		varIdx := parentNode body temporaries findFirst:[:var | var name = nm].
  6481                 varIdx ~~ 0 ifTrue:[
  6871 		varIdx ~~ 0 ifTrue:[
  6482                     Error
  6872 		    Error
  6483                         handle:[:ex | ]
  6873 			handle:[:ex | ]
  6484                         do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ].
  6874 			do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ].
  6485                     ^ self
  6875 		    ^ self
  6486                 ].
  6876 		].
  6487             ].
  6877 	    ].
  6488         ].
  6878 	].
  6489         parentNode := parentNode parent.
  6879 	parentNode := parentNode parent.
  6490     ].
  6880     ].
  6491     aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  6881     aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  6492 
  6882 
  6493     "Modified: / 18-01-2011 / 17:57:34 / cg"
  6883     "Modified: / 18-01-2011 / 17:57:34 / cg"
  6494 ! !
  6884 ! !
  6519 canBrowseProcessesApplication
  6909 canBrowseProcessesApplication
  6520     |p|
  6910     |p|
  6521 
  6911 
  6522     p := inspectedProcess ? Processor activeProcess.
  6912     p := inspectedProcess ? Processor activeProcess.
  6523     p isNil ifTrue:[^ false].
  6913     p isNil ifTrue:[^ false].
  6524     ^ p isGUIProcess
  6914     ^ p isGUIProcess and:[self processesApplication notNil ].
  6525 !
  6915 !
  6526 
  6916 
  6527 canBrowseReceiversClass
  6917 canBrowseReceiversClass
  6528     |m|
  6918     |m|
  6529 
  6919 
  6530     m := contextView middleButtonMenu.
  6920     m := contextView middleButtonMenu.
  6531     ^ m notNil and:[m isEnabled:#browseReceiversClass]
  6921     ^ m notNil and:[m isEnabled:#browseReceiversClass]
  6532 !
  6922 !
  6533 
  6923 
  6534 canCloseAllDebuggers
  6924 canCloseAllDebuggers
  6535     self class allInstancesDo:[:debugger | 
  6925     self class allInstancesDo:[:debugger |
  6536         debugger ~~ self ifTrue:[
  6926 	debugger ~~ self ifTrue:[
  6537             debugger busy ifTrue:[^ true].
  6927 	    debugger busy ifTrue:[^ true].
  6538         ]
  6928 	]
  6539     ].
  6929     ].
  6540     ^ false
  6930     ^ false
  6541 
  6931 
  6542     "Created: / 23-03-2012 / 12:40:18 / cg"
  6932     "Created: / 23-03-2012 / 12:40:18 / cg"
  6543 !
  6933 !
  6549 canInspectWidgetHierarchy
  6939 canInspectWidgetHierarchy
  6550     |rcvr|
  6940     |rcvr|
  6551 
  6941 
  6552     ^ selectedContext notNil
  6942     ^ selectedContext notNil
  6553     and:[ (rcvr := selectedContext receiver) isView
  6943     and:[ (rcvr := selectedContext receiver) isView
  6554           or:[ rcvr isKindOf: ApplicationModel ]]
  6944 	  or:[ rcvr isKindOf: ApplicationModel ]]
  6555 !
  6945 !
  6556 
  6946 
  6557 canRestart
  6947 canRestart
  6558     ^ restartButton isEnabled
  6948     ^ restartButton isEnabled
  6559 
  6949 
  6574 
  6964 
  6575 canShowMore
  6965 canShowMore
  6576     ^ canShowMore
  6966     ^ canShowMore
  6577 !
  6967 !
  6578 
  6968 
       
  6969 hasBlockContextSelected
       
  6970     ^ contextView hasSelection
       
  6971     and:[ self selectedContext isBlockContext ]
       
  6972 !
       
  6973 
  6579 hasContextSelected
  6974 hasContextSelected
  6580     ^ contextView hasSelection
  6975     ^ contextView hasSelection
  6581 
  6976 
  6582     "Created: / 17.11.2001 / 19:57:03 / cg"
  6977     "Created: / 17.11.2001 / 19:57:03 / cg"
  6583 !
  6978 !
  6606 
  7001 
  6607 selectedContextIsWrapped
  7002 selectedContextIsWrapped
  6608     |con mthd|
  7003     |con mthd|
  6609 
  7004 
  6610     (con := self selectedContext) notNil ifTrue:[
  7005     (con := self selectedContext) notNil ifTrue:[
  6611         mthd := con method.
  7006 	mthd := con method.
  6612         ^ mthd notNil and:[mthd isWrapped]
  7007 	^ mthd notNil and:[mthd isWrapped]
  6613     ].
  7008     ].
  6614     ^ false.
  7009     ^ false.
  6615 
  7010 
  6616     "Modified: / 19-07-2012 / 11:36:28 / cg"
  7011     "Modified: / 19-07-2012 / 11:36:28 / cg"
  6617 !
  7012 !
  6624     setOfHiddenCallingSelectors := aCollectionOfSymbols
  7019     setOfHiddenCallingSelectors := aCollectionOfSymbols
  6625 ! !
  7020 ! !
  6626 
  7021 
  6627 !DebugView methodsFor:'private-breakpoints'!
  7022 !DebugView methodsFor:'private-breakpoints'!
  6628 
  7023 
  6629 addIgnoredHaltForCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey 
  7024 addIgnoredHaltForCount:countOrNil
  6630                                   orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess 
  7025 	orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  6631                                   forAll:aBoolean
  7026 	orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess
       
  7027 	orIfCalledFromMethod:ifCalledForMethodOrNil
       
  7028 	forAll:aBoolean
       
  7029 
  6632     |haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil|
  7030     |haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil|
  6633 
  7031 
  6634     aBoolean ifTrue:[
  7032     aBoolean ifTrue:[
  6635         haltingMethod := #all
  7033 	haltingMethod := #all
  6636     ] ifFalse:[
  7034     ] ifFalse:[
  6637         haltingContext := self findHaltingContext.
  7035 	haltingContext := self findHaltingContext.
  6638         haltingContext isNil ifTrue:[ 
  7036 	haltingContext isNil ifTrue:[
  6639             Transcript showCR:'no halting context found'. 
  7037 	    Transcript showCR:'no halting context found'.
  6640             ^ self 
  7038 	    ^ self
  6641         ].
  7039 	].
  6642 
  7040 
  6643         haltingMethod := haltingContext method.
  7041 	haltingMethod := haltingContext method.
  6644         lineNrOfHalt := haltingContext lineNumber.
  7042 	lineNrOfHalt := haltingContext lineNumber.
  6645         (lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[ 
  7043 	(lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[
  6646             Transcript showCR:'no halt lineNr found'. 
  7044 	    Transcript showCR:'no halt lineNr found'.
  6647             ^ self 
  7045 	    ^ self
  6648         ].
  7046 	].
  6649         forThisReceiverClass ifTrue:[
  7047 	forThisReceiverClass ifTrue:[
  6650             receiverClassOrNil := haltingContext receiver class
  7048 	    receiverClassOrNil := haltingContext receiver class
  6651         ].
  7049 	].
  6652         forCurrentProcess ifTrue:[
  7050 	forCurrentProcess ifTrue:[
  6653             processOrNil := Processor activeProcess
  7051 	    processOrNil := Processor activeProcess
  6654         ].
  7052 	].
  6655     ].
  7053     ].
  6656 
  7054 
  6657     self class
  7055     self class
  6658         ignoreHaltIn:haltingMethod at:lineNrOfHalt
  7056 	ignoreHaltIn:haltingMethod at:lineNrOfHalt
  6659         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  7057 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  6660         orReceiverClass:receiverClassOrNil orProcess:processOrNil
  7058 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
       
  7059 	orIfCalledFromMethod:ifCalledForMethodOrNil
  6661 
  7060 
  6662     "Created: / 27-01-2012 / 11:31:12 / cg"
  7061     "Created: / 27-01-2012 / 11:31:12 / cg"
  6663 !
  7062 !
  6664 
  7063 
  6665 canAddBreakpoint
  7064 canAddBreakpoint
  6680     |haltSelectors|
  7079     |haltSelectors|
  6681 
  7080 
  6682     haltSelectors := self haltSelectors.
  7081     haltSelectors := self haltSelectors.
  6683 
  7082 
  6684     contextArray keysAndValuesDo:[:idx :con |
  7083     contextArray keysAndValuesDo:[:idx :con |
  6685         |sel con2 sel2 method|
  7084 	|sel con2 sel2 method|
  6686 
  7085 
  6687         sel := con selector.
  7086 	sel := con selector.
  6688         (haltSelectors includes:sel) ifTrue:[
  7087 	(haltSelectors includes:sel) ifTrue:[
  6689             (method := con method) notNil ifTrue:[
  7088 	    (method := con method) notNil ifTrue:[
  6690                 method mclass == Object ifTrue:[
  7089 		method mclass == Object ifTrue:[
  6691                     con2 := contextArray at:idx+1.
  7090 		    con2 := contextArray at:idx+1.
  6692                     sel2 := con2 selector.
  7091 		    sel2 := con2 selector.
  6693                     (haltSelectors includes:sel2) ifTrue:[
  7092 		    (haltSelectors includes:sel2) ifTrue:[
  6694                         con2 method mclass == Object ifTrue:[
  7093 			con2 method mclass == Object ifTrue:[
  6695                             ^ contextArray at:idx+2.
  7094 			    ^ contextArray at:idx+2.
  6696                         ]
  7095 			]
  6697                     ].
  7096 		    ].
  6698                     ^ contextArray at:idx+1
  7097 		    ^ contextArray at:idx+1
  6699                 ].
  7098 		].
  6700                 method mclass == Breakpoint ifTrue:[
  7099 		method mclass == Breakpoint ifTrue:[
  6701 (contextArray at:idx+1) infoPrintCR.
  7100 (contextArray at:idx+1) infoPrintCR.
  6702                     ^ contextArray at:idx+1
  7101 		    ^ contextArray at:idx+1
  6703                 ].
  7102 		].
  6704             ].
  7103 	    ].
  6705         ].
  7104 	].
  6706         con method isWrapped ifTrue:[
  7105 	con method isWrapped ifTrue:[
  6707             ^ con
  7106 	    ^ con
  6708         ].
  7107 	].
  6709     ].
  7108     ].
  6710     ^ nil
  7109     ^ nil
  6711 
  7110 
  6712     "Modified: / 27-01-2012 / 11:06:02 / cg"
  7111     "Modified: / 27-01-2012 / 11:06:02 / cg"
  6713 !
  7112 !
  6727      faster, since no resources have to be allocated in the display.
  7126      faster, since no resources have to be allocated in the display.
  6728      We have to be careful to release all refs to the debuggee, though.
  7127      We have to be careful to release all refs to the debuggee, though.
  6729      Otherwise, the GC will not be able to release it."
  7128      Otherwise, the GC will not be able to release it."
  6730 
  7129 
  6731     windowGroup notNil ifTrue:[
  7130     windowGroup notNil ifTrue:[
  6732         windowGroup setProcess:nil.
  7131 	windowGroup setProcess:nil.
  6733     ].
  7132     ].
  6734 
  7133 
  6735     self releaseDebuggee.
  7134     self releaseDebuggee.
  6736 
  7135 
  6737     cachable ~~ true ifTrue:[^ self].
  7136     cachable ~~ true ifTrue:[^ self].
  6738 
  7137 
  6739     "/
  7138     "/
  6740     "/ only cache if I am on the Display
  7139     "/ only cache if I am on the Display (i.e. the default screen)
  6741     "/
  7140     "/
  6742     device == Display ifTrue:[
  7141     self graphicsDevice == Display ifTrue:[
  6743         exclusive ifTrue:[
  7142 	exclusive ifTrue:[
  6744             CachedExclusive := self
  7143 	    CachedExclusive := self
  6745         ] ifFalse:[
  7144 	] ifFalse:[
  6746             CachedDebugger := self
  7145 	    CachedDebugger := self
  6747         ].
  7146 	].
  6748     ].
  7147     ].
  6749 
  7148 
  6750     ObjectMemory stepInterruptHandler == self ifTrue:[
  7149     ObjectMemory stepInterruptHandler == self ifTrue:[
  6751         ObjectMemory stepInterruptHandler:nil
  7150 	ObjectMemory stepInterruptHandler:nil
  6752     ].
  7151     ].
  6753 
  7152 
  6754     "Modified: 10.7.1997 / 15:50:46 / stefan"
  7153     "Modified: 10.7.1997 / 15:50:46 / stefan"
  6755     "Modified: 31.7.1997 / 21:20:14 / cg"
  7154     "Modified: 31.7.1997 / 21:20:14 / cg"
  6756 !
  7155 !
  6757 
  7156 
  6758 isCached
  7157 isCached
  6759     "tell whether we are a cached debugger"
  7158     "tell whether we are a cached debugger"
  6760 
  7159 
  6761     CachedExclusive == self ifTrue:[
  7160     CachedExclusive == self ifTrue:[
  6762         ^ true.
  7161 	^ true.
  6763     ].
  7162     ].
  6764     CachedDebugger == self ifTrue:[
  7163     CachedDebugger == self ifTrue:[
  6765         ^ true.
  7164 	^ true.
  6766     ].
  7165     ].
  6767 
  7166 
  6768     ^ false.
  7167     ^ false.
  6769 
  7168 
  6770     "Created: / 10-07-1997 / 15:22:43 / stefan"
  7169     "Created: / 10-07-1997 / 15:22:43 / stefan"
  6775     "do not remember myself any longer for next debug session"
  7174     "do not remember myself any longer for next debug session"
  6776 
  7175 
  6777     cachable := false.
  7176     cachable := false.
  6778 
  7177 
  6779     CachedExclusive == self ifTrue:[
  7178     CachedExclusive == self ifTrue:[
  6780         CachedExclusive := nil.
  7179 	CachedExclusive := nil.
  6781     ].
  7180     ].
  6782     CachedDebugger == self ifTrue:[
  7181     CachedDebugger == self ifTrue:[
  6783         CachedDebugger := nil.
  7182 	CachedDebugger := nil.
  6784     ].
  7183     ].
  6785     OpenDebuggers notNil ifTrue:[
  7184     OpenDebuggers notNil ifTrue:[
  6786         OpenDebuggers remove:self ifAbsent:[].
  7185 	OpenDebuggers remove:self ifAbsent:[].
  6787     ].
  7186     ].
  6788 
  7187 
  6789     "Modified: 31.7.1997 / 21:20:11 / cg"
  7188     "Modified: 31.7.1997 / 21:20:11 / cg"
  6790 ! !
  7189 ! !
  6791 
  7190 
  6800 
  7199 
  6801 !DebugView methodsFor:'private-context handling'!
  7200 !DebugView methodsFor:'private-context handling'!
  6802 
  7201 
  6803 contextListEntryFor:aContext
  7202 contextListEntryFor:aContext
  6804     ^ Error
  7203     ^ Error
  6805         handle:[:ex | '???' ]
  7204 	handle:[:ex | '???' ]
  6806         do:[
  7205 	do:[
  6807             |s|
  7206 	    |s|
  6808 
  7207 
  6809             aContext selector == #doIt ifTrue:[
  7208 	    aContext selector == #doIt ifTrue:[
  6810                 aContext receiver isNil ifTrue:[
  7209 		aContext receiver isNil ifTrue:[
  6811                     s := 'doIt' allBold
  7210 		    s := 'doIt' allBold
  6812                 ]
  7211 		]
  6813             ].
  7212 	    ].
  6814 
  7213 
  6815             s := Text streamContents:[:s | aContext printOn:s ].
  7214 	    s := Text streamContents:[:s | aContext printOn:s ].
  6816             RememberedCallChain notNil ifTrue:[
  7215 	    RememberedCallChain notNil ifTrue:[
  6817                 (RememberedCallChain includesIdentical:aContext) ifTrue:[
  7216 		(RememberedCallChain includesIdentical:aContext) ifTrue:[
  6818                     s := s colorizeAllWith:(Color red).
  7217 		    s := s colorizeAllWith:(Color red).
  6819                 ].
  7218 		].
  6820             ].
  7219 	    ].
  6821             s
  7220 	    s
  6822         ].
  7221 	].
  6823 
  7222 
  6824     "Created: / 21-05-2007 / 13:30:24 / cg"
  7223     "Created: / 21-05-2007 / 13:30:24 / cg"
  6825 !
  7224 !
  6826 
  7225 
  6827 is:aHomeContext inCallingChainOf:aContext
  7226 is:aHomeContext inCallingChainOf:aContext
  6828     |con|
  7227     |con|
  6829 
  7228 
  6830     con := aContext.
  7229     con := aContext.
  6831     [con notNil and:[con ~~ aHomeContext]] whileTrue:[
  7230     [con notNil and:[con ~~ aHomeContext]] whileTrue:[
  6832         con := con sender
  7231 	con := con sender
  6833     ].
  7232     ].
  6834     ^ con notNil
  7233     ^ con notNil
  6835 
  7234 
  6836     "Created: / 10-06-2012 / 18:46:29 / cg"
  7235     "Created: / 10-06-2012 / 18:46:29 / cg"
  6837 !
  7236 !
  6842     |c cReceiver|
  7241     |c cReceiver|
  6843 
  7242 
  6844     "/ look for a breakpoint-wrapper's context
  7243     "/ look for a breakpoint-wrapper's context
  6845     c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil.
  7244     c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil.
  6846     c isNil ifTrue:[
  7245     c isNil ifTrue:[
  6847         ^ true.
  7246 	^ true.
  6848     ].
  7247     ].
  6849     cReceiver := c receiver.
  7248     cReceiver := c receiver.
  6850     ^ cReceiver == BreakPointInterrupt
  7249     ^ cReceiver == BreakPointInterrupt
  6851 
  7250 
  6852     "Modified: / 01-08-2013 / 23:34:01 / cg"
  7251     "Modified: / 01-08-2013 / 23:34:01 / cg"
  6862     IgnoredHalts isNil ifTrue:[^ false].
  7261     IgnoredHalts isNil ifTrue:[^ false].
  6863 
  7262 
  6864     "/ look for a method breakpoint-wrapper's context
  7263     "/ look for a method breakpoint-wrapper's context
  6865     c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil.
  7264     c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil.
  6866     c notNil ifTrue:[
  7265     c notNil ifTrue:[
  6867         ((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[
  7266 	((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[
  6868             c := c sender findNextContextWithSelector:#doRaise or:nil or:nil.
  7267 	    c := c sender findNextContextWithSelector:#doRaise or:nil or:nil.
  6869             cReceiver := c receiver.    
  7268 	    cReceiver := c receiver.
  6870         ].
  7269 	].
  6871         (cReceiver isKindOf:BreakPointInterrupt) ifFalse:[
  7270 	(cReceiver isKindOf:BreakPointInterrupt) ifFalse:[
  6872             c := nil
  7271 	    c := nil
  6873         ] ifTrue:[
  7272 	] ifTrue:[
  6874             [ 
  7273 	    [
  6875                 sender := c sender.
  7274 		sender := c sender.
  6876                 ((sReceiver := sender receiver) isKindOf:BreakPointInterrupt)
  7275 		((sReceiver := sender receiver) isKindOf:BreakPointInterrupt)
  6877                 or:[ sReceiver == BreakPointInterrupt ]
  7276 		or:[ sReceiver == BreakPointInterrupt ]
  6878             ] whileTrue:[
  7277 	    ] whileTrue:[
  6879                 c := sender
  7278 		c := sender
  6880             ].
  7279 	    ].
  6881             [ (sender := c sender) isBlockContext ] whileTrue:[
  7280 	    [ (sender := c sender) isBlockContext ] whileTrue:[
  6882                 c := sender
  7281 		c := sender
  6883             ].
  7282 	    ].
  6884             sender := nil. "/ avoid keeping a reference to this context
  7283 	    sender := nil. "/ avoid keeping a reference to this context
  6885         ].
  7284 	].
  6886     ].
  7285     ].
  6887 
  7286     "/ Transcript showCR:c.
  6888     c isNil ifTrue:[
  7287     c isNil ifTrue:[
  6889         "/ look for halts or explicit breakpoints
  7288 	"/ look for halts or explicit breakpoints
  6890         c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil.
  7289 	c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil.
  6891         c isNil ifTrue:[
  7290 	c isNil ifTrue:[
  6892             c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil.
  7291 	    c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil.
  6893             c isNil ifTrue:[
  7292 	    c isNil ifTrue:[
  6894                ^ false
  7293 	       ^ false
  6895             ].
  7294 	    ].
  6896             breakpointParameter := c argAt:1.
  7295 	    breakpointParameter := c argAt:1.
  6897             (self class 
  7296 	    (self class
  6898                     isBreakpointToBeIgnoredForParameter:breakpointParameter
  7297 		    isBreakpointToBeIgnoredForParameter:breakpointParameter
  6899                     context:(c sender)
  7298 		    context:(c sender)
  6900                     modifyEntryCount:true
  7299 		    modifyEntryCount:true
  6901             ) ifTrue:[
  7300 	    ) ifTrue:[
  6902                 ^ true.
  7301 		^ true.
  6903             ].
  7302 	    ].
  6904         ].
  7303 	].
  6905     ].
  7304     ].
  6906 
  7305 
  6907     c := c sender.
  7306     c := c sender.
  6908     "/ a code-breakpoint ?
  7307     "/ a code-breakpoint ?
  6909     (c receiver isKindOf:Breakpoint) ifTrue:[
  7308     (c receiver isKindOf:Breakpoint) ifTrue:[
  6910         c := c sender.
  7309 	c := c sender.
  6911     ].
  7310     ].
  6912     haltingMethod := c method.
  7311     haltingMethod := c method.
  6913 
  7312 
  6914     haltingMethod isWrapped ifTrue:[
  7313     haltingMethod isWrapped ifTrue:[
  6915         lineNrInHaltingMethod := 1.
  7314 	lineNrInHaltingMethod := 1.
  6916     ] ifFalse:[
  7315     ] ifFalse:[
  6917         lineNrInHaltingMethod := c lineNumber.
  7316 	lineNrInHaltingMethod := c lineNumber.
  6918         "/ Transcript showCR:c.
  7317 	"/ Transcript showCR:c.
  6919     ].
  7318     ].
  6920 
  7319 
  6921     ^ self class
  7320     ^ self class
  6922         isHaltToBeIgnoredIn:haltingMethod
  7321 	isHaltToBeIgnoredIn:haltingMethod
  6923         atLineNr:lineNrInHaltingMethod
  7322 	atLineNr:lineNrInHaltingMethod
  6924         context:c
  7323 	context:c
  6925         modifyEntryCount:true.
  7324 	modifyEntryCount:true.
  6926 
  7325 
  6927     "Created: / 22-10-2010 / 12:09:53 / cg"
  7326     "Created: / 22-10-2010 / 12:09:53 / cg"
  6928     "Modified: / 06-03-2012 / 12:54:09 / cg"
  7327     "Modified: / 06-03-2012 / 12:54:09 / cg"
  6929 !
  7328 !
  6930 
  7329 
  6937 !
  7336 !
  6938 
  7337 
  6939 setContext:aContext releaseInspectors:releaseInspectors
  7338 setContext:aContext releaseInspectors:releaseInspectors
  6940     "show calling chain from aContext in the walk-back listview.
  7339     "show calling chain from aContext in the walk-back listview.
  6941      Most complications here arise from filtering less-interesting contexts
  7340      Most complications here arise from filtering less-interesting contexts
  6942      if not in verbose-context mode or when hiding implementation contexts."
  7341      if not in verbose-context mode or when hiding implementation contexts.
  6943 
  7342      There is a lot of heuristic magic here, to make the debugger as useful
  6944     |con text method caller caller2 called called2 m count c cc sndr
  7343      as possible for the user (but not particularly for the debugger-developer)"
  6945      suspendContext calledBySuspendContext nm h calledContext show2|
  7344 
       
  7345     |con sel text method caller caller2 called called2 m count c cc sndr
       
  7346      suspendContext calledBySuspendContext nm h calledContext show2
       
  7347      alreadyInApplicationCode verboseBacktrace|
  6946 
  7348 
  6947 "/    (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[
  7349 "/    (contextArray size > 0 and:[aContext == (contextArray at:1)]) ifTrue:[
  6948 "/        "no change"
  7350 "/        "no change"
  6949 "/        ^ false
  7351 "/        ^ false
  6950 "/    ].
  7352 "/    ].
  6951 
  7353 
  6952     isStoppedAtHaltOrBreakPoint := isStoppedAtBreakPointWithParameter := isStoppedInModalDialog := false.
  7354     isStoppedAtHaltOrBreakPoint := isStoppedAtBreakPointWithParameter := false.
       
  7355     isStoppedInModalDialog := isStoppedInApplicationAction := alreadyInApplicationCode := false.
       
  7356     isStoppedAtStatementBreakpoint := false.
  6953     firstContext := aContext.
  7357     firstContext := aContext.
       
  7358     verboseBacktrace := self verboseBacktraceHolder value.
  6954 
  7359 
  6955     m := contextView middleButtonMenu.
  7360     m := contextView middleButtonMenu.
  6956     m notNil ifTrue:[
  7361     m notNil ifTrue:[
  6957         m disable:#showMore.
  7362         m disable:#showMore.
  6958     ].
  7363     ].
  6962         text := Array with:'** no context **'.
  7367         text := Array with:'** no context **'.
  6963         contextArray := nil.
  7368         contextArray := nil.
  6964     ] ifFalse:[
  7369     ] ifFalse:[
  6965         text := OrderedCollection new:nChainShown.
  7370         text := OrderedCollection new:nChainShown.
  6966         contextArray := OrderedCollection new:nChainShown.
  7371         contextArray := OrderedCollection new:nChainShown.
       
  7372 
  6967         con := aContext.
  7373         con := aContext.
  6968         calledContext := nil.
  7374         calledContext := nil.
       
  7375 
       
  7376         DebuggingContextWalk == true ifTrue:[
       
  7377             '======================================' print. con printCR.
       
  7378         ].
       
  7379         alreadyInApplicationCode :=
       
  7380                 con receiver isLazyValue not     "/ careful to not force futures/lazy values
       
  7381                 and:[con receiver isKindOf:ApplicationModel].
  6969 
  7382 
  6970         verboseBacktrace ~~ true ifTrue:[
  7383         verboseBacktrace ~~ true ifTrue:[
  6971             "/ with dense backtrace, hide the ProcessorScheduler
  7384             "/ with dense backtrace, hide the ProcessorScheduler
  6972             "/ contexts at the top; look for a Process>>suspend*
  7385             "/ contexts at the top; look for a Process>>suspend*
  6973             "/ context within the first 10 contexts
  7386             "/ context within the first 10 contexts
  6974 
  7387 
  6975             suspendContext := nil.
  7388             suspendContext := nil.
  6976             c := con.
  7389             c := con.
  6977             1 to:10 do:[:i |
  7390             1 to:10 do:[:i |
  6978                 |sel|
  7391                 |selector|
  6979 
  7392 
  6980                 c notNil ifTrue:[
  7393                 c notNil ifTrue:[
  6981                     (sel := c selector) notNil ifTrue:[
  7394                     selector := c selector.
  6982                         ((sel isSymbol and:[sel startsWith:'suspend'])
  7395                     selector notNil ifTrue:[
  6983                         and:[c receiver isMemberOf:Process]) ifTrue:[
  7396                         (selector isSymbol and:[(selector startsWith:'suspend') and:[c receiver isMemberOf:Process]]) ifTrue:[
  6984                             suspendContext := c.
  7397                             suspendContext := c.
  6985                             calledBySuspendContext := cc.
  7398                             calledBySuspendContext := cc.
  6986                         ].
  7399                         ].
  6987                     ].
  7400                     ].
  6988                     cc := c.
  7401                     cc := c.
  6993                 con := suspendContext.
  7406                 con := suspendContext.
  6994                 calledContext := calledBySuspendContext.
  7407                 calledContext := calledBySuspendContext.
  6995                 suspendContext := nil
  7408                 suspendContext := nil
  6996             ].
  7409             ].
  6997         ].
  7410         ].
  6998 "/ Transcript show:'1 '; showCR:con.
  7411         "/ Transcript show:'1 '; showCR:con.
  6999         con notNil ifTrue:[
  7412         con notNil ifTrue:[
  7000             "/ hide the halt implementation
  7413             "/ hide the halt implementation
  7001             (self haltSelectors includes:con selector) ifTrue:[
  7414             sel := con selector.
       
  7415             (self haltSelectors includes:sel) ifTrue:[
  7002                 (method := con method) notNil ifTrue:[
  7416                 (method := con method) notNil ifTrue:[
  7003                     method mclass == Object ifTrue:[
  7417                     method mclass == Object ifTrue:[
  7004                         (con selector isSymbol
  7418                         (sel isSymbol and:[ sel startsWith:'breakPoint:']) ifTrue:[
  7005                         and:[ con selector startsWith:'breakPoint:']) ifTrue:[
       
  7006                             isStoppedAtBreakPointWithParameter := true.
  7419                             isStoppedAtBreakPointWithParameter := true.
  7007                             breakPointParameter := con argAt:1.
  7420                             breakPointParameter := con argAt:1.
  7008                         ].
  7421                         ].
  7009                         isStoppedAtHaltOrBreakPoint := true.
  7422                         isStoppedAtHaltOrBreakPoint := true.
  7010                         verboseBacktrace ~~ true ifTrue:[
  7423                         verboseBacktrace ~~ true ifTrue:[
  7012                             con := con sender.
  7425                             con := con sender.
  7013                         ]
  7426                         ]
  7014                     ] ifFalse:[
  7427                     ] ifFalse:[
  7015                         method mclass == Breakpoint ifTrue:[
  7428                         method mclass == Breakpoint ifTrue:[
  7016                             isStoppedAtHaltOrBreakPoint := true.
  7429                             isStoppedAtHaltOrBreakPoint := true.
       
  7430                             isStoppedAtStatementBreakpoint := true.
  7017                             verboseBacktrace ~~ true ifTrue:[
  7431                             verboseBacktrace ~~ true ifTrue:[
  7018                                 calledContext := con.
  7432                                 calledContext := con.
  7019                                 con := con sender.
  7433                                 con := con sender.
  7020                             ]
  7434                             ].
       
  7435                             "/ Transcript show:'2 '; showCR:con.
  7021                         ].
  7436                         ].
  7022                     ].
  7437                     ].
  7023                 ].
  7438                 ].
  7024             ].
  7439             ].
  7025         ].
  7440         ].
       
  7441 
       
  7442         (verboseBacktrace not or:[ hideSupportCode]) ifTrue:[
       
  7443             [
       
  7444                 con notNil
       
  7445                 and:[ con isBlockContext not
       
  7446                 and:[ con method notNil
       
  7447                 and:[ (con method shouldBeSkippedInDebuggersWalkBack)
       
  7448                 and:[ (self haltSelectors includes: con selector) not]]]]
       
  7449             ] whileTrue:[
       
  7450                 "/ Transcript show:'xx '; showCR:con.
       
  7451                 calledContext := con.
       
  7452                 con := con sender
       
  7453             ].
       
  7454         ].
       
  7455 
  7026         "
  7456         "
  7027          get them all
  7457          get them all, by walking along the caller chain.
       
  7458          depending on the settings, skip some intermediate contexts
       
  7459          (such as collection enumeration implementations), which are usually not
       
  7460          of interest when debugging an application.
       
  7461          On the fly, gather some additional information
       
  7462          such as: are we at a halt/breakpoint, are we in a modal dialog opened,
       
  7463          are we coming from an application model's action etc.
  7028         "
  7464         "
  7029         count := 0.
  7465         count := 0.
  7030         [con notNil and:[count <= nChainShown]] whileTrue:[
  7466         [con notNil and:[count <= nChainShown]] whileTrue:[
  7031             "/ remember any halt/breakpoint or openModal on the fly
  7467             "/ remember any halt/breakpoint or openModal on the fly
  7032             (self haltSelectors includes:con selector) ifTrue:[
  7468             DebuggingContextWalk == true ifTrue:[ '---' print. con printCR ].
       
  7469 
       
  7470             sel := con selector.
       
  7471             (self haltSelectors includes:sel) ifTrue:[
  7033                 (method := con method) notNil ifTrue:[
  7472                 (method := con method) notNil ifTrue:[
  7034                     method mclass == Object ifTrue:[
  7473                     method mclass == Object ifTrue:[
  7035                         (con selector isSymbol
  7474                         (sel isSymbol and:[sel startsWith:'breakPoint:']) ifTrue:[
  7036                         and:[con selector startsWith:'breakPoint:']) ifTrue:[
       
  7037                             isStoppedAtBreakPointWithParameter := true.
  7475                             isStoppedAtBreakPointWithParameter := true.
  7038                             breakPointParameter := con argAt:1.
  7476                             breakPointParameter := con argAt:1.
  7039                         ].
  7477                         ].
  7040                         isStoppedAtHaltOrBreakPoint := true.
  7478                         isStoppedAtHaltOrBreakPoint := true.
  7041                     ] ifFalse:[
  7479                     ] ifFalse:[
  7043                             isStoppedAtHaltOrBreakPoint := true.
  7481                             isStoppedAtHaltOrBreakPoint := true.
  7044                         ].
  7482                         ].
  7045                     ]
  7483                     ]
  7046                 ]
  7484                 ]
  7047             ] ifFalse:[
  7485             ] ifFalse:[
  7048                 ((con selector == #openModal) or:[con selector == #openModal:]) ifTrue:[
  7486                 ((sel == #openModal) or:[sel == #openModal:]) ifTrue:[
  7049                     isStoppedInModalDialog := true.
  7487                     isStoppedInModalDialog := true.
  7050                 ].
  7488                 ] ifFalse:[
       
  7489                     alreadyInApplicationCode ifFalse:[
       
  7490                         (con receiver isLazyValue not  "/ careful to not force futures/lazy values
       
  7491                         and:[con receiver isKindOf:ApplicationModel]) ifTrue:[
       
  7492                             isStoppedInApplicationAction := true.
       
  7493                         ]
       
  7494                     ]
       
  7495                 ]
  7051             ].
  7496             ].
  7052 
  7497 
  7053             [
  7498             [
  7054                 |show1|
  7499                 |show1|
  7055 
  7500 
  7067             DebuggingDebugger3 == true ifTrue:[
  7512             DebuggingDebugger3 == true ifTrue:[
  7068                 'showingContext2: (' print. con print. ') --> ' print. show2 printCR.
  7513                 'showingContext2: (' print. con print. ') --> ' print. show2 printCR.
  7069             ].
  7514             ].
  7070 
  7515 
  7071             show2 ifTrue:[
  7516             show2 ifTrue:[
  7072                 (self showingContext3:con nesting:count) ifTrue:[
  7517                 contextArray add:con.
  7073                     contextArray add:con.
  7518 
  7074 
  7519                 (MoreDebuggingDetail == true) ifTrue:[
  7075                     (MoreDebuggingDetail == true) ifTrue:[
  7520                     nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString).
  7076                         nm := (((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString).
       
  7077                     ] ifFalse:[
       
  7078                         nm := self contextListEntryFor:con.
       
  7079                     ].
       
  7080                     text add:nm.
       
  7081                     count := count + 1.
       
  7082                 ] ifFalse:[
  7521                 ] ifFalse:[
  7083                     DebuggingDebugger3 == true ifTrue:[
  7522                     nm := self contextListEntryFor:con.
  7084                         'showingContext3: (' print. con print. ') --> false' printCR.
  7523                 ].
  7085                     ].
  7524                 text add:nm.
  7086                 ]
  7525                 count := count + 1.
  7087             ].
  7526             ].
  7088 
  7527 
  7089             "/ with hidden support code, skip over internals of exceptions
  7528             "/ with hidden support code, skip over internals of exceptions
  7090             hideSupportCode == true ifTrue:[
  7529             hideSupportCode == true ifTrue:[
       
  7530                 "/ Transcript showCR:'x'.
  7091                 (con isBlockContext
  7531                 (con isBlockContext
  7092                 and:[ (h := con home) notNil
  7532                 and:[ (h := con home) notNil
  7093                 and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[
  7533                 and:[ (self is:h inCallingChainOf:con) ]]) ifTrue:[
  7094                     |blocksReceiver|
  7534                     |blocksReceiver|
  7095                     blocksReceiver := con receiver.
  7535                     blocksReceiver := con receiver.
  7096                     c := con sender.
  7536                     c := con sender.
  7097                     [ 
  7537                     [
  7098                         c notNil 
  7538                         c notNil
  7099                         and:[ 
  7539                         and:[
  7100                             sndr := c sender.
  7540                             sndr := c sender.
  7101                             (sndr ~= h) 
  7541                             (sndr ~= h)
  7102                             and:[ 
  7542                             and:[
  7103                                 blocksReceiver isCollection         "/ skip collection implementations
  7543                                 blocksReceiver isCollection         "/ skip collection implementations
  7104                                 or:[ ( #( #'handle:do:'         "/ skip exception implementations
  7544                                 or:[ ( #( #'handle:do:'         "/ skip exception implementations
  7105                                           #'handleDo:' 
  7545                                           #'handleDo:'
  7106                                           #'answer:do:' 
  7546                                           #'answer:do:'
  7107                                           #'ensure:' ) includes: c selector ) 
  7547                                           #'ensure:' ) includes: c selector )
  7108                                 or:[ #'perform:*'               "/ skip perform implementations
  7548                                 or:[ #'perform:*'               "/ skip perform implementations
  7109                                          match: c selector ]] 
  7549                                          match: c selector ]]
  7110                             ]
  7550                             ]
  7111                         ] 
  7551                         ]
  7112                     ] whileTrue:[ 
  7552                     ] whileTrue:[
  7113                         c := sndr 
  7553                         c := sndr
  7114                     ].
  7554                     ].
  7115                     c notNil ifTrue:[
  7555                     c notNil ifTrue:[
  7116                         con := c "sender".
  7556                         con := c "sender".
  7117                     ].
  7557                     ].
  7118                 ].
  7558                 ].
  7119             ].
  7559             ].
  7120 
  7560 
  7121             "/
  7561             "/
  7122             "/ kludge: if its a wrapped method, then hide the wrap-call
  7562             "/ kludge: if it's a wrapped method, then hide the wrap-call
  7123             "/
  7563             "/
  7124             method := con method.
  7564             method := con method.
  7125             method notNil ifTrue:[
  7565             method notNil ifTrue:[
  7126                 called := con.
  7566                 called := con.
  7127                 caller := con sender.
  7567                 caller := con sender.
  7138 
  7578 
  7139                 ].
  7579                 ].
  7140                 caller := caller2 := nil
  7580                 caller := caller2 := nil
  7141             ].
  7581             ].
  7142 
  7582 
  7143             "/ with dense backtrace, skip the doIt methods context
  7583             "/ with dense backtrace, skip the doIt method's context
  7144             "/ (its dummy anyway) and fake that contexts name
  7584             "/ (its dummy anyway) and fake that context's name
  7145 
  7585 
  7146             verboseBacktrace ~~ true ifTrue:[
  7586             verboseBacktrace ~~ true ifTrue:[
  7147                 (con isBlockContext
  7587                 (con isBlockContext
  7148                  and:[(h := con home) == con sender
  7588                  and:[(h := con home) == con sender
  7149                  and:[h notNil
  7589                  and:[h notNil
  7156                     text add:(self contextListEntryFor:con methodHome).
  7596                     text add:(self contextListEntryFor:con methodHome).
  7157                 ].
  7597                 ].
  7158                 h := nil.  "/ never keep refs to contexts unless you really need them ...
  7598                 h := nil.  "/ never keep refs to contexts unless you really need them ...
  7159             ].
  7599             ].
  7160 
  7600 
  7161             "/ with dense backtrace, dont show below the doIt
  7601             "/ with dense backtrace, don't show contexts below the doIt
  7162             ( verboseBacktrace ~~ true
  7602             ( verboseBacktrace ~~ true
  7163             and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[
  7603             and:[ (self setOfHiddenCallingSelectors includes:con selector) ]) ifTrue:[
  7164                 con := nil.
  7604                 con := nil.
  7165             ] ifFalse:[
  7605             ] ifFalse:[
  7166                 calledContext := con.
  7606                 calledContext := con.
  7181                 contextArray removeLast.
  7621                 contextArray removeLast.
  7182                 text removeLast
  7622                 text removeLast
  7183             ].
  7623             ].
  7184 
  7624 
  7185             verboseBacktrace ~~ true ifTrue:[
  7625             verboseBacktrace ~~ true ifTrue:[
  7186                 "/ in dense mode, remove the process startup
  7626                 "/ in dense mode, remove process startup contexts (if any)
  7187                 "/ contexts (if any)
       
  7188 
  7627 
  7189                 (contextArray size > 0
  7628                 (contextArray size > 0
  7190                 and:[(con := contextArray last) methodClass == Process]) ifTrue:[
  7629                 and:[(con := contextArray last) methodClass == Process]) ifTrue:[
  7191                     con selector == #start ifTrue:[
  7630                     con selector == #start ifTrue:[
  7192                         contextArray removeLast.
  7631                         contextArray removeLast.
  7231      Ignore any non-interesting interrupt-context."
  7670      Ignore any non-interesting interrupt-context."
  7232 
  7671 
  7233     |con|
  7672     |con|
  7234 
  7673 
  7235     con := aContext.
  7674     con := aContext.
  7236     verboseBacktrace ifFalse:[
  7675     self verboseBacktraceHolder value ifFalse:[
  7237         (con notNil and:[con selector == #threadSwitch:]) ifTrue:[
  7676 	(con notNil and:[con selector == #threadSwitch:]) ifTrue:[
  7238             con := con sender.
  7677 	    con := con sender.
  7239             (con notNil and:[con selector == #timerInterrupt]) ifTrue:[
  7678 	    (con notNil and:[con selector == #timerInterrupt]) ifTrue:[
  7240                 con := con sender.
  7679 		con := con sender.
  7241             ].
  7680 	    ].
  7242         ].
  7681 	].
  7243     ].
  7682     ].
  7244     ^ self setContext:con releaseInspectors:true
  7683     ^ self setContext:con releaseInspectors:true
  7245 
  7684 
  7246     "Created: / 20.10.1996 / 18:10:21 / cg"
  7685     "Created: / 20.10.1996 / 18:10:21 / cg"
  7247     "Modified: / 17.1.1998 / 12:43:19 / cg"
  7686     "Modified: / 17.1.1998 / 12:43:19 / cg"
  7252      Here, we hide some well known methods, which are usually not too interesting;
  7691      Here, we hide some well known methods, which are usually not too interesting;
  7253      the set of methods which are suppressed is my (claus's) own choice."
  7692      the set of methods which are suppressed is my (claus's) own choice."
  7254 
  7693 
  7255     |recIsException sel rec senderRec mthd mthdClass calledSel calledRec|
  7694     |recIsException sel rec senderRec mthd mthdClass calledSel calledRec|
  7256 
  7695 
  7257     verboseBacktrace == true ifTrue:[ ^true ].
  7696     self verboseBacktraceHolder value ifTrue:[ ^true ].
  7258     aContext isNil ifTrue:[ ^true ].
  7697     aContext isNil ifTrue:[ ^true ].
  7259 
  7698 
  7260     sel := aContext selector.
  7699     sel := aContext selector.
  7261     rec := aContext receiver.
  7700     rec := aContext receiver.
  7262     mthd := aContext method.
  7701     mthd := aContext method.
  7263     mthd notNil ifTrue:[ mthdClass := mthd mclass ].
  7702     mthd notNil ifTrue:[ mthdClass := mthd mclass ].
  7264 
  7703 
  7265     "/ to avoid firing/waiting the lazy or future
  7704     "/ to avoid firing/waiting the lazy or future
  7266     recIsException := (rec isLazyValue not) and:[rec isException].
  7705     recIsException := (rec isLazyValue not) and:[rec isException].
  7267     aContext sender notNil ifTrue:[
  7706     aContext sender notNil ifTrue:[
  7268         senderRec := aContext sender receiver
  7707 	senderRec := aContext sender receiver
  7269     ].
  7708     ].
  7270 
  7709 
  7271     DebuggingDebugger3 == true ifTrue:[
  7710     DebuggingDebugger3 == true ifTrue:[
  7272         'showingContext1: (' print. aContext print.
  7711 	'showingContext1: (' print. aContext print.
  7273         ') calling: (' print. calledContext print.
  7712 	') calling: (' print. calledContext print.
  7274         ')' printCR.
  7713 	')' printCR.
  7275     ].
  7714     ].
  7276 
  7715 
  7277     (#(doCallHandler: doRaise
  7716     (#(doCallHandler: doRaise
  7278     ) includes:sel)
  7717     ) includes:sel)
  7279         ifTrue:[
  7718 	ifTrue:[
  7280             recIsException ifTrue:[ ^ false].
  7719 	    recIsException ifTrue:[ ^ false].
  7281         ].
  7720 	].
  7282 
  7721 
  7283     (#(raise raiseRequest
  7722     (#(raise raiseRequest
  7284     ) includes:sel)
  7723     ) includes:sel)
  7285         ifTrue:[
  7724 	ifTrue:[
  7286             recIsException ifTrue:[
  7725 	    recIsException ifTrue:[
  7287                 (senderRec isLazyValue not
  7726 		(senderRec isLazyValue not
  7288                 and:[ senderRec isExceptionCreator]) ifTrue:[^ false].
  7727 		and:[ senderRec isExceptionCreator]) ifTrue:[^ false].
  7289             ].
  7728 	    ].
  7290         ].
  7729 	].
  7291 
  7730 
  7292     (#(doWhile:
  7731     (#(doWhile:
  7293     ) includes:sel)
  7732     ) includes:sel)
  7294         ifTrue:[
  7733 	ifTrue:[
  7295             rec isBlock ifTrue:[
  7734 	    rec isBlock ifTrue:[
  7296                 true "aContext sender isBlockContext" ifTrue:[^ false].
  7735 		true "aContext sender isBlockContext" ifTrue:[^ false].
  7297             ].
  7736 	    ].
  7298         ].
  7737 	].
  7299 
  7738 
  7300     calledContext notNil ifTrue:[
  7739     calledContext notNil ifTrue:[
  7301         calledSel := calledContext selector.
  7740 	calledSel := calledContext selector.
  7302         calledRec := calledContext receiver.
  7741 	calledRec := calledContext receiver.
  7303 
  7742 
  7304         calledRec isBlock ifTrue:[
  7743 	calledRec isBlock ifTrue:[
  7305             (calledSel == #ensure:) ifTrue:[^ false].
  7744 	    (calledSel == #ensure:) ifTrue:[^ false].
  7306             (calledSel == #ifCurtailed:) ifTrue:[^ false].
  7745 	    (calledSel == #ifCurtailed:) ifTrue:[^ false].
  7307         ].
  7746 	].
  7308         (calledSel == #handle:do:) ifTrue:[^ false].
  7747 	(calledSel == #handle:do:) ifTrue:[^ false].
  7309         (calledSel == #answer:do:) ifTrue:[^ false].
  7748 	(calledSel == #answer:do:) ifTrue:[^ false].
  7310 
  7749 
  7311 "/        calledRec isLazyValue ifFalse:[
  7750 "/        calledRec isLazyValue ifFalse:[
  7312 "/            ((calledSel == #doWhile:)
  7751 "/            ((calledSel == #doWhile:)
  7313 "/            and:[calledRec isBlock])
  7752 "/            and:[calledRec isBlock])
  7314 "/                ifTrue:[^ false].
  7753 "/                ifTrue:[^ false].
  7323 "/                ifTrue:[^ false].
  7762 "/                ifTrue:[^ false].
  7324 "/        ].
  7763 "/        ].
  7325     ].
  7764     ].
  7326 
  7765 
  7327     (#(handleDo:) includes:sel)
  7766     (#(handleDo:) includes:sel)
  7328         ifTrue:[
  7767 	ifTrue:[
  7329             (calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false].
  7768 	    (calledRec isLazyValue not and:[calledRec isExceptionHandler]) ifTrue:[^ false].
  7330         ].
  7769 	].
  7331     (#(
  7770     (#(
  7332         withCursor:do:
  7771 	withCursor:do:
  7333         withWaitCursorDo:
  7772 	withWaitCursorDo:
  7334         withReadCursorDo:
  7773 	withReadCursorDo:
  7335         withWriteCursorDo:
  7774 	withWriteCursorDo:
  7336         withSearchCursorDo:
  7775 	withSearchCursorDo:
  7337       ) includes:sel)
  7776       ) includes:sel)
  7338         ifTrue:[
  7777 	ifTrue:[
  7339             (mthdClass == TopView) ifTrue:[^ false].
  7778 	    (mthdClass == TopView) ifTrue:[^ false].
  7340             (mthdClass == ApplicationModel) ifTrue:[^ false].
  7779 	    (mthdClass == ApplicationModel) ifTrue:[^ false].
  7341             (mthdClass == WindowGroup) ifTrue:[^ false].
  7780 	    (mthdClass == WindowGroup) ifTrue:[^ false].
  7342         ].
  7781 	].
  7343 
  7782 
  7344     (#(
  7783     (#(
  7345         wait
  7784 	wait
  7346         waitWithTimeout:
  7785 	waitWithTimeout:
  7347         waitWithTimeoutMs:
  7786 	waitWithTimeoutMs:
  7348       ) includes:sel)
  7787       ) includes:sel)
  7349         ifTrue:[
  7788 	ifTrue:[
  7350             (mthdClass == Semaphore) ifTrue:[^ false].
  7789 	    (mthdClass == Semaphore) ifTrue:[^ false].
  7351             (mthdClass == SemaphoreSet) ifTrue:[^ false].
  7790 	    (mthdClass == SemaphoreSet) ifTrue:[^ false].
  7352         ].
  7791 	].
  7353 
  7792 
  7354     ^ true
  7793     ^ true
  7355 
  7794 
  7356     "Created: / 17-11-2001 / 22:24:06 / cg"
  7795     "Created: / 17-11-2001 / 22:24:06 / cg"
  7357     "Modified: / 27-07-2012 / 17:30:18 / cg"
  7796     "Modified: / 27-07-2012 / 17:30:18 / cg"
  7363      the set of methods which are suppressed is my (claus's) own choice."
  7802      the set of methods which are suppressed is my (claus's) own choice."
  7364 
  7803 
  7365     |sel rec mClass
  7804     |sel rec mClass
  7366      sender senderReceiver senderSelector senderReceiverClass|
  7805      sender senderReceiver senderSelector senderReceiverClass|
  7367 
  7806 
  7368     verboseBacktrace ifTrue:[^ true].
  7807     self verboseBacktraceHolder value ifTrue:[^ true].
  7369     aContext isNil ifTrue:[^ true].
  7808     aContext isNil ifTrue:[^ true].
  7370 
  7809 
  7371     rec := aContext receiver.
  7810     rec := aContext receiver.
  7372     sel := aContext selector.
  7811     sel := aContext selector.
  7373     mClass := aContext methodClass.
  7812     mClass := aContext methodClass.
  7374 
  7813 
  7375     sender := aContext sender.
  7814     sender := aContext sender.
  7376     sender notNil ifTrue:[
  7815     sender notNil ifTrue:[
  7377         senderSelector := sender selector.
  7816 	senderSelector := sender selector.
  7378         senderReceiver := sender receiver.
  7817 	senderReceiver := sender receiver.
  7379         senderReceiverClass := senderReceiver class.
  7818 	senderReceiverClass := senderReceiver class.
  7380     ].
  7819     ].
  7381 
  7820 
  7382     sel == #withCursor:do: ifTrue:[
  7821     sel == #withCursor:do: ifTrue:[
  7383         (mClass == WindowGroup) ifTrue:[^ false].
  7822 	(mClass == WindowGroup) ifTrue:[^ false].
  7384         (mClass == TopView) ifTrue:[^ false].
  7823 	(mClass == TopView) ifTrue:[^ false].
  7385     ].
  7824     ].
  7386     (sel == #withExecuteCursorDo:
  7825     (sel == #withExecuteCursorDo:
  7387     or:[sel == #withWaitCursorDo:]) ifTrue:[
  7826     or:[sel == #withWaitCursorDo:]) ifTrue:[
  7388         (mClass == DisplaySurface) ifTrue:[^ false].
  7827 	(mClass == DisplaySurface) ifTrue:[^ false].
  7389     ].
  7828     ].
  7390 
  7829 
  7391     (sel == #do:
  7830     (sel == #do:
  7392     or:[sel == #from:to:do:
  7831     or:[sel == #from:to:do:
  7393     or:[sel == #keysAndValuesDo:
  7832     or:[sel == #keysAndValuesDo:
  7394     or:[sel == #doWithIndex:]]]) ifTrue:[
  7833     or:[sel == #doWithIndex:]]]) ifTrue:[
  7395         mClass == Array ifTrue:[^ false].
  7834 	mClass == Array ifTrue:[^ false].
  7396         mClass == OrderedCollection ifTrue:[^ false].
  7835 	mClass == OrderedCollection ifTrue:[^ false].
  7397         mClass == Set ifTrue:[^ false].
  7836 	mClass == Set ifTrue:[^ false].
  7398         mClass == Dictionary ifTrue:[^ false].
  7837 	mClass == Dictionary ifTrue:[^ false].
  7399         mClass == Interval ifTrue:[^ false].
  7838 	mClass == Interval ifTrue:[^ false].
  7400     ].
  7839     ].
  7401     (sel == #perform:
  7840     (sel == #perform:
  7402     or:[sel == #perform:with:
  7841     or:[sel == #perform:with:
  7403     or:[sel == #perform:with:with:
  7842     or:[sel == #perform:with:with:
  7404     or:[sel == #perform:with:with:with:
  7843     or:[sel == #perform:with:with:with:
  7405     or:[sel == #perform:with:with:with:with:
  7844     or:[sel == #perform:with:with:with:with:
  7406     or:[sel == #perform:withArguments:
  7845     or:[sel == #perform:withArguments:
  7407     or:[sel == #perform:with:ifNotUnderstood:
  7846     or:[sel == #perform:with:ifNotUnderstood:
  7408     or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]])
  7847     or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]])
  7409     ifTrue:[
  7848     ifTrue:[
  7410         hideSupportCode == true ifTrue:[
  7849 	hideSupportCode == true ifTrue:[
  7411             "/ 'x' printCR.
  7850 	    "/ 'x' printCR.
  7412             mClass == Object ifTrue:[^ false]
  7851 	    mClass == Object ifTrue:[^ false]
  7413         ].
  7852 	].
  7414         nesting == 0 ifTrue:[^ true].
  7853 	nesting == 0 ifTrue:[^ true].
  7415         mClass == Array ifTrue:[^ false].
  7854 	mClass == Array ifTrue:[^ false].
  7416         mClass == OrderedCollection ifTrue:[^ false].
  7855 	mClass == OrderedCollection ifTrue:[^ false].
  7417     ].
  7856     ].
  7418 
  7857 
  7419     sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false].
  7858     sel == #valueWithReceiver:arguments:selector:search:sender: ifTrue:[^ false].
  7420 
  7859 
  7421     (mClass == Object) ifTrue:[
  7860     (mClass == Object) ifTrue:[
  7422         (sel startsWith:'perform:') ifTrue:[^ false]
  7861 	(sel startsWith:'perform:') ifTrue:[^ false]
  7423     ].
  7862     ].
  7424 
  7863 
  7425     (mClass == Method) ifTrue:[
  7864     (mClass == Method) ifTrue:[
  7426         (sel startsWith:'valueWithReceiver:') ifTrue:[^ false]
  7865 	(sel startsWith:'valueWithReceiver:') ifTrue:[^ false]
  7427     ].
  7866     ].
  7428 
  7867 
  7429     (mClass == SmallInteger) ifTrue:[
  7868     (mClass == SmallInteger) ifTrue:[
  7430         (sel == #to:do:) ifTrue:[^ false].
  7869 	(sel == #to:do:) ifTrue:[^ false].
  7431         (sel == #to:by:do:) ifTrue:[^ false].
  7870 	(sel == #to:by:do:) ifTrue:[^ false].
  7432     ].
  7871     ].
  7433 
  7872 
  7434     (mClass == Block) ifTrue:[
  7873     (mClass == Block) ifTrue:[
  7435         sel == #ensure: ifTrue:[^ false].
  7874 	sel == #ensure: ifTrue:[^ false].
  7436         sel == #ifCurtailed: ifTrue:[^ false].
  7875 	sel == #ifCurtailed: ifTrue:[^ false].
  7437         sel == #valueNowOrOnUnwindDo: ifTrue:[^ false].
  7876 	sel == #valueNowOrOnUnwindDo: ifTrue:[^ false].
  7438         sel == #valueOnUnwindDo: ifTrue:[^ false].
  7877 	sel == #valueOnUnwindDo: ifTrue:[^ false].
  7439         sel == #on:do: ifTrue:[^ false].
  7878 	sel == #on:do: ifTrue:[^ false].
  7440 
  7879 
  7441         sel == #value ifTrue:[^ false].
  7880 	sel == #value ifTrue:[^ false].
  7442         sel == #value: ifTrue:[^ false].
  7881 	sel == #value: ifTrue:[^ false].
  7443         sel == #value:value: ifTrue:[^ false].
  7882 	sel == #value:value: ifTrue:[^ false].
  7444         sel == #value:value:value: ifTrue:[^ false].
  7883 	sel == #value:value:value: ifTrue:[^ false].
  7445         sel == #value:value:value:value: ifTrue:[^ false].
  7884 	sel == #value:value:value:value: ifTrue:[^ false].
  7446         sel == #value:value:value:value:Value: ifTrue:[^ false].
  7885 	sel == #value:value:value:value:Value: ifTrue:[^ false].
  7447         sel == #value:value:value:value:value:value: ifTrue:[^ false].
  7886 	sel == #value:value:value:value:value:value: ifTrue:[^ false].
  7448     ].
  7887     ].
  7449 
  7888 
  7450     aContext isBlockContext ifTrue:[
  7889     aContext isBlockContext ifTrue:[
  7451 "/        sel == #value ifTrue:[^ false].
  7890 "/        sel == #value ifTrue:[^ false].
  7452 "/        sel == #value: ifTrue:[^ false].
  7891 "/        sel == #value: ifTrue:[^ false].
  7460 "/            senderReceiverClass == QuerySignal ifTrue:[
  7899 "/            senderReceiverClass == QuerySignal ifTrue:[
  7461 "/                ^ false
  7900 "/                ^ false
  7462 "/            ]
  7901 "/            ]
  7463 "/        ]
  7902 "/        ]
  7464 
  7903 
  7465         aContext home notNil ifTrue:[
  7904 	aContext home notNil ifTrue:[
  7466             aContext home receiver isLazyValue ifFalse:[
  7905 	    aContext home receiver isLazyValue ifFalse:[
  7467                 (aContext home receiver isMemberOf:Semaphore) ifTrue:[
  7906 		(aContext home receiver isMemberOf:Semaphore) ifTrue:[
  7468                     (aContext home selector == #wait) ifTrue:[^ false].
  7907 		    (aContext home selector == #wait) ifTrue:[^ false].
  7469                     (aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false].
  7908 		    (aContext home selector == #waitWithTimeoutMs:) ifTrue:[^ false].
  7470                 ]
  7909 		]
  7471             ]
  7910 	    ]
  7472         ]
  7911 	]
  7473     ].
  7912     ].
  7474 
  7913 
  7475     (rec isExceptionHandler) ifTrue:[
  7914     (rec isExceptionHandler) ifTrue:[
  7476         sel == #handle:do: ifTrue:[^ false].
  7915 	sel == #handle:do: ifTrue:[^ false].
  7477         sel == #handleDo: ifTrue:[^ false].
  7916 	sel == #handleDo: ifTrue:[^ false].
  7478         (sel startsWith:#raise) ifTrue:[^ false].
  7917 	(sel startsWith:#raise) ifTrue:[^ false].
  7479         sel == #answer:do: ifTrue:[^ false].
  7918 	sel == #answer:do: ifTrue:[^ false].
  7480     ].
  7919     ].
  7481     (rec isLazyValue not and:[ rec isException] ) ifTrue:[
  7920     (rec isLazyValue not and:[ rec isException] ) ifTrue:[
  7482         sel == #doRaise ifTrue:[^ false].
  7921 	sel == #doRaise ifTrue:[^ false].
  7483         sel == #doCallHandler: ifTrue:[^ false].
  7922 	sel == #doCallHandler: ifTrue:[^ false].
  7484         (sel == #raise or:[sel == #raiseRequest]) ifTrue:[
  7923 	(sel == #raise or:[sel == #raiseRequest]) ifTrue:[
  7485             senderReceiverClass == Signal ifTrue:[^ false].
  7924 	    senderReceiverClass == Signal ifTrue:[^ false].
  7486         ]
  7925 	]
  7487     ].
  7926     ].
  7488     (mClass == Context) ifTrue:[
  7927     (mClass == Context) ifTrue:[
  7489         sel == #unwind ifTrue:[^ false].
  7928 	sel == #unwind ifTrue:[^ false].
  7490         sel == #unwind: ifTrue:[^ false].
  7929 	sel == #unwind: ifTrue:[^ false].
  7491     ].
  7930     ].
  7492     (mClass == ProcessorScheduler) ifTrue:[
  7931     (mClass == ProcessorScheduler) ifTrue:[
  7493         sel == #interruptActive ifTrue:[^ false].
  7932 	sel == #interruptActive ifTrue:[^ false].
  7494         sel == #threadSwitch: ifTrue:[^ false].
  7933 	sel == #threadSwitch: ifTrue:[^ false].
  7495         sel == #suspend: ifTrue:[^ false].
  7934 	sel == #suspend: ifTrue:[^ false].
  7496     ].
  7935     ].
  7497     mClass == Process ifTrue:[
  7936     mClass == Process ifTrue:[
  7498         sel == #suspendWithState: ifTrue:[^ false].
  7937 	sel == #suspendWithState: ifTrue:[^ false].
       
  7938     ].
       
  7939     (sel == #break) ifTrue:[
       
  7940 	(mClass == Breakpoint) ifTrue:[^ false].
  7499     ].
  7941     ].
  7500     ^ true.
  7942     ^ true.
  7501 
       
  7502     "Created: / 17-11-2001 / 19:34:20 / cg"
       
  7503     "Modified: / 27-07-2012 / 17:26:54 / cg"
       
  7504 !
       
  7505 
       
  7506 showingContext3:aContext nesting:nesting
       
  7507     "return false, if this (intermediate) context is to be skipped.
       
  7508      Here, we hide some well known methods, which are usually not too interesting;
       
  7509      the set of methods which are suppressed is my (claus's) own choice."
       
  7510 
       
  7511     |sel rec mClass
       
  7512      sender senderReceiver senderSelector senderReceiverClass|
       
  7513 
       
  7514     hideSupportCode ifFalse:[^ true].
       
  7515     aContext isNil ifTrue:[^ true].
       
  7516 
       
  7517 ^ true.
       
  7518 "/ mhmh - what was this useful for?
       
  7519 "/    rec := aContext receiver.
       
  7520 "/    sel := aContext selector.
       
  7521 "/    mClass := aContext methodClass.
       
  7522 "/
       
  7523 "/    sender := aContext sender.
       
  7524 "/    sender notNil ifTrue:[
       
  7525 "/        senderSelector := sender selector.
       
  7526 "/        senderReceiver := sender receiver.
       
  7527 "/        senderReceiverClass := senderReceiver class.
       
  7528 "/    ].
       
  7529 "/
       
  7530 "/    (sel == #perform:
       
  7531 "/    or:[sel == #perform:with:
       
  7532 "/    or:[sel == #perform:with:with:
       
  7533 "/    or:[sel == #perform:with:with:with:
       
  7534 "/    or:[sel == #perform:with:with:with:with:
       
  7535 "/    or:[sel == #perform:with:with:with:with:with:
       
  7536 "/    or:[sel == #perform:withArguments:
       
  7537 "/    or:[sel == #perform:with:ifNotUnderstood:
       
  7538 "/    or:[sel == #perform:withArguments:ifNotUnderstood:]]]]]]]])
       
  7539 "/    ifTrue:[
       
  7540 "/        mClass == Object ifTrue:[^ false]
       
  7541 "/    ].
       
  7542 "/
       
  7543 "/    ^ true.
       
  7544 
  7943 
  7545     "Created: / 17-11-2001 / 19:34:20 / cg"
  7944     "Created: / 17-11-2001 / 19:34:20 / cg"
  7546     "Modified: / 27-07-2012 / 17:26:54 / cg"
  7945     "Modified: / 27-07-2012 / 17:26:54 / cg"
  7547 ! !
  7946 ! !
  7548 
  7947 
  7549 !DebugView methodsFor:'private-control loop'!
  7948 !DebugView methodsFor:'private-control loop'!
  7550 
  7949 
  7551 controlLoop
  7950 controlLoop
  7552     "this is a kludge:
  7951     "this is a kludge:
  7553         start a dispatchloop which exits when
  7952 	start a dispatchloop which exits when
  7554         either continue, return or step is pressed
  7953 	either continue, return or step is pressed
  7555     "
  7954     "
  7556 
  7955 
  7557     haveControl := true.
  7956     haveControl := true.
  7558     [
  7957     [
  7559         [haveControl] whileTrue:[
  7958 	[haveControl] whileTrue:[
  7560 AbortOperationRequest handle:[:ex |
  7959 AbortOperationRequest handle:[:ex |
  7561 ] do:[
  7960 ] do:[
  7562             self controlLoopCatchingErrors
  7961 	    self controlLoopCatchingErrors
  7563 ]
  7962 ]
  7564         ].
  7963 	].
  7565     ] ensure:[
  7964     ] ensure:[
  7566         catchBlock := nil.
  7965 	catchBlock := nil.
  7567         haveControl := false
  7966 	haveControl := false
  7568     ].
  7967     ].
  7569 
  7968 
  7570     "Modified: 9.7.1996 / 18:29:09 / cg"
  7969     "Modified: 9.7.1996 / 18:29:09 / cg"
  7571 !
  7970 !
  7572 
  7971 
  7576 
  7975 
  7577     "setup a self removing catch-block"
  7976     "setup a self removing catch-block"
  7578     catchBlock := [catchBlock := nil. ^ nil].
  7977     catchBlock := [catchBlock := nil. ^ nil].
  7579 
  7978 
  7580     (exclusive or:[windowGroup isNil]) ifTrue:[
  7979     (exclusive or:[windowGroup isNil]) ifTrue:[
  7581         "if we do not have multiple processes or its a system process
  7980 	"if we do not have multiple processes or its a system process
  7582          we start another dispatch loop, which exits when
  7981 	 we start another dispatch loop, which exits when
  7583          either continue, return or step is pressed
  7982 	 either continue, return or step is pressed
  7584          or (via the catchBlock) if an error occurs.
  7983 	 or (via the catchBlock) if an error occurs.
  7585          Since our display is an extra exclusive one,
  7984 	 Since our display is an extra exclusive one,
  7586          all processing for normal views stops here ...
  7985 	 all processing for normal views stops here ...
  7587         "
  7986 	"
  7588 
  7987 
  7589         WindowGroup setActiveGroup:windowGroup.
  7988 	WindowGroup setActiveGroup:windowGroup.
  7590         SignalSet anySignal handle:[:ex |
  7989 	SignalSet anySignal handle:[:ex |
  7591             |signal|
  7990 	    |signal|
  7592 
  7991 
  7593             signal := ex creator.
  7992 	    signal := ex creator.
  7594             (UserNotification accepts:signal) ifTrue:[
  7993 	    (UserInterruptSignal accepts:signal) ifTrue:[
       
  7994 Transcript showCR:'UserInterruptSignal'.
       
  7995 		self topView raiseDeiconified.
       
  7996 		ex proceed.
       
  7997 	    ].
       
  7998 
       
  7999 	    (UserNotification accepts:signal) ifTrue:[
  7595 Transcript showCR:'UserNotification'.
  8000 Transcript showCR:'UserNotification'.
  7596                 (signal ~~ ActivityNotificationSignal) ifTrue:[
  8001 		(signal ~~ ActivityNotificationSignal) ifTrue:[
  7597                     self showError:ex description.
  8002 		    self showError:ex description.
  7598                 ].
  8003 		].
  7599                 ex proceed.
  8004 		ex proceed.
  7600             ].
  8005 	    ].
  7601             (HaltInterrupt accepts:signal) ifTrue:[
  8006 	    (HaltInterrupt accepts:signal) ifTrue:[
  7602 Transcript showCR:'HaltInterrupt'.
  8007 Transcript showCR:'HaltInterrupt'.
  7603                 Transcript showCR:'Halt/Break in debugger ignored'.
  8008 		Transcript showCR:'Halt/Break in debugger ignored'.
  7604                 ex proceed.
  8009 		self topView raiseDeiconified.
  7605             ].
  8010 		ex proceed.
  7606 
  8011 	    ].
  7607             self showError:'*** Error in modal debugger:
  8012 
       
  8013 	    self showError:'*** Error in modal debugger:
  7608 
  8014 
  7609 >>>> Signal:  ' , signal printString , '
  8015 >>>> Signal:  ' , signal printString , '
  7610 >>>> In:      ' , ex suspendedContext printString , '
  8016 >>>> In:      ' , ex suspendedContext printString , '
  7611 >>>> From:    ' , ex suspendedContext sender printString , '
  8017 >>>> From:    ' , ex suspendedContext sender printString , '
  7612 >>>>     :    ' , ex suspendedContext sender sender printString , '
  8018 >>>>     :    ' , ex suspendedContext sender sender printString , '
  7623 >>>>     :    ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender printString , '
  8029 >>>>     :    ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender printString , '
  7624 >>>>     :    ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , '
  8030 >>>>     :    ' , ex suspendedContext sender sender sender sender sender sender sender sender sender sender sender sender sender sender printString , '
  7625 >>>> Message: ' , ex description , '
  8031 >>>> Message: ' , ex description , '
  7626 
  8032 
  7627 caught & ignored.'.
  8033 caught & ignored.'.
  7628             ex return.
  8034 	    ex return.
  7629         ] do:[
  8035 	] do:[
  7630 "/            UserNotification handle:[:ex |
  8036 "/            UserNotification handle:[:ex |
  7631 "/                (ex signal == ActivityNotificationSignal) ifTrue:[
  8037 "/                (ex signal == ActivityNotificationSignal) ifTrue:[
  7632 "/                    ex proceed
  8038 "/                    ex proceed
  7633 "/                ].
  8039 "/                ].
  7634 "/                self showError:ex description.
  8040 "/                self showError:ex description.
  7635 "/                ex proceed.
  8041 "/                ex proceed.
  7636 "/            ] do:[
  8042 "/            ] do:[
  7637                 device 
  8043 		self graphicsDevice
  7638                     dispatchModalWhile:[
  8044 		    dispatchModalWhile:[
  7639                         Processor activeProcess state:#debug.
  8045 			Processor activeProcess state:#debug.
  7640                         haveControl].
  8046 			haveControl].
  7641 "/            ]
  8047 "/            ]
  7642         ].
  8048 	].
  7643         WindowGroup setActiveGroup:nil.
  8049 	WindowGroup setActiveGroup:nil.
  7644     ] ifFalse:[
  8050     ] ifFalse:[
  7645         "we do have multiple processes -
  8051 	"we do have multiple processes -
  7646          simply enter the DebugViews-Windowgroup event loop.
  8052 	 simply enter the DebugViews-Windowgroup event loop.
  7647          effectively suspending event processing for the currently
  8053 	 effectively suspending event processing for the currently
  7648          active group.
  8054 	 active group.
  7649         "
  8055 	"
  7650         SignalSet anySignal handle:[:ex |
  8056 	SignalSet anySignal handle:[:ex |
  7651             |answer signal eMsg|
  8057 	    |answer signal eMsg|
  7652 
  8058 
  7653             signal := ex creator.
  8059 	    signal := ex creator.
  7654 
  8060 
  7655             DebuggingDebugger ~~ true ifTrue:[
  8061 	    DebuggingDebugger ~~ true ifTrue:[
  7656                 (signal == ActivityNotification) ifTrue:[
  8062 		(signal == ActivityNotification) ifTrue:[
  7657                     ex proceed
  8063 		    ex proceed
  7658                 ].
  8064 		].
  7659                 "/
  8065 		"/
  7660                 "/ ignore exceptions which say they explicitly have to be ignored
  8066 		"/ ignore exceptions which say they explicitly have to be ignored
  7661                 "/
  8067 		"/
  7662                 ex catchInDebugger ifTrue:[
  8068 		ex catchInDebugger ifTrue:[
  7663                     'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR.
  8069 		    'DebugView [info]: ',signal printString,'-signal in debugger caught for close' infoPrintCR.
  7664                     self destroy.
  8070 		    self destroy.
  7665                     ex reject
  8071 		    ex reject
  7666                 ].
  8072 		].
  7667 
  8073 
  7668                 "/
  8074 		"/
  7669                 "/ ignore recursive breakpoints
  8075 		"/ ignore recursive breakpoints
  7670                 "/
  8076 		"/
  7671                 (signal isControlInterrupt) ifTrue:[
  8077 		(signal isControlInterrupt) ifTrue:[
  7672                     ignoreBreakpoints == true ifTrue:[
  8078 		    ignoreBreakpoints == true ifTrue:[
  7673                         'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR.
  8079 			'DebugView [info]: halt/break in debugger ignored 1' infoPrintCR.
  7674                         ('DebugView [info]: ',ex suspendedContext printString) infoPrintCR.
  8080 			('DebugView [info]: ',ex suspendedContext printString) infoPrintCR.
  7675                         ex proceed
  8081 			self topView raiseDeiconified.
  7676                     ].
  8082 			ex proceed
  7677                 ].
  8083 		    ].
  7678                 (signal == TerminateProcessRequest) ifTrue:[
  8084 		].
  7679                     "/ mhm - someone wants to shoot me down while debugging ...
  8085 		(signal == TerminateProcessRequest) ifTrue:[
  7680                     answer := Dialog
  8086 		    "/ mhm - someone wants to shoot me down while debugging ...
  7681                                 choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs
  8087 		    answer := Dialog
  7682                                 labels:#( 'Ignore' 'Close & terminate' )
  8088 				choose:('Process termination signal arrived while debugging\\close debugger ?') withCRs
  7683                                 values:#( #proceed #close )
  8089 				labels:#( 'Ignore' 'Close & terminate' )
  7684                                 default:#close.
  8090 				values:#( #proceed #close )
  7685                     answer == #close ifTrue:[
  8091 				default:#close.
  7686                         self destroy.
  8092 		    answer == #close ifTrue:[
  7687                         ex reject
  8093 			self destroy.
  7688                     ].
  8094 			ex reject
  7689                     ex return.
  8095 		    ].
  7690                 ].
  8096 		    ex return.
  7691                 signal == RecursiveExceptionError ifTrue:[
  8097 		].
  7692                     (ex exception creator == BreakPointInterrupt)
  8098 		signal == RecursiveExceptionError ifTrue:[
  7693                     ifTrue:[
  8099 		    (ex exception creator == BreakPointInterrupt)
  7694                         'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR.
  8100 		    ifTrue:[
  7695                         ex proceed.
  8101 			'DebugView [info]: recursive breakpoint in debugger ignored' infoPrintCR.
  7696                     ].
  8102 			ex proceed.
  7697 
  8103 		    ].
  7698                     self showError:'*** Recursive error in debugger:
  8104 
       
  8105 		    self showError:'*** Recursive error in debugger:
  7699 
  8106 
  7700 >>>> Signal:  ' , ex creator printString , '
  8107 >>>> Signal:  ' , ex creator printString , '
  7701 >>>>          ' , ex parameter creator printString , '
  8108 >>>>          ' , ex parameter creator printString , '
  7702 >>>> In:      ' , ex suspendedContext printString , '
  8109 >>>> In:      ' , ex suspendedContext printString , '
  7703 >>>> From:    ' , ex suspendedContext sender printString , '
  8110 >>>> From:    ' , ex suspendedContext sender printString , '
  7705 >>>>     :    ' , ex suspendedContext sender sender sender printString , '
  8112 >>>>     :    ' , ex suspendedContext sender sender sender printString , '
  7706 >>>>     :    ' , ex suspendedContext sender sender sender sender printString , '
  8113 >>>>     :    ' , ex suspendedContext sender sender sender sender printString , '
  7707 >>>> Message: ' , ex description , '
  8114 >>>> Message: ' , ex description , '
  7708 
  8115 
  7709 caught & ignored.'.
  8116 caught & ignored.'.
  7710                     ex return
  8117 		    ex return
  7711                 ].
  8118 		].
  7712             ].
  8119 	    ].
  7713 
  8120 
  7714             self topView raiseDeiconified.
  8121 	    self topView raiseDeiconified.
  7715 
  8122 
  7716             eMsg := ex description.
  8123 	    eMsg := ex description.
  7717             (signal isControlInterrupt) ifTrue:[
  8124 	    (signal isControlInterrupt) ifTrue:[
  7718                 eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString
  8125 		eMsg := eMsg , Character cr asString , 'in ' , ex suspendedContext printString
  7719             ].
  8126 	    ].
  7720             Dialog aboutToOpenBoxNotificationSignal
  8127 	    Dialog aboutToOpenBoxNotificationSignal
  7721                 handle:[:ex | ex proceed ]
  8128 		handle:[:ex | ex proceed ]
  7722                 do:[
  8129 		do:[
  7723                     answer := Dialog
  8130 		    answer := Dialog
  7724                         choose:('Error in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs)
  8131 			choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs)
  7725                         labels:#( 'Proceed' 'Cancel' 'Debug' )
  8132 			labels:#( 'Proceed' 'Cancel' 'Debug' )
  7726                         values:#( #proceed #cancel #debug )
  8133 			values:#( #proceed #cancel #debug )
  7727                         default:#cancel.
  8134 			default:#cancel.
  7728                 ].
  8135 		].
  7729             answer == #debug ifTrue:[
  8136 	    answer == #debug ifTrue:[
  7730                 'DebugView [info]: caught exception - debugging' infoPrintCR.
  8137 		'DebugView [info]: caught exception - debugging' infoPrintCR.
  7731                 Debugger
  8138 		Debugger
  7732                     enterUnconditional:(ex suspendedContext)
  8139 		    enterUnconditional:(ex suspendedContext)
  7733                     withMessage:'Error in debugger: ' , eMsg
  8140 		    withMessage:(ex creator class name,' in debugger: ' , eMsg)
  7734                     mayProceed:true.
  8141 		    mayProceed:true.
  7735                 ex proceed.
  8142 		ex proceed.
  7736             ].
  8143 	    ].
  7737             answer == #proceed ifTrue:[
  8144 	    answer == #proceed ifTrue:[
  7738                 'DebugView [info]: ignored exception - proceeding' infoPrintCR.
  8145 		'DebugView [info]: ignored exception - proceeding' infoPrintCR.
  7739                 ex proceed.
  8146 		ex proceed.
  7740             ].
  8147 	    ].
  7741             'DebugView [info]: caught exception - returning' infoPrintCR.
  8148 	    'DebugView [info]: caught exception - returning' infoPrintCR.
  7742             ex return.
  8149 	    ex return.
  7743         ] do:[
  8150 	] do:[
  7744             "/ make certain that sub-debuggers, inspectors etc.
  8151 	    "/ make certain that sub-debuggers, inspectors etc.
  7745             "/ come up on my device.
  8152 	    "/ come up on my device.
  7746             Screen currentScreenQuerySignal answer:device
  8153 	    Screen currentScreenQuerySignal answer:self graphicsDevice
  7747             do:[
  8154 	    do:[
  7748                 Dialog aboutToOpenBoxNotificationSignal
  8155 		Dialog aboutToOpenBoxNotificationSignal
  7749                     handle:[:ex | ex proceed ]
  8156 		    handle:[:ex | ex proceed ]
  7750                     do:[
  8157 		    do:[
  7751                         windowGroup
  8158 			windowGroup
  7752                             eventLoopWhile:[Processor activeProcess state:#debug.
  8159 			    eventLoopWhile:[Processor activeProcess state:#debug.
  7753                                               true]
  8160 					      true]
  7754                             onLeave:[]
  8161 			    onLeave:[]
  7755                     ]
  8162 		    ]
  7756             ]
  8163 	    ]
  7757         ].
  8164 	].
  7758     ].
  8165     ].
  7759     catchBlock := nil.
  8166     catchBlock := nil.
  7760 
  8167 
  7761     "Created: / 24-11-1995 / 20:33:45 / cg"
  8168     "Created: / 24-11-1995 / 20:33:45 / cg"
  7762     "Modified: / 26-09-2012 / 15:03:39 / cg"
  8169     "Modified: / 26-09-2012 / 15:03:39 / cg"
  7770     |mthd app heuristic selector|
  8177     |mthd app heuristic selector|
  7771 
  8178 
  7772     classToDefineIn := selectorToDefine := nil.    "/ sorry - left as info to define action
  8179     classToDefineIn := selectorToDefine := nil.    "/ sorry - left as info to define action
  7773 
  8180 
  7774     callee notNil ifTrue:[
  8181     callee notNil ifTrue:[
  7775         "/ clicked on an unimplemented method ?
  8182 	"/ clicked on an unimplemented method ?
  7776         callee sender notNil ifTrue:[
  8183 	callee sender notNil ifTrue:[
  7777             mthd := callee sender method.
  8184 	    mthd := callee sender method.
  7778             mthd isNil ifTrue:[
  8185 	    mthd isNil ifTrue:[
  7779                 callee sender isBlockContext ifFalse:[
  8186 		callee sender isBlockContext ifFalse:[
  7780                     "/ an unimplemented method
  8187 		    "/ an unimplemented method
  7781                     selector := callee sender selector.
  8188 		    selector := callee sender selector.
  7782                     (callee sender receiver class canUnderstand:selector) ifFalse:[
  8189 		    (callee sender receiver class canUnderstand:selector) ifFalse:[
  7783                         classToDefineIn := callee sender receiver class.
  8190 			classToDefineIn := callee sender receiver class.
  7784                         selectorToDefine := selector.
  8191 			selectorToDefine := selector.
  7785                         ^ true
  8192 			^ true
  7786                     ]
  8193 		    ]
  7787                 ]
  8194 		]
  7788             ].
  8195 	    ].
  7789         ].
  8196 	].
  7790 
  8197 
  7791         mthd := callee method.
  8198 	mthd := callee method.
  7792         mthd notNil ifTrue:[
  8199 	mthd notNil ifTrue:[
  7793             (mthd selector == #subclassResponsibility) ifTrue:[
  8200 	    (mthd selector == #subclassResponsibility) ifTrue:[
  7794                 classToDefineIn := callee sender receiver class.
  8201 		classToDefineIn := callee sender receiver class.
  7795                 selectorToDefine := callee sender selector.
  8202 		selectorToDefine := callee sender selector.
  7796                 ^ true.
  8203 		^ true.
  7797             ].
  8204 	    ].
  7798 
  8205 
  7799             "/ that's a big hack, but I am tired of navigating to find the missing menu message...
  8206 	    "/ that's a big hack, but I am tired of navigating to find the missing menu message...
  7800             "/ you will thank me!!
  8207 	    "/ you will thank me!!
  7801             mthd selector == #error:mayProceed: ifTrue:[
  8208 	    mthd selector == #error:mayProceed: ifTrue:[
  7802                 (callee receiver isKindOf:MenuPanel) ifTrue:[
  8209 		(callee receiver isKindOf:MenuPanel) ifTrue:[
  7803                     callee sender home notNil ifTrue:[
  8210 		    callee sender home notNil ifTrue:[
  7804                         (callee sender home selector startsWith:'accept:') ifTrue:[
  8211 			(callee sender home selector startsWith:'accept:') ifTrue:[
  7805                             (inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[
  8212 			    (inspectedProcess notNil and:[inspectedProcess isGUIProcess]) ifTrue:[
  7806                                 (app := self processesApplication) notNil ifTrue:[
  8213 				(app := self processesApplication) notNil ifTrue:[
  7807                                     heuristic := callee sender home argsAndVars select:[:o | o isSymbol].
  8214 				    heuristic := callee sender home argsAndVars select:[:o | o isSymbol].
  7808                                     heuristic size == 1 ifTrue:[
  8215 				    heuristic size == 1 ifTrue:[
  7809                                         classToDefineIn := app class.
  8216 					classToDefineIn := app class.
  7810                                         selectorToDefine := heuristic first.    
  8217 					selectorToDefine := heuristic first.
  7811                                         ^ true
  8218 					^ true
  7812                                     ].
  8219 				    ].
  7813                                 ].
  8220 				].
  7814                             ].
  8221 			    ].
  7815                         ].
  8222 			].
  7816                     ].
  8223 		    ].
  7817                 ].
  8224 		].
  7818             ]
  8225 	    ]
  7819         ]
  8226 	]
  7820     ].
  8227     ].
  7821     ^ false
  8228     ^ false
  7822 !
  8229 !
  7823 
  8230 
  7824 showingAlreadyModifiedCode
  8231 showingAlreadyModifiedCode
  7832     |source|
  8239     |source|
  7833 
  8240 
  7834     codeView modified ifFalse:[^ false].
  8241     codeView modified ifFalse:[^ false].
  7835 
  8242 
  7836     currentMethod isNil ifTrue:[
  8243     currentMethod isNil ifTrue:[
  7837         ^ false
  8244 	^ false
  7838     ].
  8245     ].
  7839     source := currentMethod source.
  8246     source := currentMethod source.
  7840     source notNil ifTrue:[
  8247     source notNil ifTrue:[
  7841         source string = codeView contents string ifTrue:[
  8248 	source string = codeView contents string ifTrue:[
  7842             ^ false
  8249 	    ^ false
  7843         ].
  8250 	].
  7844         (source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[
  8251 	(source string withTabsExpanded:8) = (codeView contents string withTabsExpanded:8) ifTrue:[
  7845             ^ false
  8252 	    ^ false
  7846         ].
  8253 	].
  7847     ].
  8254     ].
  7848     ^ true
  8255     ^ true
  7849 !
  8256 !
  7850 
  8257 
  7851 checkSelectionChangeAllowed
  8258 checkSelectionChangeAllowed
  7857 
  8264 
  7858     self checkIfCodeIsReallyModified ifFalse:[^ true].
  8265     self checkIfCodeIsReallyModified ifFalse:[^ true].
  7859 
  8266 
  7860     (newSelection notNil
  8267     (newSelection notNil
  7861     and:[newSelection = contextView selection]) ifTrue:[
  8268     and:[newSelection = contextView selection]) ifTrue:[
  7862         ^ true
  8269 	^ true
  7863     ].
  8270     ].
  7864 
  8271 
  7865     answer := Dialog 
  8272     answer := Dialog
  7866                 confirmWithCancel:('Code modified - change selection anyway ?')
  8273 		confirmWithCancel:('Code modified - change selection anyway ?')
  7867                 labels:#('No' 'No, Show Diffs' 'Yes').
  8274 		labels:#('No' 'No, Show Diffs' 'Yes').
  7868     answer isNil ifTrue:[^ false].
  8275     answer isNil ifTrue:[^ false].
  7869     answer == false ifTrue:[
  8276     answer == false ifTrue:[
  7870         v := DiffCodeView
  8277 	v := DiffCodeView
  7871                 openOn:codeView contents
  8278 		openOn:codeView contents
  7872                 label:(resources string:'Changed code (to be accepted ?)')
  8279 		label:(resources string:'Changed code (to be accepted ?)')
  7873                 and:currentMethod source
  8280 		and:currentMethod source
  7874                 label:(resources string:'Method''s actual (maybe original) code').
  8281 		label:(resources string:'Method''s actual (maybe original) code').
  7875         v label:(resources string:'Comparing method''s code').
  8282 	v label:(resources string:'Comparing method''s code').
  7876         v waitUntilVisible.
  8283 	v waitUntilVisible.
  7877         ^ false 
  8284 	^ false
  7878     ].
  8285     ].
  7879 
  8286 
  7880     codeView modified:false.
  8287     codeView modified:false.
  7881     ^ true
  8288     ^ true
  7882 !
  8289 !
  7883 
  8290 
  7884 codeAccept:someCode
  8291 codeAccept:someCode
  7885     "user wants some code to be recompiled"
  8292     "user wants some code to be recompiled"
  7886 
  8293 
  7887     ^ self codeAccept:someCode unwind:false category:nil onCancel:nil
  8294     ParseError handle:[:ex |
       
  8295 	ex lineNumber notNil ifTrue:[
       
  8296 	    codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition.
       
  8297 	].
       
  8298 	Dialog information:ex description.
       
  8299 "/            ParseError new
       
  8300 "/                errorMessage:aMessage startPosition:position endPosition:endPos;
       
  8301 "/                parameter:self;
       
  8302 "/                lineNumber:tokenLineNr; "lineNr"
       
  8303 "/                raiseRequest.
       
  8304     ] do:[
       
  8305 	^ self codeAccept:someCode unwind:false category:nil onCancel:nil
       
  8306     ].
  7888 
  8307 
  7889     "Modified: / 28-11-2006 / 19:49:04 / cg"
  8308     "Modified: / 28-11-2006 / 19:49:04 / cg"
  7890 !
  8309 !
  7891 
  8310 
  7892 codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction
  8311 codeAccept:someCode inClass:aClass unwind:doUnwind category:category onCancel:cancelAction
  7893     "user wants some code to be recompiled.
  8312     "user wants some code to be recompiled.
  7894      Optionally unwind stack to right above the changed method.
  8313      Optionally unwind stack to right above the changed method.
  7895      This undwind option is a leftover from times, when the debugger had no chance to
  8314      This undwind option is a leftover from times, when the debugger had no chance to
  7896      show the original code. 
  8315      show the original code.
  7897      Now, it can, and got a choice-field to select between original and changed code. 
  8316      Now, it can, and got a choice-field to select between original and changed code.
  7898      So the undwind option is not longer used and probably completely obsolete now 
  8317      So the undwind option is not longer used and probably completely obsolete now
  7899      (aka: this method is always called with doUnwind==false, these days)"
  8318      (aka: this method is always called with doUnwind==false, these days)"
  7900 
  8319 
  7901     |con newMethod|
  8320     |con newMethod|
  7902 
  8321 
  7903     codeView withWaitCursorDo:[
  8322     codeView withWaitCursorDo:[
  7904         "
  8323 	"
  7905          find the method-home context for this one
  8324 	 find the method-home context for this one
  7906         "
  8325 	"
  7907         doUnwind ifTrue:[
  8326 	doUnwind ifTrue:[
  7908             con := selectedContext.
  8327 	    con := selectedContext.
  7909             top := con.
  8328 	    top := con.
  7910             [con notNil] whileTrue:[
  8329 	    [con notNil] whileTrue:[
  7911                 (con methodHome == selectedContext) ifTrue:[
  8330 		(con methodHome == selectedContext) ifTrue:[
  7912                     top := con
  8331 		    top := con
  7913                 ].
  8332 		].
  7914                 con := con sender
  8333 		con := con sender
  7915             ].
  8334 	    ].
  7916         ].
  8335 	].
  7917 
  8336 
  7918         "/
  8337 	"/
  7919         "/ provide the classes nameSpace and changefile-update answers;
  8338 	"/ provide the classes nameSpace and changefile-update answers;
  7920         "/ in case we accept while in another context, to not capture these settings again
  8339 	"/ in case we accept while in another context, to not capture these settings again
  7921         "/
  8340 	"/
  7922         (Class updateChangeFileQuerySignal,
  8341 	(Class updateChangeFileQuerySignal,
  7923          Class updateChangeListQuerySignal,
  8342 	 Class updateChangeListQuerySignal,
  7924          Class updateHistoryLineQuerySignal) answer:true
  8343 	 Class updateHistoryLineQuerySignal) answer:true
  7925         do:[
  8344 	do:[
  7926             Class nameSpaceQuerySignal answer:(aClass nameSpace)
  8345 	    Class nameSpaceQuerySignal answer:(aClass nameSpace)
  7927             do:[
  8346 	    do:[
  7928                 "/ the compiler nowadays already cares for the package...
  8347 		"/ the compiler nowadays already cares for the package...
  7929                 "/ no, actually, it does not in case we are in the middle of a fileIn,
  8348 		"/ no, actually, it does not in case we are in the middle of a fileIn,
  7930                 "/ and packageQuery is already answered by someone else.
  8349 		"/ and packageQuery is already answered by someone else.
  7931                 "/ Better make it unpackaged, in case the user makes changes to other
  8350 		"/ Better make it unpackaged, in case the user makes changes to other
  7932                 "/ classes here (actually, I often change compiler, debugger, inspector here)
  8351 		"/ classes here (actually, I often change compiler, debugger, inspector here)
  7933                 Class packageQuerySignal
  8352 		Class packageQuerySignal
  7934                 answer:nil
  8353 		answer:nil
  7935                 do:[
  8354 		do:[
  7936                     codeView contents:someCode.
  8355 		    codeView contents:someCode.
  7937                     Class methodRedefinitionNotification 
  8356 		    Class methodRedefinitionNotification
  7938                         answer:#keep    
  8357 			answer:#keep
  7939                         do:[
  8358 			do:[
  7940                             "/ Use original method's programming language instead of class's one.
  8359 			    | breakpoints |
  7941                             "/ In most cases it's the same, but it may be that the method edited
  8360 
  7942                             "/ and accepted was an extension method written in another languages
  8361 			    breakpoints := nil.
  7943                             "/ (such as Smalltalk extension to Java class or Ruby extension to
  8362 			    codeView isCodeView2 ifTrue:[
  7944                             "/ Smalltalk class.
  8363 				breakpoints := codeView breakpoints.
  7945                             newMethod := selectedContext programmingLanguage compilerClass
  8364 			    ].
  7946                                              compile:someCode
  8365 
  7947                                              forClass:aClass
  8366 			    BreakpointQuery answer: breakpoints do:[
  7948                                              inCategory:category
  8367 				"/ Use original method's programming language instead of class's one.
  7949                                              notifying:codeView.
  8368 				"/ In most cases it's the same, but it may be that the method edited
  7950                         ].
  8369 				"/ and accepted was an extension method written in another languages
  7951                 ].
  8370 				"/ (such as Smalltalk extension to Java class or Ruby extension to
  7952             ].
  8371 				"/ Smalltalk class.
  7953         ].
  8372 				newMethod := selectedContext programmingLanguage compilerClassForInteractiveTools
  7954 
  8373 						 compile:someCode
  7955         methodCodeToggleSelectionHolder value:2.    "/ showing current code
  8374 						 forClass:aClass
  7956         methodCodeToggle beVisible.
  8375 						 inCategory:category
  7957 
  8376 						 notifying:codeView.
  7958         inspecting ifFalse:[
  8377 				"/ Kludge for accepting Java code in a debugger. The Java compiler
  7959             (newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[
  8378 				"/ does not compile single classes by always a full class and returns
  7960                 codeView modified:false.
  8379 				"/ the compiled class(es) rather than a method. However, we need to update
  7961 
  8380 				"/ method holder of a codeView.
  7962                 doUnwind ifTrue:[
  8381 				"/
  7963                     "/ if it worked, and doUnwind is true,
  8382 				"/ So, here we check whether the retuned `newMethod` is really a method,
  7964                     "/ remove everything up to and including top
  8383 				"/ if it's a class, try to search that class for a method with the
  7965                     "/ from the context chain
  8384 				"/ same selector as selector of currently selected context. If found,
  7966 
  8385 				"/ thet's the 'new' method we are going to show.
  7967                     selectedContext canReturn ifTrue:[
  8386 				newMethod isBehavior ifTrue:[
  7968                         self setContext:(top "sender").
  8387 				    | selector |
  7969                         exitAction := #restart.
  8388 
  7970                         selectedContext setLineNumber:1.
  8389 				    selector := selectedContext selector.
  7971                         self doRestart.
  8390 				    newMethod := newMethod"actually a class" compiledMethodAt: selector ifAbsent: nil.
  7972                     ] ifFalse:[
  8391 				].
  7973                         self setContext:(top sender).
  8392 			    ].
  7974                         exitAction := #return.
  8393 			].
  7975                     ].
  8394 		].
  7976                 ].
  8395 	    ].
  7977             ] ifFalse:[
  8396 	].
  7978                 ^ cancelAction value
  8397 
  7979             ]
  8398 	methodCodeToggleSelectionHolder value:2.    "/ showing current code
  7980         ].
  8399 	methodCodeToggle beVisible.
       
  8400 
       
  8401 	inspecting ifFalse:[
       
  8402 	    (newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[
       
  8403 		codeView modified:false.
       
  8404 		codeView isCodeView2 ifTrue:[
       
  8405 		    codeView methodHolder value: newMethod.
       
  8406 		].
       
  8407 
       
  8408 		doUnwind ifTrue:[
       
  8409 		    "/ if it worked, and doUnwind is true,
       
  8410 		    "/ remove everything up to and including top
       
  8411 		    "/ from the context chain
       
  8412 
       
  8413 		    selectedContext canReturn ifTrue:[
       
  8414 			self setContext:(top "sender").
       
  8415 			exitAction := #restart.
       
  8416 			selectedContext setLineNumber:1.
       
  8417 			self doRestart.
       
  8418 		    ] ifFalse:[
       
  8419 			self setContext:(top sender).
       
  8420 			exitAction := #return.
       
  8421 		    ].
       
  8422 		].
       
  8423 	    ] ifFalse:[
       
  8424 		^ cancelAction value
       
  8425 	    ]
       
  8426 	].
  7981     ].
  8427     ].
  7982 
  8428 
  7983     "Created: / 17-11-2001 / 21:50:55 / cg"
  8429     "Created: / 17-11-2001 / 21:50:55 / cg"
  7984     "Modified: / 29-08-2006 / 14:22:22 / cg"
  8430     "Modified: / 29-08-2006 / 14:22:22 / cg"
  7985     "Modified: / 28-11-2013 / 22:58:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  8431     "Modified: / 17-08-2014 / 11:44:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  7986 !
  8432 !
  7987 
  8433 
  7988 codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction
  8434 codeAccept:someCode unwind:doUnwind category:givenCategoryOrNil onCancel:cancelAction
  7989     "user wants some code to be recompiled"
  8435     "user wants some code to be recompiled"
  7990 
  8436 
  8001 "/                top := con
  8447 "/                top := con
  8002 "/            ].
  8448 "/            ].
  8003 "/            con := con sender
  8449 "/            con := con sender
  8004 "/        ].
  8450 "/        ].
  8005 
  8451 
  8006         "
  8452 	"
  8007          use class&selector to find the method for the compilation
  8453 	 use class&selector to find the method for the compilation
  8008          and compile.
  8454 	 and compile.
  8009         "
  8455 	"
  8010         category := givenCategoryOrNil.
  8456 	category := givenCategoryOrNil.
  8011         sel := selectedContext selector.
  8457 	sel := selectedContext selector.
  8012         implementorClass := selectedContext methodClass.
  8458 	implementorClass := selectedContext methodClass.
  8013         implementorClass isNil ifTrue:[
  8459 	method := selectedContext method.
  8014             method := selectedContext method.
  8460 
  8015             (method notNil and:[method mclass isNil]) ifTrue:[
  8461 	implementorClass isNil ifTrue:[
  8016                 method := method wrapper.
  8462 	    (method notNil and:[method mclass isNil and:[method wrapper notNil]]) ifTrue:[
  8017             ].
  8463 		method := method wrapper.
  8018             method notNil ifTrue:[
  8464 	    ].
  8019                 implementorClass := method mclass
  8465 	    method notNil ifTrue:[
  8020             ].
  8466 		implementorClass := method mclass.
  8021         ] ifFalse:[
  8467 		implementorClass isNil ifTrue:[
  8022             method := selectedContext method.
  8468 		    implementorClass := method getMclass
  8023         ].
  8469 		].
  8024         implementorClass notNil ifTrue:[
  8470 	    ].
  8025             category isNil ifTrue:[
  8471 	].
  8026                 method isNil ifTrue:[
  8472 	implementorClass notNil ifTrue:[
  8027                     method := implementorClass compiledMethodAt:sel.
  8473 	    category isNil ifTrue:[
  8028                 ].
  8474 		method isNil ifTrue:[
  8029                 category := method category
  8475 		    method := implementorClass compiledMethodAt:sel.
  8030             ]
  8476 		].
  8031         ] ifFalse:[
  8477 		category := method category
  8032             receiverClass := selectedContext receiver class.
  8478 	    ]
  8033             implementorClass := receiverClass whichClassImplements:sel.
  8479 	] ifFalse:[
  8034             implementorClass := implementorClass ? receiverClass.
  8480 	    receiverClass := selectedContext receiver class.
  8035             implementorClass ~~ Object ifTrue:[
  8481 	    implementorClass := receiverClass whichClassImplements:sel.
  8036                 implementorClass := Dialog
  8482 	    implementorClass := implementorClass ? receiverClass.
  8037                                         request:('Define ''%1'' in class:' bindWith:sel allBold)
  8483 	    implementorClass ~~ Object ifTrue:[
  8038                                         initialAnswer:implementorClass name
  8484 		implementorClass := Dialog
  8039                                         list:(implementorClass withAllSuperclasses collect:[:each| each name]).
  8485 					request:('Define ''%1'' in class:' bindWith:sel allBold)
  8040                 implementorClass size == 0 ifTrue:[
  8486 					initialAnswer:implementorClass name
  8041                     ^ cancelAction value "/ cancelled
  8487 					list:(implementorClass withAllSuperclasses collect:[:each| each name]).
  8042                 ].
  8488 		implementorClass size == 0 ifTrue:[
  8043                 implementorClass := Smalltalk classNamed:implementorClass.
  8489 		    ^ cancelAction value "/ cancelled
  8044                 implementorClass isNil ifTrue:[
  8490 		].
  8045                     Dialog warn:'No such class'.
  8491 		implementorClass := Smalltalk classNamed:implementorClass.
  8046                     ^ cancelAction value "/ cancelled
  8492 		implementorClass isNil ifTrue:[
  8047                 ].
  8493 		    Dialog warn:'No such class'.
  8048             ].
  8494 		    ^ cancelAction value "/ cancelled
  8049         ].
  8495 		].
  8050 
  8496 	    ].
  8051         self
  8497 	].
  8052             codeAccept:someCode
  8498 
  8053             inClass:implementorClass
  8499 	self
  8054             unwind:doUnwind
  8500 	    codeAccept:someCode
  8055             category:category
  8501 	    inClass:implementorClass
  8056             onCancel:cancelAction.
  8502 	    unwind:doUnwind
       
  8503 	    category:category
       
  8504 	    onCancel:cancelAction.
  8057     ].
  8505     ].
  8058 
  8506 
  8059     "Created: / 17-11-2001 / 21:50:55 / cg"
  8507     "Created: / 17-11-2001 / 21:50:55 / cg"
  8060     "Modified: / 29-08-2006 / 14:22:22 / cg"
  8508     "Modified: / 29-08-2006 / 14:22:22 / cg"
  8061 !
  8509 !
  8062 
  8510 
  8063 codeCompletion
  8511 codeCompletion
  8064     |cls|
  8512     "/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell?
       
  8513     "/ (can we move that to a utility - probably DoWhatIMeanSupport)
       
  8514 
       
  8515     |cls language|
  8065 
  8516 
  8066     currentMethod isNil ifTrue:[ ^ self ].
  8517     currentMethod isNil ifTrue:[ ^ self ].
  8067 
  8518 
  8068     cls := currentMethod mclass.
  8519     cls := currentMethod mclass.
  8069     cls isNil ifTrue:[ ^ self ].
  8520     cls notNil ifTrue:[
       
  8521 	language := cls programmingLanguage.
       
  8522     ].
  8070 
  8523 
  8071     UserInformation handle:[:ex |
  8524     UserInformation handle:[:ex |
  8072         ex proceed.
  8525 	ex proceed.
  8073     ] do:[
  8526     ] do:[
  8074         DoWhatIMeanSupport codeCompletionForLanguage: cls programmingLanguage class:cls context:selectedContext codeView:codeView.
  8527 	DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:selectedContext codeView:codeView.
  8075     ].
  8528     ].
  8076 
  8529 
  8077     "Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  8530     "Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  8078 !
  8531 !
  8079 
  8532 
  8080 confirm:aString
  8533 confirm:aString
  8081     "open a modal yes-no dialog.
  8534     "open a modal yes-no dialog.
  8082      Redefined here, to answer true, if exclusice Debugger, which cannot handle popup boxes"
  8535      Redefined here, to answer true, if exclusice Debugger, which cannot handle popup boxes"
  8083 
  8536 
  8084     (exclusive or:[windowGroup isNil]) ifTrue:[
  8537     (exclusive or:[windowGroup isNil]) ifTrue:[
  8085         ^ true
  8538 	^ true
  8086     ].
  8539     ].
  8087     ^ super confirm:aString.
  8540     ^ super confirm:aString.
  8088 !
  8541 !
  8089 
  8542 
  8090 doShowSelection:lineNr
  8543 doShowSelection:lineNr
  8091     "user clicked on a header line - show selected code in textView.
  8544     "user clicked on a header line - show selected code in textView.
  8092      Also sent to autoselect an interesting context on entry."
  8545      Also sent to autoselect an interesting context on entry."
  8093 
  8546 
  8094     HaltInterrupt handle:[:ex |
  8547     HaltInterrupt handle:[:ex |
  8095         ignoreBreakpoints ifFalse:[ex reject].
  8548 	ignoreBreakpoints ifFalse:[ex reject].
  8096         ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR.
  8549 	('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR.
  8097         ex proceed
  8550 	ex proceed
  8098     ] do:[
  8551     ] do:[
  8099         self updateForContext:lineNr
  8552 	self updateForContext:lineNr
  8100     ].
  8553     ].
  8101     self updateMenuItems
  8554     self updateMenuItems
  8102 
  8555 
  8103     "Modified: / 17.11.2001 / 22:12:16 / cg"
  8556     "Modified: / 17.11.2001 / 22:12:16 / cg"
  8104 !
  8557 !
  8105 
  8558 
  8106 hideStackInspector
  8559 hideStackInspector
  8107     stackInspector notNil ifTrue:[
  8560     stackInspector notNil ifTrue:[
  8108         stackInspector destroy.
  8561 	stackInspector destroy.
  8109         stackInspector := nil.
  8562 	stackInspector := nil.
  8110         receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0.
  8563 	receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0.
  8111         contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  8564 	contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  8112     ]
  8565     ]
  8113 !
  8566 !
  8114 
  8567 
  8115 methodCodeToggleChanged
  8568 methodCodeToggleChanged
  8116     |sel|
  8569     |sel|
  8117 
  8570 
  8118     sel := contextView selection.
  8571     sel := contextView selection.
  8119     sel notNil ifTrue:[
  8572     sel notNil ifTrue:[
  8120         self showSelection:sel
  8573 	self showSelection:sel
  8121     ]
  8574     ]
  8122 
  8575 
  8123     "Created: / 18-06-2010 / 12:29:21 / cg"
  8576     "Created: / 18-06-2010 / 12:29:21 / cg"
  8124 !
  8577 !
  8125 
  8578 
  8131 
  8584 
  8132     |evView focusView key rawKey inCodeView|
  8585     |evView focusView key rawKey inCodeView|
  8133 
  8586 
  8134     evView := anEvent view.
  8587     evView := anEvent view.
  8135     evView notNil ifTrue:[
  8588     evView notNil ifTrue:[
  8136         focusView := evView windowGroup focusView.
  8589 	focusView := evView windowGroup focusView.
  8137         focusView isNil ifTrue:[
  8590 	focusView isNil ifTrue:[
  8138             focusView := evView.
  8591 	    focusView := evView.
  8139         ].
  8592 	].
  8140 
  8593 
  8141         anEvent isKeyPressEvent ifTrue:[
  8594 	anEvent isKeyPressEvent ifTrue:[
  8142             key := anEvent key.
  8595 	    key := anEvent key.
  8143             rawKey := anEvent rawKey.
  8596 	    rawKey := anEvent rawKey.
  8144 
  8597 
  8145             inCodeView := (focusView == codeView
  8598 	    inCodeView := (focusView == codeView
  8146                           or:[focusView isComponentOf:codeView]).
  8599 			  or:[focusView isComponentOf:codeView]).
  8147             inCodeView ifTrue:[
  8600 	    inCodeView ifTrue:[
  8148                 key == #CodeCompletion ifTrue:[
  8601 		key == #CodeCompletion ifTrue:[
  8149                     "/ complete the word before/under the cursor.
  8602 		    "/ complete the word before/under the cursor.
  8150                     self sensor
  8603 		    self sensor
  8151                         pushUserEvent:#codeCompletion
  8604 			pushUserEvent:#codeCompletion
  8152                         for:self
  8605 			for:self
  8153                         withArguments:#().
  8606 			withArguments:#().
  8154                     ^ true
  8607 		    ^ true
  8155                 ].
  8608 		].
  8156             ].
  8609 	    ].
  8157         ].
  8610 	].
  8158 
  8611 
  8159 false ifTrue:[
  8612 false ifTrue:[
  8160         anEvent isButtonReleaseEvent ifTrue:[
  8613 	anEvent isButtonReleaseEvent ifTrue:[
  8161             anEvent view == codeView ifTrue:[
  8614 	    anEvent view == codeView ifTrue:[
  8162                 (RBParser notNil and:[RBParser isLoaded])
  8615 		(RBParser notNil and:[RBParser isLoaded])
  8163                 ifTrue:[
  8616 		ifTrue:[
  8164                     self sensor
  8617 		    self sensor
  8165                         pushEvent:anEvent.  "/ must be first in queue
  8618 			pushEvent:anEvent.  "/ must be first in queue
  8166 
  8619 
  8167                     self sensor
  8620 		    self sensor
  8168                       pushUserEvent:#explainSelection
  8621 		      pushUserEvent:#explainSelection
  8169                       for:self
  8622 		      for:self
  8170                       withArguments:nil.
  8623 		      withArguments:nil.
  8171                     ^ true  "/ eaten
  8624 		    ^ true  "/ eaten
  8172                 ]
  8625 		]
  8173             ]
  8626 	    ]
  8174         ].
  8627 	].
  8175 ].
  8628 ].
  8176 
  8629 
  8177     ].
  8630     ].
  8178     ^ false
  8631     ^ false
  8179 !
  8632 !
  8180 
  8633 
  8181 setCurrentMethod:aMethodOrNil
  8634 setCurrentMethod:aMethodOrNil
  8182     currentMethod := aMethodOrNil.
  8635     currentMethod := aMethodOrNil.
  8183 !
  8636 !
  8184 
  8637 
  8185 showSelection:lineNr 
  8638 showSelection:lineNr
  8186     "user clicked on a header line - show selected code in textView.
  8639     "user clicked on a header line - show selected code in textView.
  8187      Also sent to autoselect an interesting context on entry."
  8640      Also sent to autoselect an interesting context on entry."
  8188     
  8641 
  8189     UserNotification 
  8642     UserNotification
  8190         handle:[:ex | 
  8643 	handle:[:ex |
  8191             "/ ex suspendedContext fullPrintAll.
  8644 	    "/ ex suspendedContext fullPrintAll.
  8192             Transcript showCR:ex description.
  8645 	    Transcript showCR:ex description.
  8193             "/ Transcript showCR:ex parameter.
  8646 	    "/ Transcript showCR:ex parameter.
  8194             ex proceed
  8647 	    ex proceed
  8195         ]
  8648 	]
  8196         do:[
  8649 	do:[
  8197             Error 
  8650 	    Error
  8198                 handle:[:ex | 
  8651 		handle:[:ex |
  8199                     |s con|
  8652 		    |s con|
  8200 
  8653 
  8201                     ex creator isControlInterrupt ifTrue:[
  8654 		    ex creator isControlInterrupt ifTrue:[
  8202                         'DebugView [info]: halt/break ignored - while showing selection in debugger' 
  8655 			'DebugView [info]: halt/break ignored - while showing selection in debugger'
  8203                             infoPrintCR.
  8656 			    infoPrintCR.
  8204                         ex proceed
  8657 			ex proceed
  8205                     ].
  8658 		    ].
  8206                     ('DebugView [info]: error at %1 when showing selection in debugger ignored' 
  8659 		    ('DebugView [info]: error at %1 when showing selection in debugger ignored'
  8207                         bindWith:ex suspendedContext) infoPrintCR.
  8660 			bindWith:ex suspendedContext) infoPrintCR.
  8208                     s := '' writeStream.
  8661 		    s := '' writeStream.
  8209                     s nextPutLine:'**** error in debugger, while extracting source'.
  8662 		    s nextPutLine:'**** error in debugger, while extracting source'.
  8210                     s nextPutLine:'****'.
  8663 		    s nextPutLine:'****'.
  8211                     s nextPutLine:'**** ',(ex description).
  8664 		    s nextPutLine:'**** ',(ex description).
  8212                     s nextPutLine:'****'.
  8665 		    s nextPutLine:'****'.
  8213                     con := ex suspendedContext.
  8666 		    con := ex suspendedContext.
  8214                     s nextPutLine:'**** ',(con printString).
  8667 		    s nextPutLine:'**** ',(con printString).
  8215                     con := con sender.
  8668 		    con := con sender.
  8216                     HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ].
  8669 		    HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ].
  8217                     
  8670 
  8218 "/                            [con notNil] whileTrue:[
  8671 "/                            [con notNil] whileTrue:[
  8219 "/                                Error catch:[:ex |
  8672 "/                                Error catch:[:ex |
  8220 "/                                    s nextPutAll: '**** '; nextPutLine:(con printString).
  8673 "/                                    s nextPutAll: '**** '; nextPutLine:(con printString).
  8221 "/                                ].
  8674 "/                                ].
  8222 "/
  8675 "/
  8224 "/                                    con := nil
  8677 "/                                    con := nil
  8225 "/                                ] ifFalse:[
  8678 "/                                ] ifFalse:[
  8226 "/                                    con := con sender.
  8679 "/                                    con := con sender.
  8227 "/                                ]
  8680 "/                                ]
  8228 "/                            ].
  8681 "/                            ].
  8229                     
  8682 
  8230                     codeView contents:(s contents).
  8683 		    codeView contents:(s contents).
  8231                     ex return.
  8684 		    ex return.
  8232                 ]
  8685 		]
  8233                 do:[ self doShowSelection:lineNr ]
  8686 		do:[ self doShowSelection:lineNr ]
  8234         ]
  8687 	]
  8235 
  8688 
  8236     "Modified: / 19-07-2012 / 10:56:58 / cg"
  8689     "Modified: / 19-07-2012 / 10:56:58 / cg"
  8237 !
  8690 !
  8238 
  8691 
  8239 showStackInspectorFor:con
  8692 showStackInspectorFor:con
  8240     stackInspector isNil ifTrue:[
  8693     stackInspector isNil ifTrue:[
  8241         receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0.
  8694 	receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0.
  8242         contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0).
  8695 	contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0).
  8243         stackInspector := InspectorView
  8696 	stackInspector := InspectorView
  8244                     origin:(0.6 @ 0.0)
  8697 		    origin:(0.6 @ 0.0)
  8245                     corner:(1.0 @ 1.0)
  8698 		    corner:(1.0 @ 1.0)
  8246                     in:contextInspector superView.
  8699 		    in:contextInspector superView.
  8247         stackInspector realize.
  8700 	stackInspector realize.
  8248         stackInspector fieldListLabel:'Stack'.
  8701 	stackInspector fieldListLabel:'Stack'.
  8249         stackInspector hideReceiver:true
  8702 	stackInspector hideReceiver:true
  8250     ].
  8703     ].
  8251     stackInspector inspect:(con stackFrame asArray).
  8704     stackInspector inspect:(con stackFrame asArray).
  8252     stackInspector showLast
  8705     stackInspector showLast
  8253 !
  8706 !
  8254 
  8707 
  8255 updateContextInfoFor:aContext
  8708 updateContextInfoFor:aContext
  8256     "additional info as-per selected context;
  8709     "additional info as-per selected context;
  8257      for now:
  8710      for now:
  8258         update:with:from: - show who was responsible
  8711 	update:with:from: - show who was responsible
  8259     "
  8712     "
  8260 
  8713 
  8261     |whatChanged changedObject receiver|
  8714     |whatChanged changedObject receiver|
  8262 
  8715 
  8263     aContext selector == #'update:with:from:' ifTrue:[
  8716     aContext selector == #'update:with:from:' ifTrue:[
  8264         receiver := aContext receiver.
  8717 	receiver := aContext receiver.
  8265         whatChanged := aContext argAt:1.
  8718 	whatChanged := aContext argAt:1.
  8266         changedObject := aContext argAt:3.
  8719 	changedObject := aContext argAt:3.
  8267 
  8720 
  8268         changedObject isBehavior ifTrue:[
  8721 	changedObject isBehavior ifTrue:[
  8269             contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold).
  8722 	    contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject name allBold).
  8270             ^ self
  8723 	    ^ self
  8271         ].
  8724 	].
  8272 
  8725 
  8273         receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm |
  8726 	receiver class allInstanceVariableNames keysAndValuesDo:[:i :nm |
  8274             (receiver instVarAt:i) == changedObject ifTrue:[
  8727 	    (receiver instVarAt:i) == changedObject ifTrue:[
  8275                 contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold).
  8728 		contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',nm allBold).
  8276                 ^ self
  8729 		^ self
  8277             ]
  8730 	    ]
  8278         ].
  8731 	].
  8279 
  8732 
  8280         (receiver isKindOf:ApplicationModel) ifTrue:[
  8733 	(receiver isKindOf:ApplicationModel) ifTrue:[
  8281             receiver builder notNil ifTrue:[
  8734 	    receiver builder notNil ifTrue:[
  8282                 (receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue |
  8735 		(receiver builder bindings ? #()) keysAndValuesDo:[:eachAspect :eachValue |
  8283                     eachValue == changedObject ifTrue:[
  8736 		    eachValue == changedObject ifTrue:[
  8284                         contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold).
  8737 			contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by aspect ',eachAspect allBold).
  8285                         ^ self
  8738 			^ self
  8286                     ]
  8739 		    ]
  8287                 ]
  8740 		]
  8288             ]
  8741 	    ]
  8289         ].
  8742 	].
  8290 
  8743 
  8291         contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold).
  8744 	contextInfoLabel label:('update (',whatChanged printString allBold,') triggered by ',changedObject classNameWithArticle allBold).
  8292         ^self.
  8745 	^self.
  8293     ].
  8746     ].
  8294     contextInfoLabel label:nil.
  8747     contextInfoLabel label:nil.
  8295 !
  8748 !
  8296 
  8749 
  8297 updateForContext:lineNr
  8750 updateForContext:lineNr
  8306 
  8759 
  8307     canDefine := cannotAcceptDueToOutdatedClass := false.
  8760     canDefine := cannotAcceptDueToOutdatedClass := false.
  8308     self setCurrentMethod:nil.
  8761     self setCurrentMethod:nil.
  8309 
  8762 
  8310     contextArray notNil ifTrue:[
  8763     contextArray notNil ifTrue:[
  8311         lineNr <= contextArray size ifTrue:[
  8764 	lineNr <= contextArray size ifTrue:[
  8312             con := contextArray at:lineNr.
  8765 	    con := contextArray at:lineNr.
  8313             callee := contextArray at:lineNr-1 ifAbsent:nil.
  8766 	    callee := contextArray at:lineNr-1 ifAbsent:nil.
  8314         ].
  8767 	].
  8315         "
  8768 	"
  8316          clicking on the '** ...'-line shows more ...
  8769 	 clicking on the '** ...'-line shows more ...
  8317         "
  8770 	"
  8318         con isNil ifTrue:[
  8771 	con isNil ifTrue:[
  8319             line := contextView list at:lineNr.
  8772 	    line := contextView list at:lineNr.
  8320             (line startsWith:'**') ifTrue:[
  8773 	    (line startsWith:'**') ifTrue:[
  8321                 self showMore.
  8774 		self showMore.
  8322                 lineNr >= contextArray size ifTrue:[
  8775 		lineNr >= contextArray size ifTrue:[
  8323                     contextView setSelection:lineNr.
  8776 		    contextView setSelection:lineNr.
  8324                     con := contextArray at:lineNr ifAbsent:nil
  8777 		    con := contextArray at:lineNr ifAbsent:nil
  8325                 ]
  8778 		]
  8326             ].
  8779 	    ].
  8327             con isNil ifTrue:[
  8780 	    con isNil ifTrue:[
  8328                 codeView contents:nil.
  8781 		codeView contents:nil.
  8329                 ^ self
  8782 		^ self
  8330             ].
  8783 	    ].
  8331         ].
  8784 	].
  8332 
  8785 
  8333         selectedContext := con.
  8786 	selectedContext := con.
  8334         m := contextView middleButtonMenu.
  8787 	m := contextView middleButtonMenu.
  8335         (m notNil and:[selectedContext notNil]) ifTrue:[
  8788 	(m notNil and:[selectedContext notNil]) ifTrue:[
  8336             m enableAll:#(browseImplementors browseSenders inspectContext)
  8789 	    m enableAll:#(browseImplementors browseSenders inspectContext)
  8337         ].
  8790 	].
  8338 
  8791 
  8339         self withExecuteCursorDo:[
  8792 	self withExecuteCursorDo:[
  8340             codeSet := false.
  8793 	    codeSet := false.
  8341 
  8794 
  8342             "
  8795 	    "
  8343              give it to the (lower right) inspector
  8796 	     give it to the (lower right) inspector
  8344             "
  8797 	    "
  8345             Error handle:[:ex |
  8798 	    Error handle:[:ex |
  8346                 'DebugView [warning]: error while accessing context: ' errorPrint.
  8799 		'DebugView [warning]: error while accessing context: ' errorPrint.
  8347                 ex description errorPrintCR.
  8800 		ex description errorPrintCR.
  8348                 contextInspector inspect:nil.
  8801 		contextInspector inspect:nil.
  8349                 contextInspector fieldListLabel:('Context').
  8802 		contextInspector fieldListLabel:('Context').
  8350                 ex suspendedContext fullPrintAllOn: Transcript.
  8803 		ex suspendedContext fullPrintAllOn: Transcript.
  8351 "/ ex reject.
  8804 "/ ex reject.
  8352             ] do:[
  8805 	    ] do:[
  8353                 contextInspector inspect:con.
  8806 		contextInspector inspect:con.
  8354                 "/ contextInspector fieldListLabel:('Context: ',con method whoString).
  8807 		"/ contextInspector fieldListLabel:('Context: ',con method whoString).
  8355                 contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector.
  8808 		contextInspector tryToSelectKeyNamed:lastSelectionInContextInspector.
  8356             ].
  8809 	    ].
  8357 
  8810 
  8358             "/ show a stack inspector sometimes
  8811 	    "/ show a stack inspector sometimes
  8359 
  8812 
  8360             con hasStackToShow ifTrue:[
  8813 	    con hasStackToShow ifTrue:[
  8361                 self showStackInspectorFor:con
  8814 		self showStackInspectorFor:con
  8362             ] ifFalse:[
  8815 	    ] ifFalse:[
  8363                 self hideStackInspector
  8816 		self hideStackInspector
  8364             ].
  8817 	    ].
  8365 
  8818 
  8366             homeContext := con methodHome.
  8819 	    homeContext := con methodHome.
  8367             con canReturn ifTrue:[
  8820 	    con canReturn ifTrue:[
  8368                 returnButton enable. restartButton enable.
  8821 		returnButton enable. restartButton enable.
  8369             ] ifFalse:[
  8822 	    ] ifFalse:[
  8370                 returnButton disable. restartButton disable.
  8823 		returnButton disable. restartButton disable.
  8371             ].
  8824 	    ].
  8372 
  8825 
  8373             lineNrInMethod := con lineNumber.
  8826 	    lineNrInMethod := con lineNumber.
  8374 
  8827 
  8375             canAccept := false.
  8828 	    canAccept := false.
  8376 
  8829 
  8377             homeContext isNil ifTrue:[
  8830 	    homeContext isNil ifTrue:[
  8378                 "
  8831 		"
  8379                  mhmh - an optimized block
  8832 		 mhmh - an optimized block
  8380                  should get the block here, and get the method from
  8833 		 should get the block here, and get the method from
  8381                  that one ...
  8834 		 that one ...
  8382                  But in the current version, there is no easy way to get to the block
  8835 		 But in the current version, there is no easy way to get to the block
  8383                  since that one is not in the context.
  8836 		 since that one is not in the context.
  8384                  A future new block calling scheme will fix this
  8837 		 A future new block calling scheme will fix this
  8385                  (passing the block instead of the home as block argument).
  8838 		 (passing the block instead of the home as block argument).
  8386                 "
  8839 		"
  8387                 (method := con method) isNil ifTrue:[
  8840 		(method := con method) isNil ifTrue:[
  8388                     "temporary kludge - peek into the sender context.
  8841 		    "temporary kludge - peek into the sender context.
  8389                      If its a do-like method and there is a single block variable
  8842 		     If its a do-like method and there is a single block variable
  8390                      in the args or temporaries, that must be the one.
  8843 		     in the args or temporaries, that must be the one.
  8391                      This helps in some cases.
  8844 		     This helps in some cases.
  8392                     "
  8845 		    "
  8393                     (sender := con sender) notNil ifTrue:[
  8846 		    (sender := con sender) notNil ifTrue:[
  8394                         tryVars := false.
  8847 			tryVars := false.
  8395                         (selSender := sender selector) notNil ifTrue:[
  8848 			(selSender := sender selector) notNil ifTrue:[
  8396                             ((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[
  8849 			    ((selSender endsWith:'do:') or:[selSender endsWith:'Do:']) ifTrue:[
  8397                                 tryVars := true.
  8850 				tryVars := true.
  8398                             ]
  8851 			    ]
  8399                         ].
  8852 			].
  8400                         tryVars ifTrue:[
  8853 			tryVars ifTrue:[
  8401                             possibleBlocks := sender argsAndVars select:[:v | v isBlock].
  8854 			    possibleBlocks := sender argsAndVars select:[:v | v isBlock].
  8402                             possibleBlocks := possibleBlocks select:[:b | b home isNil].
  8855 			    possibleBlocks := possibleBlocks select:[:b | b home isNil].
  8403                             possibleBlocks size == 1 ifTrue:[
  8856 			    possibleBlocks size == 1 ifTrue:[
  8404                                 method := possibleBlocks first method.
  8857 				method := possibleBlocks first method.
  8405                             ].
  8858 			    ].
  8406                         ]
  8859 			]
  8407                     ].
  8860 		    ].
  8408                 ]
  8861 		]
  8409             ] ifFalse:[
  8862 	    ] ifFalse:[
  8410                 "fetch rec here - so we won't need context in doItAction"
  8863 		"fetch rec here - so we won't need context in doItAction"
  8411                 rec := homeContext receiver.
  8864 		rec := homeContext receiver.
  8412                 sel := homeContext selector.
  8865 		sel := homeContext selector.
  8413                 sel notNil ifTrue:[
  8866 		sel notNil ifTrue:[
  8414                     canAccept := true.
  8867 		    canAccept := true.
  8415 
  8868 
  8416                     implementorClass := homeContext methodClass.
  8869 		    implementorClass := homeContext methodClass.
  8417                     implementorClass isNil ifTrue:[
  8870 		    implementorClass isNil ifTrue:[
  8418                         homeContext method notNil ifTrue:[
  8871 			homeContext method notNil ifTrue:[
  8419                             WrappedMethod allInstancesDo:[:wrapped | 
  8872 			    WrappedMethod allInstancesDo:[:wrapped |
  8420                                 wrapped originalMethod == homeContext method ifTrue:[
  8873 				wrapped originalMethod == homeContext method ifTrue:[
  8421                                     implementorClass := wrapped mclass
  8874 				    implementorClass := wrapped mclass
  8422                                 ]
  8875 				]
  8423                             ].
  8876 			    ].
  8424                             implementorClass isNil ifTrue:[
  8877 			    implementorClass isNil ifTrue:[
  8425                                 (homeContext searchClass notNil
  8878 				(homeContext searchClass notNil
  8426                                 and:[homeContext searchClass isObsolete]) ifTrue:[
  8879 				and:[homeContext searchClass isObsolete]) ifTrue:[
  8427                                     cannotAcceptDueToOutdatedClass := true.
  8880 				    cannotAcceptDueToOutdatedClass := true.
  8428                                 ]
  8881 				]
  8429                             ].
  8882 			    ].
  8430                         ].
  8883 			].
  8431                     ].
  8884 		    ].
  8432                     implementorClass isNil ifTrue:[
  8885 		    implementorClass isNil ifTrue:[
  8433                         Error handle:[:ex |
  8886 			Error handle:[:ex |
  8434 "/ not covered by Error, anyway
  8887 "/ not covered by Error, anyway
  8435 "/                            ex signal == BreakPointInterrupt ifTrue:[
  8888 "/                            ex signal == BreakPointInterrupt ifTrue:[
  8436 "/                                ex proceed.
  8889 "/                                ex proceed.
  8437 "/                            ].
  8890 "/                            ].
  8438                             code := 'error while asking method for its source'.
  8891 			    code := 'error while asking method for its source'.
  8439                             code := code , Character cr , ex creator printString.
  8892 			    code := code , Character cr , ex creator printString.
  8440                             code := code , Character cr , 'in: ' , ex suspendedContext printString.
  8893 			    code := code , Character cr , 'in: ' , ex suspendedContext printString.
  8441 
  8894 
  8442                             canAccept := false.
  8895 			    canAccept := false.
  8443                             ex return.
  8896 			    ex return.
  8444                         ] do:[
  8897 			] do:[
  8445                             "
  8898 			    "
  8446                              special: look if this context was created by
  8899 			     special: look if this context was created by
  8447                              valueWithReceiver kind of method invocation;
  8900 			     valueWithReceiver kind of method invocation;
  8448                              if so, grab the method from the sender and show it
  8901 			     if so, grab the method from the sender and show it
  8449                             "
  8902 			    "
  8450                             ((sender := homeContext sender) notNil
  8903 			    ((sender := homeContext sender) notNil
  8451                             and:[((sender selector ? '') startsWith:'valueWithReceiver:')
  8904 			    and:[((sender selector ? '') startsWith:'valueWithReceiver:')
  8452                             and:[sender receiver isMethod]]) ifTrue:[
  8905 			    and:[sender receiver isMethod]]) ifTrue:[
  8453                                 method := sender receiver.
  8906 				method := sender receiver.
  8454                                 canAccept := false.
  8907 				canAccept := false.
  8455                             ] ifFalse:[
  8908 			    ] ifFalse:[
  8456                                 (method := con method) notNil ifTrue:[
  8909 				(method := con method) notNil ifTrue:[
  8457                                     canAccept := false.
  8910 				    canAccept := false.
  8458                                 ]
  8911 				]
  8459                             ].
  8912 			    ].
  8460                         ]
  8913 			]
  8461                     ] ifFalse:[
  8914 		    ] ifFalse:[
  8462                         method := implementorClass compiledMethodAt:sel.
  8915 			method := implementorClass compiledMethodAt:sel.
  8463                     ].
  8916 		    ].
  8464                 ]
  8917 		]
  8465             ].
  8918 	    ].
  8466 
  8919 
  8467             homeContext notNil ifTrue:[
  8920 	    homeContext notNil ifTrue:[
  8468                 searchClass := homeContext searchClass ? rec class.
  8921 		searchClass := homeContext searchClass ? rec class.
  8469                 currentMethod := searchClass lookupMethodFor:sel.
  8922 		currentMethod := searchClass lookupMethodFor:sel.
  8470             ].
  8923 	    ].
  8471             originalMethod := currentMethod.
  8924 	    originalMethod := currentMethod.
  8472             (currentMethod notNil 
  8925 	    (currentMethod notNil
  8473             and:[currentMethod ~~ method
  8926 	    and:[currentMethod ~~ method
  8474             and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]]) ifTrue:[
  8927 	    and:[ (currentMethod isWrapped and:[ method == currentMethod originalMethod]) not ]]) ifTrue:[
  8475                 originalMethod := method.
  8928 		originalMethod := method.
  8476                 methodCodeToggleSelectionHolder value = 1 ifTrue:[
  8929 		methodCodeToggleSelectionHolder value = 1 ifTrue:[
  8477                     method := originalMethod.   "/ the one which is suspended / was executing
  8930 		    method := originalMethod.   "/ the one which is suspended / was executing
  8478                 ] ifFalse:[
  8931 		] ifFalse:[
  8479                     method := currentMethod.    "/ the one which has already been accepted/modified.
  8932 		    method := currentMethod.    "/ the one which has already been accepted/modified.
  8480                     lineNrInMethod := nil.
  8933 		    lineNrInMethod := nil.
  8481                     canAccept := true.
  8934 		    canAccept := true.
  8482                 ].
  8935 		].
  8483                 methodCodeToggle beVisible.
  8936 		methodCodeToggle beVisible.
  8484             ] ifFalse:[
  8937 	    ] ifFalse:[
  8485                 methodCodeToggle beInvisible.
  8938 		methodCodeToggle beInvisible.
  8486             ].
  8939 	    ].
  8487 
  8940 
  8488             code isNil ifTrue:[
  8941 	    code isNil ifTrue:[
  8489                 errMsg := nil.
  8942 		errMsg := nil.
  8490                 method isNil ifTrue:[
  8943 		method isNil ifTrue:[
  8491                     "/ fall back heuristics (see how this was called, fetch block from caller)
  8944 		    "/ fall back heuristics (see how this was called, fetch block from caller)
  8492                     sender := con sender.
  8945 		    sender := con sender.
  8493                     con isBlockContext ifTrue:[
  8946 		    con isBlockContext ifTrue:[
  8494                         (sender notNil
  8947 			(sender notNil
  8495                         and:[((sender selector ? '') startsWith:'value')
  8948 			and:[((sender selector ? '') startsWith:'value')
  8496                         and:[sender receiver isBlock]]) ifTrue:[
  8949 			and:[sender receiver isBlock]]) ifTrue:[
  8497                             code := sender receiver source.
  8950 			    code := sender receiver source.
  8498                         ]
  8951 			]
  8499                     ] ifFalse:[
  8952 		    ] ifFalse:[
  8500                         (sender notNil
  8953 			(sender notNil
  8501                         and:[((sender selector ? '') startsWith:'valueWith')
  8954 			and:[((sender selector ? '') startsWith:'valueWith')
  8502                         and:[sender receiver isMethod]]) ifTrue:[
  8955 			and:[sender receiver isMethod]]) ifTrue:[
  8503                             method := sender receiver.
  8956 			    method := sender receiver.
  8504                         ]
  8957 			]
  8505                     ]
  8958 		    ]
  8506                 ].
  8959 		].
  8507                 method notNil ifTrue:[
  8960 		method notNil ifTrue:[
  8508                     contextInspector fieldListLabel:(method selector "whoString").
  8961 		    contextInspector fieldListLabel:(method selector "whoString").
  8509                     Error handle:[:ex |
  8962 		    Error handle:[:ex |
  8510 "/ not covered by Error, anyway
  8963 "/ not covered by Error, anyway
  8511 "/                        ex signal isControlInterrupt ifTrue:[
  8964 "/                        ex signal isControlInterrupt ifTrue:[
  8512 "/                            ex proceed.
  8965 "/                            ex proceed.
  8513 "/                        ].
  8966 "/                        ].
  8514                         code := 'error while asking method for its source'.
  8967 			code := 'error while asking method for its source'.
  8515                         code := code , Character cr , ex creator printString.
  8968 			code := code , Character cr , ex creator printString.
  8516                         code := code , Character cr , 'in: ' , ex suspendedContext printString.
  8969 			code := code , Character cr , 'in: ' , ex suspendedContext printString.
  8517 
  8970 
  8518                         canAccept := false.
  8971 			canAccept := false.
  8519                         ex return.
  8972 			ex return.
  8520                     ] do:[
  8973 		    ] do:[
  8521                         self sensor shiftDown ifTrue:[
  8974 			self sensor shiftDown ifTrue:[
  8522                             code := method decompiledSource
  8975 			    code := method decompiledSource
  8523                         ] ifFalse:[
  8976 			] ifFalse:[
  8524                             code := method source.
  8977 			    code := method source.
  8525                         ].
  8978 			].
  8526                     ].
  8979 		    ].
  8527                     code isNil ifTrue:[
  8980 
  8528                         method sourceFilename notNil ifTrue:[
  8981 		    code isNil ifTrue:[
  8529                             codeView contents:(resources
  8982 			method sourceFilename notNil ifTrue:[
  8530                                                        string:'** no sourcefile: %1 **'
  8983 			    codeView contents:(resources
  8531                                                        with:method sourceFilename).
  8984 						       string:'** no sourcefile: %1 **'
  8532                             codeView flash.
  8985 						       with:method sourceFilename).
  8533                             codeSet := true.
  8986 			    codeView realized ifTrue:[
  8534                         ] ifFalse:[
  8987 				"codeView is not realized on initial startup"
  8535                             [
  8988 				codeView flash:'no source'.
  8536                                 |src|
  8989 			    ].
  8537 
  8990 			    codeSet := true.
  8538                                 src := String streamContents:[:s | Decompiler decompile:method to:s].
  8991 			] ifFalse:[
  8539                                 codeView contents:src.
  8992 			    [
  8540                                 codeSet := true.
  8993 				|src|
  8541                             ] on: Error do:[
  8994 
  8542                                 errMsg := '** no source **'
  8995 				src := String streamContents:[:s | Decompiler decompile:method to:s].
  8543                             ].
  8996 				codeView contents:src.
  8544                         ]
  8997 				codeSet := true.
  8545                     ].
  8998 			    ] on: Error do:[
  8546                 ] ifFalse:[
  8999 				errMsg := '** no source **'
  8547                     contextInspector fieldListLabel:'Context'.
  9000 			    ].
  8548                     homeContext isNil ifTrue:[
  9001 			]
  8549                         errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'.
  9002 		    ].
  8550                     ] ifFalse:[
  9003 		] ifFalse:[
  8551                         errMsg := '** no method - no source **'.
  9004 		    contextInspector fieldListLabel:'Context'.
  8552                         canDefine := false. "/ true.
  9005 		    homeContext isNil ifTrue:[
  8553                     ]
  9006 			errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'.
  8554                 ].
  9007 		    ] ifFalse:[
  8555                 errMsg notNil ifTrue:[
  9008 			errMsg := '** no method - no source **'.
  8556                    self showError:errMsg.
  9009 			canDefine := false. "/ true.
  8557                    codeSet := true.
  9010 		    ]
  8558                 ]
  9011 		].
  8559             ].
  9012 		errMsg notNil ifTrue:[
  8560 
  9013 		   self showError:errMsg.
  8561             code isNil ifTrue:[
  9014 		   codeSet := true.
  8562                 "/ canAccept := false.
  9015 		]
  8563                 codeSet ifFalse:[
  9016 	    ].
  8564                     codeView contents:nil.
  9017 
  8565                 ]
  9018 	    code isNil ifTrue:[
  8566             ] ifFalse:[
  9019 		"/ canAccept := false.
  8567                 lineNrInMethod notNil ifTrue:[
  9020 		codeSet ifFalse:[
  8568                     lineNrInMethod == 0 ifTrue:[
  9021 		    codeView contents:nil.
  8569                         (method notNil and:[method isJavaMethod]) ifTrue:[
  9022 		]
  8570                             lineNrInMethod := method lineNumber
  9023 	    ] ifFalse:[
  8571                         ].
  9024 		lineNrInMethod notNil ifTrue:[
  8572                         "/ guess lineNumber from sent-messages selector
  9025 		    lineNrInMethod == 0 ifTrue:[
  8573                         "/ kludge to fix lineNr-display of shared subclassResponsibility methods.
  9026 			(method notNil and:[method isJavaMethod]) ifTrue:[
  8574                         lineNrInMethod == 0 ifTrue:[
  9027 			    lineNrInMethod := method lineNumber
  8575                             |conIdx sentContext messages|
  9028 			].
  8576 
  9029 			"/ guess lineNumber from sent-messages selector
  8577                             conIdx := contextArray identityIndexOf:con.
  9030 			"/ kludge to fix lineNr-display of shared subclassResponsibility methods.
  8578                             conIdx > 1 ifTrue:[
  9031 			lineNrInMethod == 0 ifTrue:[
  8579                                 sentContext := contextArray at:conIdx-1.
  9032 			    |conIdx sentContext messages|
  8580                                 sentContext isBlockContext ifFalse:[
  9033 
  8581                                     (method notNil and:[code notNil]) ifTrue:[
  9034 			    conIdx := contextArray identityIndexOf:con.
  8582                                         messages := method messagesSent.
  9035 			    conIdx > 1 ifTrue:[
  8583                                         messages size == 1 ifTrue:[
  9036 				sentContext := contextArray at:conIdx-1.
  8584                                             sentContext selector == messages first ifTrue:[
  9037 				sentContext isBlockContext ifFalse:[
  8585                                                 lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector].
  9038 				    (method notNil and:[code notNil]) ifTrue:[
  8586                                             ]
  9039 					messages := method messagesSent.
  8587                                         ]
  9040 					messages size == 1 ifTrue:[
  8588                                     ].
  9041 					    sentContext selector == messages first ifTrue:[
  8589                                 ].
  9042 						lineNrInMethod := code asStringCollection findFirst:[:l | l includesString:sentContext selector].
  8590                             ].
  9043 					    ]
  8591                         ].
  9044 					]
  8592                     ].
  9045 				    ].
  8593                 ].
  9046 				].
  8594                 codeView isCodeView2 ifTrue:[
  9047 			    ].
  8595                     codeView model setValue: code.
  9048 			].
  8596                     codeView model changed.
  9049 		    ].
  8597                     codeView methodHolder value: method.
  9050 		].
  8598                     codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class])
  9051 		codeView isCodeView2 ifTrue:[
  8599                 ] ifFalse:[
  9052 		    codeView model
  8600 
  9053 			setValue: code;
  8601                 UserPreferences current syntaxColoring ifTrue:[
  9054 			changed.
  8602                     implementorClass isNil ifTrue:[
  9055 		    codeView methodHolder value: method.
  8603                         (con isBlockContext
  9056 		    codeView classHolder value: ((method respondsTo: #mclass) ifTrue:[method mclass] ifFalse:[rec class])
  8604                         and:[con home isNil
  9057 		] ifFalse:[
  8605                         and:[con guessedHome notNil]])
  9058 		    UserPreferences current syntaxColoring ifTrue:[
  8606                         ifTrue:[
  9059 			implementorClass isNil ifTrue:[
  8607                             implementorClass := con guessedHome mclass
  9060 			    (con isBlockContext
  8608                         ]
  9061 			    and:[con home isNil
  8609                     ].
  9062 			    and:[con guessedHome notNil]])
  8610                     implementorClass notNil ifTrue:[
  9063 			    ifTrue:[
  8611                         (highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[
  9064 				implementorClass := con guessedHome mclass
  8612                             code size < 100000 ifTrue:[
  9065 			    ]
  8613                                 Error handle:[:ex |
  9066 			].
  8614                                 ] do:[
  9067 			implementorClass notNil ifTrue:[
  8615                                     code := highlighter formatMethodSource:code in:implementorClass.
  9068 			    (highlighter := implementorClass syntaxHighlighterClass) notNil ifTrue:[
  8616                                 ]
  9069 				code size < 100000 ifTrue:[
  8617                             ]
  9070 				    Error catch:[
  8618                         ]
  9071 					code := highlighter formatMethodSource:code in:implementorClass.
  8619                     ]
  9072 				    ]
  8620                 ].
  9073 				]
       
  9074 			    ]
       
  9075 			]
       
  9076 		    ].
  8621 
  9077 
  8622 "/                code ~= (codeView contents) ifTrue:[
  9078 "/                code ~= (codeView contents) ifTrue:[
  8623                 cannotAcceptDueToOutdatedClass ifTrue:[
  9079 		    cannotAcceptDueToOutdatedClass ifTrue:[
  8624                     codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' colorizeAllWith:Color red),Character cr,Character cr,code asString).
  9080 			codeView setContents:(('Obsolete code (outdated due to class change). Use Browser.' colorizeAllWith:Color red),Character cr,Character cr,code asString).
  8625                 ] ifFalse:[
  9081 		    ] ifFalse:[
  8626                     codeView setContents:code.
  9082 			codeView setContents:code.
  8627                 ].
  9083 		    ].
  8628 "/                ].
  9084 "/                ].
  8629                 ].
  9085 		].
  8630                 (lineNrInMethod notNil
  9086 		(lineNrInMethod notNil
  8631                 and:[lineNrInMethod ~~ 0
  9087 		and:[lineNrInMethod ~~ 0
  8632                 and:[lineNrInMethod <= codeView list size]]) ifTrue:[
  9088 		and:[lineNrInMethod <= codeView list size]]) ifTrue:[
  8633 lineNrInMethod == 255 ifFalse:[
  9089 lineNrInMethod == 255 ifFalse:[
  8634                     (lineNrInMethod == 255
  9090 		    (lineNrInMethod == 255
  8635                     and:[method notNil
  9091 		    and:[method notNil
  8636                     and:[method hasCode not]]) ifTrue:[
  9092 		    and:[method hasCode not]]) ifTrue:[
  8637                         "/ means: do not really know in interpreted methods
  9093 			"/ means: do not really know in interpreted methods
  8638                         codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0.
  9094 			codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0.
  8639                     ] ifFalse:[
  9095 		    ] ifFalse:[
  8640                         codeView selectLine:lineNrInMethod.
  9096 			codeView selectLine:lineNrInMethod.
  8641                     ].
  9097 		    ].
  8642                     codeView makeSelectionVisible
  9098 		    codeView makeSelectionVisible
  8643 ].
  9099 ].
  8644                 ] ifFalse:[
  9100 		] ifFalse:[
  8645                     codeView unselect.
  9101 		    codeView unselect.
  8646                     codeView scrollToTop
  9102 		    codeView scrollToTop
  8647                 ]
  9103 		]
  8648             ].
  9104 	    ].
  8649 
  9105 
  8650             codeView acceptEnabled:canAccept.
  9106 	    codeView acceptEnabled:canAccept.
  8651             canAccept ifTrue:[
  9107 	    canAccept ifTrue:[
  8652                 codeView acceptAction:[:code | self codeAccept:code asString]
  9108 		codeView acceptAction:[:code | self codeAccept:code asString]
  8653             ] ifFalse:[
  9109 	    ] ifFalse:[
  8654                 codeView acceptAction:[:code | self beep]
  9110 		codeView acceptAction:[:code | self beep]
  8655             ].
  9111 	    ].
  8656 
  9112 
  8657             receiverInspector inspect:rec.
  9113 	    receiverInspector inspect:rec.
  8658             receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle).
  9114 	    receiverInspector fieldListLabel:("'Receiver: ',"rec classNameWithArticle).
  8659             receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector.
  9115 	    receiverInspector tryToSelectKeyNamed:lastSelectionInReceiverInspector.
  8660 
  9116 
  8661             "
  9117 	    "
  8662              the one below is wrong: currently, the
  9118 	     the one below is wrong: currently, the
  8663              evaluator cannot handle passed contexts.
  9119 	     evaluator cannot handle passed contexts.
  8664              Once it does, pass con as in:-arg
  9120 	     Once it does, pass con as in:-arg
  8665             "
  9121 	    "
  8666             (rec isJavaObject
  9122 	    (rec isJavaObject
  8667             and:[method isNil or:[method isJavaMethod not]]) ifTrue:[
  9123 	    and:[method isNil or:[method isJavaMethod not]]) ifTrue:[
  8668                 "/ although a java object, use the smalltalk parser here for doIts.
  9124 		"/ although a java object, use the smalltalk parser here for doIts.
  8669                 evaluatorClass := Parser
  9125 		evaluatorClass := Parser.
  8670             ] ifFalse:[
  9126 		codeView commentStrings:#( '//' ( '/*' '*/' ) ).
  8671                 (method notNil and:[method mclass notNil]) ifTrue:[
  9127 	    ] ifFalse:[
  8672                     evaluatorClass := method mclass evaluatorClass.
  9128 		(method notNil and:[method mclass notNil]) ifTrue:[
  8673                 ] ifFalse:[
  9129 		    evaluatorClass := method mclass evaluatorClass.
  8674                     evaluatorClass := rec class evaluatorClass.
  9130 		    codeView commentStrings:method mclass programmingLanguage commentStrings.
  8675                 ].
  9131 		] ifFalse:[
  8676             ].
  9132 		    evaluatorClass := rec class evaluatorClass.
  8677 
  9133 		    codeView commentStrings:rec class programmingLanguage commentStrings.
  8678             codeView 
  9134 		].
  8679                 doItAction:
  9135 	    ].
  8680                     [:theCode |
  9136 
  8681                          evaluatorClass
  9137 	    codeView
  8682                              evaluate:theCode
  9138 		doItAction:
  8683                              in:actualContext "/ (selectedContext ? actualContext)
  9139 		    [:theCode |
  8684                              receiver:rec
  9140 			 evaluatorClass
  8685                              notifying:codeView
  9141 			     evaluate:theCode
  8686                              logged:true
  9142 			     in:actualContext "/ (selectedContext ? actualContext)
  8687                              ifFail:nil
  9143 			     receiver:rec
  8688                     ];
  9144 			     notifying:codeView
  8689                 editedMethodOrClass:(method ? rec class).
  9145 			     logged:true
  8690 
  9146 			     ifFail:nil
  8691             self setCurrentMethod:method.
  9147 		    ];
  8692 
  9148 		editedMethodOrClass:(method ? rec class).
  8693             selectedContext := homeContext ? con.
  9149 
  8694             actualContext := con
  9150 
  8695         ].
  9151 	    self setCurrentMethod:method.
       
  9152 
       
  9153 	    selectedContext := homeContext ? con.
       
  9154 	    actualContext := con
       
  9155 	].
  8696     ] ifFalse:[
  9156     ] ifFalse:[
  8697         codeView contents:nil.
  9157 	codeView contents:nil.
  8698     ].
  9158     ].
  8699     codeView modified:false.
  9159     codeView modified:false.
  8700 
  9160 
  8701     con isContext ifFalse:[
  9161     con isContext ifFalse:[
  8702         sendButton disable.
  9162 	sendButton disable.
  8703     ] ifTrue:[
  9163     ] ifTrue:[
  8704         sendButton enable.
  9164 	sendButton enable.
  8705     ].
  9165     ].
  8706     self updateContextInfoFor:con.
  9166     self updateContextInfoFor:con.
  8707 
  9167 
  8708     "clear out locals to prevent keeping around unneeded contexts
  9168     "clear out locals to prevent keeping around unneeded contexts
  8709      (due to the block held in codeView).
  9169      (due to the block held in codeView).
  8712     "
  9172     "
  8713     con := nil.
  9173     con := nil.
  8714     homeContext := nil.
  9174     homeContext := nil.
  8715 
  9175 
  8716     (canDefine or:[self canDefineForCallee:callee]) ifTrue:[
  9176     (canDefine or:[self canDefineForCallee:callee]) ifTrue:[
  8717         defineButton beVisible.
  9177 	defineButton beVisible.
  8718     ] ifFalse:[
  9178     ] ifFalse:[
  8719         defineButton beInvisible.
  9179 	defineButton beInvisible.
  8720     ].
  9180     ].
  8721 
  9181 
  8722     "/ enable/disable some menu items
  9182     "/ enable/disable some menu items
  8723     self updateMenuItems
  9183     self updateMenuItems
  8724 
  9184 
  8737     ignoreEndTime := something.
  9197     ignoreEndTime := something.
  8738 !
  9198 !
  8739 
  9199 
  8740 ignoreForProcess:aProcess
  9200 ignoreForProcess:aProcess
  8741     ignoredProcesses isNil ifTrue:[
  9201     ignoredProcesses isNil ifTrue:[
  8742         ignoredProcesses := WeakIdentitySet new.
  9202 	ignoredProcesses := WeakIdentitySet new.
  8743     ].
  9203     ].
  8744     ignoredProcesses add:aProcess
  9204     ignoredProcesses add:aProcess
  8745 !
  9205 !
  8746 
  9206 
  8747 ignoreForReceiverClass:aClass
  9207 ignoreForReceiverClass:aClass
  8748     ignoredReceiverClasses isNil ifTrue:[
  9208     ignoredReceiverClasses isNil ifTrue:[
  8749         ignoredReceiverClasses := WeakIdentitySet new.
  9209 	ignoredReceiverClasses := WeakIdentitySet new.
  8750     ].
  9210     ].
  8751     ignoredReceiverClasses add:aClass
  9211     ignoredReceiverClasses add:aClass
       
  9212 !
       
  9213 
       
  9214 ignoreIfCalledFromMethod:aMethod
       
  9215     ignoredSendingClassAndSelectors isNil ifTrue:[
       
  9216 	 ignoredSendingClassAndSelectors := OrderedCollection new.
       
  9217     ].
       
  9218 
       
  9219     "/ remember the method's name, not the method.
       
  9220     "/ so it can be recompiled and we still detect ignores
       
  9221     ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector }
  8752 !
  9222 !
  8753 
  9223 
  8754 ignoreUntilShiftKeyPressed:aBoolean
  9224 ignoreUntilShiftKeyPressed:aBoolean
  8755     ignoreUntilShiftKeyPressed := aBoolean.
  9225     ignoreUntilShiftKeyPressed := aBoolean.
  8756 
  9226 
  8759 
  9229 
  8760 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'!
  9230 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'!
  8761 
  9231 
  8762 decrementIgnoreCount
  9232 decrementIgnoreCount
  8763     ignoreCount notNil ifTrue:[
  9233     ignoreCount notNil ifTrue:[
  8764         ignoreCount > 0 ifTrue:[
  9234 	ignoreCount > 0 ifTrue:[
  8765             ignoreCount := ignoreCount - 1
  9235 	    ignoreCount := ignoreCount - 1
  8766         ]
  9236 	]
  8767     ]
  9237     ]
  8768 ! !
  9238 ! !
  8769 
  9239 
  8770 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'!
  9240 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'!
  8771 
  9241 
  8772 printConditionOn:aStream
  9242 printConditionOn:aStream
       
  9243     ignoredSendingClassAndSelectors notEmptyOrNil ifTrue:[
       
  9244 	aStream nextPutAll:(' if called from %1 >> %2'
       
  9245 				bindWith:ignoredSendingClassAndSelectors first first
       
  9246 				with:ignoredSendingClassAndSelectors first second).
       
  9247 	^ self.
       
  9248     ].
  8773     ignoredProcesses notEmptyOrNil ifTrue:[
  9249     ignoredProcesses notEmptyOrNil ifTrue:[
  8774         aStream nextPutAll:(' in %1 processes (%2)'
  9250 	aStream nextPutAll:(' in %1 processes (%2)'
  8775                                 bindWith:ignoredProcesses size
  9251 				bindWith:ignoredProcesses size
  8776                                 with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  9252 				with:((ignoredProcesses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  8777     ] ifFalse:[
  9253 	^ self.
  8778         ignoredReceiverClasses notNil ifTrue:[
  9254     ].
  8779             aStream nextPutAll:(' for %1 classes (%2)'
  9255     ignoredReceiverClasses notNil ifTrue:[
  8780                                 bindWith:ignoredReceiverClasses size
  9256 	aStream nextPutAll:(' for %1 classes (%2)'
  8781                                 with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', '))
  9257 			    bindWith:ignoredReceiverClasses size
  8782         ] ifFalse:[
  9258 			    with:((ignoredReceiverClasses collect:[:each | each name] as:OrderedCollection) asStringWith:', ')).
  8783             ignoreUntilShiftKeyPressed == true ifTrue:[
  9259 	^ self.
  8784                 aStream nextPutAll:' until shiftKey pressed'.
  9260     ].
  8785             ] ifFalse:[
  9261     ignoreUntilShiftKeyPressed == true ifTrue:[
  8786                 ignoreEndTime notNil ifTrue:[
  9262 	aStream nextPutAll:' until shiftKey pressed'.
  8787                     aStream nextPutAll:' until '.
  9263 	^ self.
  8788                     ignoreEndTime printOn:aStream.
  9264     ].
  8789                 ] ifFalse:[
  9265     ignoreEndTime notNil ifTrue:[
  8790                     (ignoreCount notNil) ifTrue:[
  9266 	aStream nextPutAll:' until '.
  8791                         (ignoreCount > 0) ifTrue:[
  9267 	ignoreEndTime printOn:aStream.
  8792                             aStream nextPutAll:' for '.
  9268 	^ self.
  8793                             ignoreCount printOn:aStream.
  9269     ].
  8794                         ] ifFalse:[
  9270     (ignoreCount notNil) ifTrue:[
  8795                             (ignoreCount < 0) ifTrue:[
  9271 	(ignoreCount > 0) ifTrue:[
  8796                                 aStream nextPutAll:' forEver'.
  9272 	    aStream nextPutAll:' for '.
  8797                             ] ifFalse:[
  9273 	    ignoreCount printOn:aStream.
  8798                                 aStream nextPutAll:' no longer'.
  9274 	    ^ self.
  8799                             ].
  9275 	].
  8800                         ].
  9276 	(ignoreCount < 0) ifTrue:[
  8801                     ]
  9277 	    aStream nextPutAll:' forEver'.
  8802                 ].
  9278 	    ^ self.
  8803             ].
  9279 	].
  8804         ].
  9280 	aStream nextPutAll:' no longer'.
  8805     ].
  9281     ].
  8806 
       
  8807     "Modified: / 27-01-2012 / 11:43:10 / cg"
       
  8808     "Created: / 06-03-2012 / 12:41:10 / cg"
       
  8809 ! !
  9282 ! !
  8810 
  9283 
  8811 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'!
  9284 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'queries'!
  8812 
  9285 
  8813 haltIgnoredInfoString
  9286 haltIgnoredInfoString
  8814     "some string describing why and how this halt is ignored;
  9287     "some string describing why and how this halt is ignored;
  8815      nil if not ignored"
  9288      nil if not ignored"
  8816 
  9289 
  8817     ^ String streamContents:[:s |
  9290     ^ String streamContents:[:s |
  8818         s nextPutAll:'ignored '.
  9291 	s nextPutAll:'ignored '.
  8819         self printConditionOn:s
  9292 	self printConditionOn:s
  8820     ].
  9293     ].
  8821 
  9294 
  8822     ignoreCount notNil ifTrue:[
  9295 "/    ignoreCount notNil ifTrue:[
  8823         ignoreCount > 0 ifTrue:[
  9296 "/        ignoreCount > 0 ifTrue:[
  8824             ^ '%1 more calls ignored' bindWith:ignoreCount
  9297 "/            ^ '%1 more calls ignored' bindWith:ignoreCount
  8825         ].
  9298 "/        ].
  8826         ^ nil
  9299 "/        ^ nil
  8827     ].
  9300 "/    ].
  8828     ignoreEndTime notNil ifTrue:[
  9301 "/    ignoreEndTime notNil ifTrue:[
  8829         (ignoreEndTime > Timestamp now) ifTrue:[
  9302 "/        (ignoreEndTime > Timestamp now) ifTrue:[
  8830             ^ 'ignored until %1' bindWith:ignoreEndTime
  9303 "/            ^ 'ignored until %1' bindWith:ignoreEndTime
  8831         ].
  9304 "/        ].
  8832         ^ nil
  9305 "/        ^ nil
  8833     ].
  9306 "/    ].
  8834     ignoreUntilShiftKeyPressed == true ifTrue:[
  9307 "/    ignoreUntilShiftKeyPressed == true ifTrue:[
  8835         Display shiftDown ifFalse:[
  9308 "/        Screen current shiftDown ifFalse:[
  8836             ^ 'ignored until shiftKey is pressed'
  9309 "/            ^ 'ignored until shiftKey is pressed'
  8837         ].
  9310 "/        ].
  8838         ^ nil
  9311 "/        ^ nil
  8839     ].
  9312 "/    ].
  8840     ignoredProcesses notNil ifTrue:[
  9313 "/    ignoredProcesses notNil ifTrue:[
  8841         ^ 'ignored in some processes'
  9314 "/        ^ 'ignored in some processes'
  8842     ].
  9315 "/    ].
  8843     ignoredReceiverClasses notNil ifTrue:[
  9316 "/    ignoredReceiverClasses notNil ifTrue:[
  8844         ^ 'ignored for some receiver classes'
  9317 "/        ^ 'ignored for some receiver classes'
  8845     ].
  9318 "/    ].
  8846 
  9319 "/
  8847     ^ 'ignored until reenabled'
  9320 "/    ^ 'ignored until reenabled'
  8848 
  9321 
  8849     "Modified: / 27-01-2012 / 11:35:48 / cg"
  9322     "Modified: / 27-01-2012 / 11:35:48 / cg"
  8850 !
  9323 !
  8851 
  9324 
  8852 isActive
  9325 isActive
  8853     "true if this ignore-entry is still active"
  9326     "true if this ignore-entry is still active"
  8854 
  9327 
  8855     ignoreEndTime notNil ifTrue:[
  9328     ignoreEndTime notNil ifTrue:[
  8856         ^ ignoreEndTime > Timestamp now
  9329 	^ ignoreEndTime > Timestamp now
  8857     ].
  9330     ].
  8858     ignoreCount notNil ifTrue:[
  9331     ignoreCount notNil ifTrue:[
  8859         ^ ignoreCount == -1 or:[ ignoreCount > 0 ]
  9332 	^ ignoreCount == -1 or:[ ignoreCount > 0 ]
  8860     ].
  9333     ].
  8861     ignoredProcesses notNil ifTrue:[
  9334     ignoredProcesses notNil ifTrue:[
  8862         ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]].
  9335 	ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]].
  8863         ignoredProcesses isEmpty ifTrue:[
  9336 	ignoredProcesses isEmpty ifTrue:[
  8864             ignoredProcesses := nil.
  9337 	    ignoredProcesses := nil.
  8865             ^ false
  9338 	    ^ false
  8866         ].
  9339 	].
  8867     ].
  9340     ].
  8868     ^ true
  9341     ^ true
  8869 
  9342 
  8870     "Created: / 06-03-2012 / 12:39:46 / cg"
  9343     "Created: / 06-03-2012 / 12:39:46 / cg"
  8871 !
  9344 !
  8886 
  9359 
  8887 isHaltIgnored
  9360 isHaltIgnored
  8888     "true if this halt should be ignored (sometimes)"
  9361     "true if this halt should be ignored (sometimes)"
  8889 
  9362 
  8890     ignoreUntilShiftKeyPressed == true ifTrue:[
  9363     ignoreUntilShiftKeyPressed == true ifTrue:[
  8891         ^ Display shiftDown not
  9364 	^ Screen current shiftDown not
  8892     ].
  9365     ].
  8893     ignoreCount notNil ifTrue:[
  9366     ignoreCount notNil ifTrue:[
  8894         ^ ignoreCount > 0
  9367 	^ ignoreCount > 0
  8895     ].
  9368     ].
  8896     ignoreEndTime notNil ifTrue:[
  9369     ignoreEndTime notNil ifTrue:[
  8897         ^ ignoreEndTime > Timestamp now
  9370 	^ ignoreEndTime > Timestamp now
  8898     ].
  9371     ].
  8899 
  9372 
  8900     ^ true
  9373     ^ true
  8901 
  9374 
  8902     "Modified: / 27-01-2012 / 11:36:01 / cg"
  9375     "Modified: / 27-01-2012 / 11:36:01 / cg"
  8926 
  9399 
  8927 method:methodArg lineNumber:lineNumberArg
  9400 method:methodArg lineNumber:lineNumberArg
  8928     "/ self assert:(methodArg mclass notNil).
  9401     "/ self assert:(methodArg mclass notNil).
  8929 
  9402 
  8930     methodArg == #all ifTrue:[
  9403     methodArg == #all ifTrue:[
  8931         weakMethodHolder := methodArg
  9404 	weakMethodHolder := methodArg
  8932     ] ifFalse:[
  9405     ] ifFalse:[
  8933         weakMethodHolder := WeakArray with:methodArg.
  9406 	weakMethodHolder := WeakArray with:methodArg.
  8934     ].
  9407     ].
  8935     lineNumber := lineNumberArg.
  9408     lineNumber := lineNumberArg.
  8936 
  9409 
  8937     "Modified: / 08-05-2011 / 10:28:41 / cg"
  9410     "Modified: / 08-05-2011 / 10:28:41 / cg"
  8938 ! !
  9411 ! !
  8941 
  9414 
  8942 printOn:aStream
  9415 printOn:aStream
  8943     |method|
  9416     |method|
  8944 
  9417 
  8945     (method := self method) isNil ifTrue:[
  9418     (method := self method) isNil ifTrue:[
  8946         aStream nextPutAll:'an obsolete IgnoredHalt'.
  9419 	aStream nextPutAll:'an obsolete IgnoredHalt'.
  8947         ^ self
  9420 	^ self
  8948     ].
  9421     ].
  8949 
  9422 
  8950     aStream nextPutAll:'Ignore '.
  9423     aStream nextPutAll:'Ignore '.
  8951     method isSymbol ifTrue:[
  9424     method isSymbol ifTrue:[
  8952         method printOn:aStream.
  9425 	method printOn:aStream.
  8953     ] ifFalse:[
  9426     ] ifFalse:[
  8954         method whoString printOn:aStream.
  9427 	method whoString printOn:aStream.
  8955     ].
  9428     ].
  8956     self printConditionOn:aStream.
  9429     self printConditionOn:aStream.
  8957 
  9430 
  8958     "Modified: / 27-07-2012 / 23:04:42 / cg"
  9431     "Modified: / 27-07-2012 / 23:04:42 / cg"
  8959 ! !
  9432 ! !
  8992 
  9465 
  8993     (self isForMethod:aMethod line:line) ifFalse:[^ false].
  9466     (self isForMethod:aMethod line:line) ifFalse:[^ false].
  8994     "/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored.
  9467     "/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored.
  8995 
  9468 
  8996     context notNil ifTrue:[
  9469     context notNil ifTrue:[
  8997         ignoredReceiverClasses notNil ifTrue:[
  9470 	ignoredReceiverClasses notNil ifTrue:[
  8998             ^ ignoredReceiverClasses includes:(context receiver class)
  9471 	    ^ ignoredReceiverClasses includes:(context receiver class)
  8999         ].
  9472 	].
  9000     ].
  9473     ].
  9001 
  9474 
  9002 "/    Transcript showCR:ignoredProcesses.
  9475 "/    Transcript showCR:ignoredProcesses.
  9003 "/    Transcript showCR:Processor activeProcess.
  9476 "/    Transcript showCR:Processor activeProcess.
  9004     ignoredProcesses notNil ifTrue:[
  9477     ignoredProcesses notNil ifTrue:[
  9005         ^ ignoredProcesses includes:(Processor activeProcess)
  9478 	^ ignoredProcesses includes:(Processor activeProcess)
  9006     ].
  9479     ].
  9007 
  9480     ignoredSendingClassAndSelectors notNil ifTrue:[
  9008     ^ self isHaltIgnored
  9481 	context withAllSendersDo:[:each |
       
  9482 	    |m className selector cls|
       
  9483 
       
  9484 	    (m := each method) notNil ifTrue:[
       
  9485 		cls := m mclass.
       
  9486 		cls notNil ifTrue:[
       
  9487 		    className := cls name.
       
  9488 		    selector := m selector.
       
  9489 		    (ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]])
       
  9490 			ifTrue:[^ true].
       
  9491 		].
       
  9492 	    ]
       
  9493 	]
       
  9494     ].
       
  9495 
       
  9496     ^ self isHaltIgnored  "/ unconditionally
  9009 ! !
  9497 ! !
  9010 
  9498 
  9011 !DebugView::IgnoredBreakpoint methodsFor:'accessing'!
  9499 !DebugView::IgnoredBreakpoint methodsFor:'accessing'!
  9012 
  9500 
  9013 parameter
  9501 parameter
  9042 ! !
  9530 ! !
  9043 
  9531 
  9044 !DebugView class methodsFor:'documentation'!
  9532 !DebugView class methodsFor:'documentation'!
  9045 
  9533 
  9046 version
  9534 version
  9047     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.640 2013-10-17 11:22:34 cg Exp $'
  9535     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.689 2015-03-02 13:39:16 cg Exp $'
  9048 !
  9536 !
  9049 
  9537 
  9050 version_CVS
  9538 version_CVS
  9051     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.640 2013-10-17 11:22:34 cg Exp $'
  9539     ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.689 2015-03-02 13:39:16 cg Exp $'
  9052 !
       
  9053 
       
  9054 version_HG
       
  9055 
       
  9056     ^ '$Changeset: <not expanded> $'
       
  9057 !
  9540 !
  9058 
  9541 
  9059 version_SVN
  9542 version_SVN
  9060     ^ '$Id: DebugView.st,v 1.640 2013-10-17 11:22:34 cg Exp $'
  9543     ^ '$Id: DebugView.st,v 1.689 2015-03-02 13:39:16 cg Exp $'
  9061 ! !
  9544 ! !
  9062 
  9545 
  9063 
  9546 
  9064 DebugView initialize!
  9547 DebugView initialize!