DebugView.st
changeset 17185 043fb3552c44
parent 17181 90ef84ba3a5a
child 17188 8f420441108e
child 17218 95008a0da101
equal deleted inserted replaced
17184:20a4ba15b83f 17185:043fb3552c44
     1 "{ Encoding: utf8 }"
     1 "{ Encoding: utf8 }"
     2 
     2 
     3 "
     3 "
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     5 	      All Rights Reserved
     5               All Rights Reserved
     6 
     6 
     7  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     8  only in accordance with the terms of that license and with the
     8  only in accordance with the terms of that license and with the
     9  inclusion of the above copyright notice.   This software may not
     9  inclusion of the above copyright notice.   This software may not
    10  be provided or otherwise made available to, or used by, any
    10  be provided or otherwise made available to, or used by, any
    14 "{ Package: 'stx:libtool' }"
    14 "{ Package: 'stx:libtool' }"
    15 
    15 
    16 "{ NameSpace: Smalltalk }"
    16 "{ NameSpace: Smalltalk }"
    17 
    17 
    18 StandardSystemView subclass:#DebugView
    18 StandardSystemView subclass:#DebugView
    19 	instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
    19         instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
    20 		receiverInspector contextInspector contextArray selectedContext
    20                 receiverInspector contextInspector contextArray selectedContext
    21 		catchBlock grabber mayProceed traceView tracing bigStep
    21                 catchBlock grabber mayProceed traceView tracing bigStep
    22 		skipLineNr abortButton terminateButton continueButton stepButton
    22                 skipLineNr abortButton terminateButton continueButton stepButton
    23 		nextButton nextOverButton nextOutButton sendButton returnButton
    23                 nextButton nextOverButton nextOutButton sendButton returnButton
    24 		restartButton exclusive inspecting nChainShown inspectedProcess
    24                 restartButton exclusive inspecting nChainShown inspectedProcess
    25 		updateProcess updateButton defineButton monitorToggle stepping
    25                 updateProcess updateButton defineButton monitorToggle stepping
    26 		steppedContextLineno actualContext inWrap stackInspector
    26                 steppedContextLineno actualContext inWrap stackInspector
    27 		steppedContext wrapperContext firstContext stepHow cachable
    27                 steppedContext wrapperContext firstContext stepHow cachable
    28 		currentMethod ignoreBreakpoints stepUntilEntering
    28                 currentMethod ignoreBreakpoints stepUntilEntering
    29 		lastStepUntilEntering lastSelectionInReceiverInspector
    29                 lastStepUntilEntering lastSelectionInReceiverInspector
    30 		lastSelectionInContextInspector canShowMore reportButton
    30                 lastSelectionInContextInspector canShowMore reportButton
    31 		setOfHiddenCallingSelectors isStoppedAtHaltOrBreakPoint
    31                 setOfHiddenCallingSelectors isStoppedAtHaltOrBreakPoint
    32 		exceptionInfoLabel methodCodeToggle
    32                 exceptionInfoLabel methodCodeToggle
    33 		methodCodeToggleSelectionHolder
    33                 methodCodeToggleSelectionHolder
    34 		isStoppedAtBreakPointWithParameter breakPointParameter
    34                 isStoppedAtBreakPointWithParameter breakPointParameter
    35 		hideSupportCode contextInfoLabel resendButton
    35                 hideSupportCode contextInfoLabel resendButton
    36 		gotoDialogOpenerButton isStoppedInModalDialog selectorToDefine
    36                 gotoDialogOpenerButton isStoppedInModalDialog selectorToDefine
    37 		classToDefineIn gotoApplicationActionMethodButton
    37                 classToDefineIn gotoApplicationActionMethodButton
    38 		isStoppedInApplicationAction isStoppedAtStatementBreakpoint
    38                 isStoppedInApplicationAction isStoppedAtStatementBreakpoint
    39 		verboseBacktraceHolder'
    39                 verboseBacktraceHolder'
    40 	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
    40         classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
    41 		DebuggingDebugger DebuggingDebugger2 DebuggingContextWalk
    41                 DebuggingDebugger DebuggingDebugger2 DebuggingContextWalk
    42 		DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts
    42                 DefaultDebuggerBackgroundColor InitialNChainShown IgnoredHalts
    43 		ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration
    43                 ShowThreadID LastIgnoreHaltNTimes LastIgnoreHaltDuration
    44 		LastExtent LastOrigin RememberedCallChain DebuggingDebugger3
    44                 LastExtent LastOrigin RememberedCallChain DebuggingDebugger3
    45 		NumberOfDebuggers DebuggerOnMainDisplayOnly'
    45                 NumberOfDebuggers DebuggerOnMainDisplayOnly'
    46 	poolDictionaries:''
    46         poolDictionaries:''
    47 	category:'Interface-Debugger'
    47         category:'Interface-Debugger'
    48 !
    48 !
    49 
    49 
    50 Object subclass:#IgnoredHaltOrBreakpoint
    50 Object subclass:#IgnoredHaltOrBreakpoint
    51 	instanceVariableNames:'ignoreEndTime ignoreCount ignoreUntilShiftKeyPressed
    51         instanceVariableNames:'ignoreEndTime ignoreCount ignoreUntilShiftKeyPressed
    52 		ignoredReceiverClasses ignoredProcesses
    52                 ignoredReceiverClasses ignoredProcesses
    53 		ignoredSendingClassAndSelectors'
    53                 ignoredSendingClassAndSelectors'
    54 	classVariableNames:''
    54         classVariableNames:''
    55 	poolDictionaries:''
    55         poolDictionaries:''
    56 	privateIn:DebugView
    56         privateIn:DebugView
    57 !
    57 !
    58 
    58 
    59 DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredHalt
    59 DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredHalt
    60 	instanceVariableNames:'weakMethodHolder lineNumber'
    60         instanceVariableNames:'weakMethodHolder lineNumber'
    61 	classVariableNames:''
    61         classVariableNames:''
    62 	poolDictionaries:''
    62         poolDictionaries:''
    63 	privateIn:DebugView
    63         privateIn:DebugView
    64 !
    64 !
    65 
    65 
    66 DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredBreakpoint
    66 DebugView::IgnoredHaltOrBreakpoint subclass:#IgnoredBreakpoint
    67 	instanceVariableNames:'parameter'
    67         instanceVariableNames:'parameter'
    68 	classVariableNames:''
    68         classVariableNames:''
    69 	poolDictionaries:''
    69         poolDictionaries:''
    70 	privateIn:DebugView
    70         privateIn:DebugView
    71 !
    71 !
    72 
    72 
    73 !DebugView class methodsFor:'documentation'!
    73 !DebugView class methodsFor:'documentation'!
    74 
    74 
    75 copyright
    75 copyright
    76 "
    76 "
    77  COPYRIGHT (c) 1989 by Claus Gittinger
    77  COPYRIGHT (c) 1989 by Claus Gittinger
    78 	      All Rights Reserved
    78               All Rights Reserved
    79 
    79 
    80  This software is furnished under a license and may be used
    80  This software is furnished under a license and may be used
    81  only in accordance with the terms of that license and with the
    81  only in accordance with the terms of that license and with the
    82  inclusion of the above copyright notice.   This software may not
    82  inclusion of the above copyright notice.   This software may not
    83  be provided or otherwise made available to, or used by, any
    83  be provided or otherwise made available to, or used by, any
   110     will sit on an exclusive display connection.
   110     will sit on an exclusive display connection.
   111 
   111 
   112     See additional information in 'doc/misc/debugger.doc'.
   112     See additional information in 'doc/misc/debugger.doc'.
   113 
   113 
   114     Notice & Warning (attention when changing thingslike menus, window spec etc. here):
   114     Notice & Warning (attention when changing thingslike menus, window spec etc. here):
   115 	the DebugView class caches the last used debugger in a class variable,
   115         the DebugView class caches the last used debugger in a class variable,
   116 	and hides/shows this window without recreating one from scratch. This is done to make
   116         and hides/shows this window without recreating one from scratch. This is done to make
   117 	the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint.
   117         the debugger come up faster when single stepping, or hopping from breakpoint to breakpoint.
   118 
   118 
   119 	It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one)
   119         It may happen, that a malfunctioning debugger (for example, a halfway created/destroyed one)
   120 	is kept there. You will notice this, if a debugger comes up without showing any contents.
   120         is kept there. You will notice this, if a debugger comes up without showing any contents.
   121 	In this case, close (or destroy) the broken debugView, and execute
   121         In this case, close (or destroy) the broken debugView, and execute
   122 	    Debugger newDebugger
   122             Debugger newDebugger
   123 	which removes the cached debugger and forces creation of a new one the next time.
   123         which removes the cached debugger and forces creation of a new one the next time.
   124 	This is a temporary workaround - the debugger should be fixed to avoid this situation.
   124         This is a temporary workaround - the debugger should be fixed to avoid this situation.
   125 
   125 
   126 	You must also flush the cached debugger, if you change the debugger's
   126         You must also flush the cached debugger, if you change the debugger's
   127 	initialization code (buttons, menu, etc.) or the debugger's class layout,
   127         initialization code (buttons, menu, etc.) or the debugger's class layout,
   128 	and you want the new code to become effective.
   128         and you want the new code to become effective.
   129 
   129 
   130     [author:]
   130     [author:]
   131 	Claus Gittinger
   131         Claus Gittinger
   132 
   132 
   133     [see also:]
   133     [see also:]
   134 	Exception Signal
   134         Exception Signal
   135 	Process
   135         Process
   136 "
   136 "
   137 ! !
   137 ! !
   138 
   138 
   139 !DebugView class methodsFor:'initialization'!
   139 !DebugView class methodsFor:'initialization'!
   140 
   140 
   260     "the information (if any) about the ignore-state of a halt"
   260     "the information (if any) about the ignore-state of a halt"
   261 
   261 
   262     IgnoredHalts isNil ifTrue:[^ nil].
   262     IgnoredHalts isNil ifTrue:[^ nil].
   263 
   263 
   264     IgnoredHalts do:[:ign |
   264     IgnoredHalts do:[:ign |
   265 	(ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
   265         (ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
   266 	"/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod)
   266         "/ (ign isHaltIgnoredInMethod:haltingMethod line:lineNrInHaltingMethod)
   267 	ifTrue:[
   267         ifTrue:[
   268 	    ^ ign
   268             ^ ign
   269 	].
   269         ].
   270     ].
   270     ].
   271     ^ nil.
   271     ^ nil.
   272 !
   272 !
   273 
   273 
   274 hasIgnoredHalts
   274 hasIgnoredHalts
   275     self removeInactiveIgnores.
   275     self removeInactiveIgnores.
   276     ^ IgnoredHalts notEmptyOrNil
   276     ^ IgnoredHalts notEmptyOrNil
   277 !
   277 !
   278 
   278 
   279 ignoreBreakpointWithParameter:parameterOrNil
   279 ignoreBreakpointWithParameter:parameterOrNil
   280 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   280         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   281 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   281         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   282 
   282 
   283     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   283     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   284      or until some time has elapsed.
   284      or until some time has elapsed.
   285      With nil count and time arguments, such an ignored breakpoint is reactivated"
   285      With nil count and time arguments, such an ignored breakpoint is reactivated"
   286 
   286 
   287     self
   287     self
   288 	ignoreHaltOrBreakpoint:#halt
   288         ignoreHaltOrBreakpoint:#halt
   289 	method:nil line:nil
   289         method:nil line:nil
   290 	parameter:parameterOrNil
   290         parameter:parameterOrNil
   291 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   291         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   292 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   292         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   293 	orIfCalledFromMethod:nil
   293         orIfCalledFromMethod:nil
   294 !
   294 !
   295 
   295 
   296 ignoreHaltIn:haltingMethod at:lineNrOfHalt
   296 ignoreHaltIn:haltingMethod at:lineNrOfHalt
   297 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   297         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   298 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   298         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   299 
   299 
   300     "remember to ignore a halt in some method for some number of invocations
   300     "remember to ignore a halt in some method for some number of invocations
   301      or until some time has elapsed.
   301      or until some time has elapsed.
   302      With nil count and time arguments, such an ignored halt is reactivated"
   302      With nil count and time arguments, such an ignored halt is reactivated"
   303 
   303 
   304     self
   304     self
   305 	ignoreHaltOrBreakpoint:#halt
   305         ignoreHaltOrBreakpoint:#halt
   306 	method:haltingMethod line:lineNrOfHalt
   306         method:haltingMethod line:lineNrOfHalt
   307 	parameter:nil
   307         parameter:nil
   308 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   308         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   309 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   309         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   310 	orIfCalledFromMethod:nil
   310         orIfCalledFromMethod:nil
   311 !
   311 !
   312 
   312 
   313 ignoreHaltIn:haltingMethod at:lineNrOfHalt
   313 ignoreHaltIn:haltingMethod at:lineNrOfHalt
   314         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   314         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   315         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   315         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   329         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   329         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   330         orIfCalledFromMethod:ifCalledForMethodOrNil
   330         orIfCalledFromMethod:ifCalledForMethodOrNil
   331 !
   331 !
   332 
   332 
   333 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
   333 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
   334 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   334         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   335 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   335         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   336 
   336 
   337     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   337     "remember to ignore a breakpoint with a parameter (i.e. breakpoint:#cg) for some number of invocations
   338      or until some time has elapsed.
   338      or until some time has elapsed.
   339      With nil count and time arguments, such an ignored breakpoint is reactivated"
   339      With nil count and time arguments, such an ignored breakpoint is reactivated"
   340 
   340 
   341     ^ self
   341     ^ self
   342 	ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
   342         ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
   343 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   343         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   344 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
   344         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   345 	orIfCalledFromMethod:nil
   345         orIfCalledFromMethod:nil
   346 !
   346 !
   347 
   347 
   348 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
   348 ignoreHaltOrBreakpoint:type method:methodOrNil line:lineNrOfHaltOrNil parameter:parameterOrNil
   349         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   349         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
   350         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   350         orReceiverClass:receiverClassOrNil orProcess:processOrNil
   427 
   427 
   428     IgnoredHalts isNil ifTrue:[^ false].
   428     IgnoredHalts isNil ifTrue:[^ false].
   429 
   429 
   430     "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString.
   430     "/ Transcript showCR:'halt/break in ',haltingMethod printString,' at ',lineNrInHaltingMethod printString.
   431     IgnoredHalts do:[:ign |
   431     IgnoredHalts do:[:ign |
   432 	(ign isForBreakpointWithParameter:parameter) ifTrue:[
   432         (ign isForBreakpointWithParameter:parameter) ifTrue:[
   433 	    Transcript show:'Debugger [info]: break ignored for ', parameter.
   433             Transcript show:'Debugger [info]: break ignored for ', parameter.
   434 
   434 
   435 	    modifyCount ifTrue:[ ign decrementIgnoreCount ].
   435             modifyCount ifTrue:[ ign decrementIgnoreCount ].
   436 	    ign isHaltIgnored ifFalse:[
   436             ign isHaltIgnored ifFalse:[
   437 		Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter.
   437                 Transcript showCR:'Debugger [info]: no longer ignore breakpoint for ', parameter.
   438 		IgnoredHalts remove:ign ifAbsent:[].
   438                 IgnoredHalts remove:ign ifAbsent:[].
   439 	    ].
   439             ].
   440 	    ^ true.
   440             ^ true.
   441 	].
   441         ].
   442     ].
   442     ].
   443 
   443 
   444     IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty.
   444     IgnoredHalts := (IgnoredHalts reject:[:ign | ign isActive not ]) asNilIfEmpty.
   445 
   445 
   446     ^ false.
   446     ^ false.
   474     "Modified (comment): / 06-03-2012 / 12:51:43 / cg"
   474     "Modified (comment): / 06-03-2012 / 12:51:43 / cg"
   475 !
   475 !
   476 
   476 
   477 removeInactiveIgnores
   477 removeInactiveIgnores
   478     IgnoredHalts notNil ifTrue:[
   478     IgnoredHalts notNil ifTrue:[
   479 	IgnoredHalts := IgnoredHalts select:[:i | i isActive].
   479         IgnoredHalts := IgnoredHalts select:[:i | i isActive].
   480     ].
   480     ].
   481 !
   481 !
   482 
   482 
   483 stopIgnoringHalts
   483 stopIgnoringHalts
   484     "forget about all ignored halts"
   484     "forget about all ignored halts"
   492      effectively reenables the breakpoint/halt"
   492      effectively reenables the breakpoint/halt"
   493 
   493 
   494     IgnoredHalts isNil ifTrue:[^ self].
   494     IgnoredHalts isNil ifTrue:[^ self].
   495 
   495 
   496     IgnoredHalts := IgnoredHalts reject:[:ign |
   496     IgnoredHalts := IgnoredHalts reject:[:ign |
   497 	(ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
   497         (ign isForMethod:haltingMethod line:lineNrInHaltingMethod)
   498     ].
   498     ].
   499 ! !
   499 ! !
   500 
   500 
   501 !DebugView class methodsFor:'instance creation / entering'!
   501 !DebugView class methodsFor:'instance creation / entering'!
   502 
   502 
   504     "enter a debugger"
   504     "enter a debugger"
   505 
   505 
   506     <context: #return>
   506     <context: #return>
   507 
   507 
   508     ^ self
   508     ^ self
   509 	enter:thisContext sender
   509         enter:thisContext sender
   510 	withMessage:'Debugger Entered'
   510         withMessage:'Debugger Entered'
   511 	mayProceed:true.
   511         mayProceed:true.
   512 !
   512 !
   513 
   513 
   514 enter:aContext withMessage:aString
   514 enter:aContext withMessage:aString
   515     "enter a debugger"
   515     "enter a debugger"
   516 
   516 
   517     <context: #return>
   517     <context: #return>
   518 
   518 
   519     ^ self
   519     ^ self
   520 	enter:aContext
   520         enter:aContext
   521 	withMessage:aString
   521         withMessage:aString
   522 	mayProceed:true
   522         mayProceed:true
   523 !
   523 !
   524 
   524 
   525 enter:aContext withMessage:aString mayProceed:mayProceed
   525 enter:aContext withMessage:aString mayProceed:mayProceed
   526     "enter a debugger; if this is a recursive invocation, enter
   526     "enter a debugger; if this is a recursive invocation, enter
   527      a MiniDebugger instead.
   527      a MiniDebugger instead.
   618     NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1.
   618     NumberOfDebuggers := (NumberOfDebuggers ? 0) + 1.
   619 
   619 
   620     "/ ignore halts & breakpoints while setting up the debugger
   620     "/ ignore halts & breakpoints while setting up the debugger
   621     "/ to avoid recursive debugging ...
   621     "/ to avoid recursive debugging ...
   622     ControlInterrupt handle:[:ex |
   622     ControlInterrupt handle:[:ex |
   623 	'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR.
   623         'DebugView [info]: breakpoint in debugger setup ignored [enterUncond.]' infoPrintCR.
   624 	('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR.
   624         ('DebugView [info]: breakpoint on:' , ex suspendedContext printString) infoPrintCR.
   625 	ex proceed
   625         ex proceed
   626     ] do:[
   626     ] do:[
   627 	aDebugger := self new.
   627         aDebugger := self new.
   628     ].
   628     ].
   629 
   629 
   630     aDebugger isNil ifTrue:[
   630     aDebugger isNil ifTrue:[
   631 	'DebugView [error]: cannot open debugger' errorPrintCR.
   631         'DebugView [error]: cannot open debugger' errorPrintCR.
   632 	'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR.
   632         'DebugView [error]: Exception: ' errorPrint. aString errorPrintCR.
   633 	mayProceed ifTrue:[
   633         mayProceed ifTrue:[
   634 	    (Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs
   634             (Dialog confirm:'Error/Breakpoint caught.\\Press Continue or Abort.' withCRs
   635 		   yesLabel:'Continue' noLabel:'Abort')
   635                    yesLabel:'Continue' noLabel:'Abort')
   636 	    ifTrue:[
   636             ifTrue:[
   637 		^ nil
   637                 ^ nil
   638 	    ].
   638             ].
   639 	] ifFalse:[
   639         ] ifFalse:[
   640 	    self information:'Error caught.\\Press OK to abort the operation.' withCRs.
   640             self information:'Error caught.\\Press OK to abort the operation.' withCRs.
   641 	].
   641         ].
   642 	AbortOperationRequest raise.
   642         AbortOperationRequest raise.
   643 	"not reached"
   643         "not reached"
   644     ].
   644     ].
   645 
   645 
   646     aDebugger mayProceed:mayProceed.
   646     aDebugger mayProceed:mayProceed.
   647     aDebugger setLabelFor:aString in:Processor activeProcess.
   647     aDebugger setLabelFor:aString in:Processor activeProcess.
   648     aDebugger enter:aContext select:nil.
   648     aDebugger enter:aContext select:nil.
   649     ^ nil.
   649     ^ nil.
   650 
   650 
   651     "
   651     "
   652 	nil halt
   652         nil halt
   653     "
   653     "
   654 
   654 
   655     "Modified: / 18.11.2001 / 00:29:23 / cg"
   655     "Modified: / 18.11.2001 / 00:29:23 / cg"
   656 !
   656 !
   657 
   657 
   659     "enter a debugger"
   659     "enter a debugger"
   660 
   660 
   661     <context: #return>
   661     <context: #return>
   662 
   662 
   663     ^ self
   663     ^ self
   664 	enter:(thisContext sender)
   664         enter:(thisContext sender)
   665 	withMessage:message
   665         withMessage:message
   666 	mayProceed:true.
   666         mayProceed:true.
   667 !
   667 !
   668 
   668 
   669 new
   669 new
   670     "return a new DebugView.
   670     "return a new DebugView.
   671      - return a cached debugger if it already exists.
   671      - return a cached debugger if it already exists.
   675     |debugger currentScreen debuggerScreen|
   675     |debugger currentScreen debuggerScreen|
   676 
   676 
   677     currentScreen := Screen current.
   677     currentScreen := Screen current.
   678 
   678 
   679     currentScreen notNil ifTrue:[
   679     currentScreen notNil ifTrue:[
   680 	(currentScreen suppressDebugger) ifTrue:[
   680         (currentScreen suppressDebugger) ifTrue:[
   681 	    "/ no debuggers with that device - show an alertBox which aborts...
   681             "/ no debuggers with that device - show an alertBox which aborts...
   682 	    ^ nil.
   682             ^ nil.
   683 	].
   683         ].
   684 	(currentScreen mayOpenDebugger) ifFalse:[
   684         (currentScreen mayOpenDebugger) ifFalse:[
   685 	    "/ no debugger on that device - but on the main screen
   685             "/ no debugger on that device - but on the main screen
   686 	    currentScreen := Display ? Screen default.
   686             currentScreen := Display ? Screen default.
   687 	].
   687         ].
   688     ].
   688     ].
   689 
   689 
   690     "
   690     "
   691      need a blocking debugger if no processes or
   691      need a blocking debugger if no processes or
   692      or if its a timing/interrupt process
   692      or if its a timing/interrupt process
   693      (because otherwise we would not get any events here ...
   693      (because otherwise we would not get any events here ...
   694     "
   694     "
   695     Processor activeProcessIsSystemProcess ifTrue:[
   695     Processor activeProcessIsSystemProcess ifTrue:[
   696 	((debugger := CachedExclusive) isNil
   696         ((debugger := CachedExclusive) isNil
   697 	or:[debugger device ~~ currentScreen
   697         or:[debugger device ~~ currentScreen
   698 	or:[currentScreen isNil
   698         or:[currentScreen isNil
   699 	or:[currentScreen isOpen not]]]) ifTrue:[
   699         or:[currentScreen isOpen not]]]) ifTrue:[
   700 	    debugger := self newExclusive
   700             debugger := self newExclusive
   701 	].
   701         ].
   702 	CachedExclusive := nil.
   702         CachedExclusive := nil.
   703     ] ifFalse:[
   703     ] ifFalse:[
   704 	CachedDebugger notNil ifTrue:[
   704         CachedDebugger notNil ifTrue:[
   705 	    (CachedDebugger device ~~ currentScreen
   705             (CachedDebugger device ~~ currentScreen
   706 	    or:[currentScreen isNil
   706             or:[currentScreen isNil
   707 	    or:[currentScreen isOpen not
   707             or:[currentScreen isOpen not
   708 	    or:[CachedDebugger class ~~ self]]]) ifTrue:[
   708             or:[CachedDebugger class ~~ self]]]) ifTrue:[
   709 		CachedDebugger := nil
   709                 CachedDebugger := nil
   710 	    ]
   710             ]
   711 	].
   711         ].
   712 
   712 
   713 	(debugger := CachedDebugger) notNil ifTrue:[
   713         (debugger := CachedDebugger) notNil ifTrue:[
   714 	    CachedDebugger := nil.
   714             CachedDebugger := nil.
   715 	] ifFalse:[
   715         ] ifFalse:[
   716 	    debuggerScreen := currentScreen.
   716             debuggerScreen := currentScreen.
   717 	    debuggerScreen isNil ifTrue:[
   717             debuggerScreen isNil ifTrue:[
   718 		"/ use the default display
   718                 "/ use the default display
   719 		debuggerScreen := Screen default.
   719                 debuggerScreen := Screen default.
   720 	    ].
   720             ].
   721 	    (debuggerScreen isNil
   721             (debuggerScreen isNil
   722 	    or:[debuggerScreen isOpen not
   722             or:[debuggerScreen isOpen not
   723 	    "/ or:[debuggerDevice mayOpenDebugger not]
   723             "/ or:[debuggerDevice mayOpenDebugger not]
   724 	    ]) ifTrue:[
   724             ]) ifTrue:[
   725 		"/ no debugger
   725                 "/ no debugger
   726 		^ nil.
   726                 ^ nil.
   727 	    ].
   727             ].
   728 
   728 
   729 	    Screen currentScreenQuerySignal answer:debuggerScreen
   729             Screen currentScreenQuerySignal answer:debuggerScreen
   730 	    do:[
   730             do:[
   731 		debugger := super new.
   731                 debugger := super new.
   732 	    ].
   732             ].
   733 	    debugger label:'Debugger'.
   733             debugger label:'Debugger'.
   734 	    debugger icon:self defaultIcon.
   734             debugger icon:self defaultIcon.
   735 	]
   735         ]
   736     ].
   736     ].
   737     ^ debugger
   737     ^ debugger
   738 
   738 
   739     "Modified: 31.7.1997 / 21:20:27 / cg"
   739     "Modified: 31.7.1997 / 21:20:27 / cg"
   740 !
   740 !
   765      in this case, return to it. This happens, when a stepping process
   765      in this case, return to it. This happens, when a stepping process
   766      runs into an error (for example, a halt). In this case, we want the
   766      runs into an error (for example, a halt). In this case, we want the
   767      stepping debugger to come up again instead of a new one.
   767      stepping debugger to come up again instead of a new one.
   768     "
   768     "
   769     OpenDebuggers notNil ifTrue:[
   769     OpenDebuggers notNil ifTrue:[
   770 	active := Processor activeProcess.
   770         active := Processor activeProcess.
   771 	OpenDebuggers do:[:aDebugger |
   771         OpenDebuggers do:[:aDebugger |
   772 	    |debuggersProcess|
   772             |debuggersProcess|
   773 
   773 
   774 	    (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[
   774             (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[
   775 		debuggersProcess := aDebugger inspectedProcess.
   775                 debuggersProcess := aDebugger inspectedProcess.
   776 		debuggersProcess == active ifTrue:[
   776                 debuggersProcess == active ifTrue:[
   777 		    aDebugger device isOpen ifTrue:[
   777                     aDebugger device isOpen ifTrue:[
   778 			DebuggingDebugger == true ifTrue:[
   778                         DebuggingDebugger == true ifTrue:[
   779 			    'reusing cached debugger' errorPrintCR.
   779                             'reusing cached debugger' errorPrintCR.
   780 			].
   780                         ].
   781 			aDebugger unstep.
   781                         aDebugger unstep.
   782 			^ aDebugger.
   782                         ^ aDebugger.
   783 		    ]
   783                     ]
   784 		].
   784                 ].
   785 		(debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[
   785                 (debuggersProcess notNil and:[ debuggersProcess isDead ]) ifTrue:[
   786 		    aDebugger destroy.
   786                     aDebugger destroy.
   787 		].
   787                 ].
   788 	    ]
   788             ]
   789 	]
   789         ]
   790     ].
   790     ].
   791     ^ nil
   791     ^ nil
   792 
   792 
   793     "Created: / 06-11-2013 / 20:57:49 / cg"
   793     "Created: / 06-11-2013 / 20:57:49 / cg"
   794 !
   794 !
   800     |aDebugger label nm|
   800     |aDebugger label nm|
   801 
   801 
   802     aDebugger := super new.
   802     aDebugger := super new.
   803     aDebugger icon:self defaultIcon.
   803     aDebugger icon:self defaultIcon.
   804     aProcess notNil ifTrue:[
   804     aProcess notNil ifTrue:[
   805 	nm := aProcess name.
   805         nm := aProcess name.
   806 	nm notNil ifTrue:[
   806         nm notNil ifTrue:[
   807 	    nm := (nm contractTo:17) , '-' , aProcess id printString
   807             nm := (nm contractTo:17) , '-' , aProcess id printString
   808 	] ifFalse:[
   808         ] ifFalse:[
   809 	    nm := aProcess id printString
   809             nm := aProcess id printString
   810 	].
   810         ].
   811 	label := 'Debugger [' , nm , ']'.
   811         label := 'Debugger [' , nm , ']'.
   812     ] ifFalse:[
   812     ] ifFalse:[
   813 	label := 'no process'
   813         label := 'no process'
   814     ].
   814     ].
   815     aDebugger label:label iconLabel:'Debugger'.
   815     aDebugger label:label iconLabel:'Debugger'.
   816     aDebugger openOn:aProcess.
   816     aDebugger openOn:aProcess.
   817     ^ nil
   817     ^ nil
   818 
   818 
   836 
   836 
   837     <resource: #menu>
   837     <resource: #menu>
   838 
   838 
   839     ^
   839     ^
   840      #(Menu
   840      #(Menu
   841 	(
   841         (
   842 	 (MenuItem
   842          (MenuItem
   843 	    enabled: canRemoveBreakpoint
   843             enabled: canRemoveBreakpoint
   844 	    label: 'Remove Breakpoint'
   844             label: 'Remove Breakpoint'
   845 	    itemValue: removeBreakpoint
   845             itemValue: removeBreakpoint
   846 	  )
   846           )
   847 	 (MenuItem
   847          (MenuItem
   848 	    label: 'Remove all Breakpoints'
   848             label: 'Remove all Breakpoints'
   849 	    itemValue: removeAllBreakpoints
   849             itemValue: removeAllBreakpoints
   850 	  )
   850           )
   851 	 (MenuItem
   851          (MenuItem
   852 	    label: '-'
   852             label: '-'
   853 	  )
   853           )
   854 	 (MenuItem
   854          (MenuItem
   855 	    label: 'Ignore this Halt/BreakPoint'
   855             label: 'Ignore this Halt/BreakPoint'
   856 	    submenu:
   856             submenu:
   857 	   (Menu
   857            (Menu
   858 	      (
   858               (
   859 	       (MenuItem
   859                (MenuItem
   860 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   860                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   861 		  label: 'Forever (Until Ignoring is Stopped)'
   861                   label: 'Forever (Until Ignoring is Stopped)'
   862 		  itemValue: ignoreHaltForever
   862                   itemValue: ignoreHaltForever
   863 		)
   863                 )
   864 	       (MenuItem
   864                (MenuItem
   865 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   865                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   866 		  label: 'For Some Time...'
   866                   label: 'For Some Time...'
   867 		  itemValue: openIgnoreHaltUntilTimeElapsedDialog
   867                   itemValue: openIgnoreHaltUntilTimeElapsedDialog
   868 		)
   868                 )
   869 	       (MenuItem
   869                (MenuItem
   870 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   870                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   871 		  label: 'For the Next N Times...'
   871                   label: 'For the Next N Times...'
   872 		  itemValue: openIgnoreHaltNTimesDialog
   872                   itemValue: openIgnoreHaltNTimesDialog
   873 		)
   873                 )
   874 	       (MenuItem
   874                (MenuItem
   875 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   875                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   876 		  label: 'Until Shift-Key is Pressed'
   876                   label: 'Until Shift-Key is Pressed'
   877 		  itemValue: ignoreHaltUntilShiftKeyIsPressed
   877                   itemValue: ignoreHaltUntilShiftKeyIsPressed
   878 		)
   878                 )
   879 	       (MenuItem
   879                (MenuItem
   880 		  label: '-'
   880                   label: '-'
   881 		)
   881                 )
   882 	       (MenuItem
   882                (MenuItem
   883 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   883                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   884 		  label: 'In Current Process'
   884                   label: 'In Current Process'
   885 		  itemValue: ignoreHaltForCurrentProcess
   885                   itemValue: ignoreHaltForCurrentProcess
   886 		)
   886                 )
   887 	       (MenuItem
   887                (MenuItem
   888 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   888                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   889 		  label: 'For this Receiver Class'
   889                   label: 'For this Receiver Class'
   890 		  itemValue: ignoreHaltForThisReceiverClass
   890                   itemValue: ignoreHaltForThisReceiverClass
   891 		)
   891                 )
   892 	       (MenuItem
   892                (MenuItem
   893 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   893                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   894 		  label: 'If Called from Any Of'
   894                   label: 'If Called from Any Of'
   895 		  submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf
   895                   submenuChannel: menuForIgnoreBreakpointIfCalledFromAnyOf
   896 		)
   896                 )
   897 	       )
   897                )
   898 	      nil
   898               nil
   899 	      nil
   899               nil
   900 	    )
   900             )
   901 	  )
   901           )
   902 	 (MenuItem
   902          (MenuItem
   903 	    enabled: isStoppedAtBreakPointWithParameter
   903             enabled: isStoppedAtBreakPointWithParameter
   904 	    label: 'Ignore all BreakPoints with this Parameter'
   904             label: 'Ignore all BreakPoints with this Parameter'
   905 	    submenu:
   905             submenu:
   906 	   (Menu
   906            (Menu
   907 	      (
   907               (
   908 	       (MenuItem
   908                (MenuItem
   909 		  enabled: isStoppedAtBreakPointWithParameter
   909                   enabled: isStoppedAtBreakPointWithParameter
   910 		  label: 'Forever (Reenable in BreakPoint-Browser)'
   910                   label: 'Forever (Reenable in BreakPoint-Browser)'
   911 		  itemValue: ignoreBreakpointsWithThisParameterForever
   911                   itemValue: ignoreBreakpointsWithThisParameterForever
   912 		)
   912                 )
   913 	       (MenuItem
   913                (MenuItem
   914 		  enabled: isStoppedAtBreakPointWithParameter
   914                   enabled: isStoppedAtBreakPointWithParameter
   915 		  label: 'For Some Time...'
   915                   label: 'For Some Time...'
   916 		  itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
   916                   itemValue: openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
   917 		)
   917                 )
   918 	       (MenuItem
   918                (MenuItem
   919 		  enabled: isStoppedAtBreakPointWithParameter
   919                   enabled: isStoppedAtBreakPointWithParameter
   920 		  label: 'For the Next N Times...'
   920                   label: 'For the Next N Times...'
   921 		  itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog
   921                   itemValue: openIgnoreBreakpointsWithThisParameterNTimesDialog
   922 		)
   922                 )
   923 	       (MenuItem
   923                (MenuItem
   924 		  enabled: isStoppedAtBreakPointWithParameter
   924                   enabled: isStoppedAtBreakPointWithParameter
   925 		  label: 'Until Shift-Key is Pressed'
   925                   label: 'Until Shift-Key is Pressed'
   926 		  itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
   926                   itemValue: ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
   927 		)
   927                 )
   928 	       (MenuItem
   928                (MenuItem
   929 		  label: '-'
   929                   label: '-'
   930 		)
   930                 )
   931 	       (MenuItem
   931                (MenuItem
   932 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   932                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   933 		  label: 'In Current Process'
   933                   label: 'In Current Process'
   934 		  itemValue: ignoreAllHaltsForCurrentProcess
   934                   itemValue: ignoreAllHaltsForCurrentProcess
   935 		)
   935                 )
   936 	       (MenuItem
   936                (MenuItem
   937 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   937                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   938 		  label: 'For this Receiver Class'
   938                   label: 'For this Receiver Class'
   939 		  itemValue: ignoreAllHaltsForThisReceiverClass
   939                   itemValue: ignoreAllHaltsForThisReceiverClass
   940 		)
   940                 )
   941 	       (MenuItem
   941                (MenuItem
   942 		  enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   942                   enabled: isStoppedAtHaltOrBreakPointOrSelectedContextIsWrapped
   943 		  label: 'If Called from Any Of'
   943                   label: 'If Called from Any Of'
   944 		  submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf
   944                   submenuChannel: menuForIgnoreAllBreakpointsIfCalledFromAnyOf
   945 		)
   945                 )
   946 	       )
   946                )
   947 	      nil
   947               nil
   948 	      nil
   948               nil
   949 	    )
   949             )
   950 	  )
   950           )
   951 	 (MenuItem
   951          (MenuItem
   952 	    label: 'Ignore all Halts/BreakPoints'
   952             label: 'Ignore all Halts/BreakPoints'
   953 	    submenu:
   953             submenu:
   954 	   (Menu
   954            (Menu
   955 	      (
   955               (
   956 	       (MenuItem
   956                (MenuItem
   957 		  label: 'Forever (Until Ignoring is Stopped)'
   957                   label: 'Forever (Until Ignoring is Stopped)'
   958 		  itemValue: ignoreAllHaltsForever
   958                   itemValue: ignoreAllHaltsForever
   959 		)
   959                 )
   960 	       (MenuItem
   960                (MenuItem
   961 		  label: 'For Some Time...'
   961                   label: 'For Some Time...'
   962 		  itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog
   962                   itemValue: openIgnoreAllHaltsUntilTimeElapsedDialog
   963 		)
   963                 )
   964 	       (MenuItem
   964                (MenuItem
   965 		  label: 'Until Shift-Key is Pressed'
   965                   label: 'Until Shift-Key is Pressed'
   966 		  itemValue: ignoreAllHaltsUntilShiftKeyIsPressed
   966                   itemValue: ignoreAllHaltsUntilShiftKeyIsPressed
   967 		)
   967                 )
   968 	       )
   968                )
   969 	      nil
   969               nil
   970 	      nil
   970               nil
   971 	    )
   971             )
   972 	  )
   972           )
   973 	 (MenuItem
   973          (MenuItem
   974 	    enabled: hasHaltsToIgnore
   974             enabled: hasHaltsToIgnore
   975 	    label: 'Stop Ignoring'
   975             label: 'Stop Ignoring'
   976 	    itemValue: stopIgnoringHalts
   976             itemValue: stopIgnoringHalts
   977 	  )
   977           )
   978 	 (MenuItem
   978          (MenuItem
   979 	    label: '-'
   979             label: '-'
   980 	  )
   980           )
   981 	 (MenuItem
   981          (MenuItem
   982 	    enabled: canAddBreakpoint
   982             enabled: canAddBreakpoint
   983 	    label: 'Add Breakpoint'
   983             label: 'Add Breakpoint'
   984 	    itemValue: addBreakpoint
   984             itemValue: addBreakpoint
   985 	  )
   985           )
   986 	 (MenuItem
   986          (MenuItem
   987 	    label: 'Manage Breakpoints'
   987             label: 'Manage Breakpoints'
   988 	    itemValue: openBreakPointBrowser
   988             itemValue: openBreakPointBrowser
   989 	  )
   989           )
   990 	 (MenuItem
   990          (MenuItem
   991 	    label: '-'
   991             label: '-'
   992 	  )
   992           )
   993 	 (MenuItem
   993          (MenuItem
   994 	    label: 'Allow Halt in Debugger'
   994             label: 'Allow Halt in Debugger'
   995 	    itemValue: allowBreakPointsInDebugger:
   995             itemValue: allowBreakPointsInDebugger:
   996 	    indication: allowBreakPointsInDebugger
   996             indication: allowBreakPointsInDebugger
   997 	  )
   997           )
   998 	 )
   998          )
   999 	nil
   999         nil
  1000 	nil
  1000         nil
  1001       )
  1001       )
  1002 !
  1002 !
  1003 
  1003 
  1004 classMenuSpec
  1004 classMenuSpec
  1005     "This resource specification was automatically generated
  1005     "This resource specification was automatically generated
  1086 
  1086 
  1087     <resource: #menu>
  1087     <resource: #menu>
  1088 
  1088 
  1089     ^
  1089     ^
  1090      #(Menu
  1090      #(Menu
  1091 	(
  1091         (
  1092 	 (MenuItem
  1092          (MenuItem
  1093 	    enabled: canReturn
  1093             enabled: canReturn
  1094 	    label: 'Return'
  1094             label: 'Return'
  1095 	    itemValue: doReturn
  1095             itemValue: doReturn
  1096 	  )
  1096           )
  1097 	 (MenuItem
  1097          (MenuItem
  1098 	    enabled: canRestart
  1098             enabled: canRestart
  1099 	    label: 'Restart'
  1099             label: 'Restart'
  1100 	    itemValue: doRestart
  1100             itemValue: doRestart
  1101 	  )
  1101           )
  1102 	 (MenuItem
  1102          (MenuItem
  1103 	    label: '-'
  1103             label: '-'
  1104 	  )
  1104           )
  1105 	 (MenuItem
  1105          (MenuItem
  1106 	    enabled: hasContextSelected
  1106             enabled: hasContextSelected
  1107 	    label: 'Inspect'
  1107             label: 'Inspect'
  1108 	    itemValue: inspectContext
  1108             itemValue: inspectContext
  1109 	  )
  1109           )
  1110 	 (MenuItem
  1110          (MenuItem
  1111 	    label: 'Copy WalkBack Text'
  1111             label: 'Copy WalkBack Text'
  1112 	    itemValue: copyWalkbackText
  1112             itemValue: copyWalkbackText
  1113 	  )
  1113           )
  1114 	 (MenuItem
  1114          (MenuItem
  1115 	    label: 'Inspect Method'
  1115             label: 'Inspect Method'
  1116 	    itemValue: inspectContextsMethod
  1116             itemValue: inspectContextsMethod
  1117 	  )
  1117           )
  1118 	 (MenuItem
  1118          (MenuItem
  1119 	    label: 'Bookmark Method in SystemBrowser'
  1119             label: 'Bookmark Method in SystemBrowser'
  1120 	    itemValue: addBrowserBookmark
  1120             itemValue: addBrowserBookmark
  1121 	  )
  1121           )
  1122 	 (MenuItem
  1122          (MenuItem
  1123 	    label: '-'
  1123             label: '-'
  1124 	  )
  1124           )
  1125 	 (MenuItem
  1125          (MenuItem
  1126 	    enabled: hasBlockContextSelected
  1126             enabled: hasBlockContextSelected
  1127 	    label: 'Find Home Context in Caller Chain...'
  1127             label: 'Find Home Context in Caller Chain...'
  1128 	    itemValue: findHomeContext
  1128             itemValue: findHomeContext
  1129 	  )
  1129           )
  1130 	 (MenuItem
  1130          (MenuItem
  1131 	    enabled: hasContextSelected
  1131             enabled: hasContextSelected
  1132 	    label: 'Find Context with String in Source...'
  1132             label: 'Find Context with String in Source...'
  1133 	    itemValue: findContextWithStringInSource
  1133             itemValue: findContextWithStringInSource
  1134 	  )
  1134           )
  1135 	 (MenuItem
  1135          (MenuItem
  1136 	    enabled: hasContextSelected
  1136             enabled: hasContextSelected
  1137 	    label: 'Find Context with Value in Variable...'
  1137             label: 'Find Context with Value in Variable...'
  1138 	    itemValue: findContextWithValueInVariable
  1138             itemValue: findContextWithValueInVariable
  1139 	  )
  1139           )
  1140 	 (MenuItem
  1140          (MenuItem
  1141 	    enabled: hasContextSelected
  1141             enabled: hasContextSelected
  1142 	    label: 'Find Next Exception Handler'
  1142             label: 'Find Next Exception Handler'
  1143 	    itemValue: findNextExceptionHandlerContext
  1143             itemValue: findNextExceptionHandlerContext
  1144 	  )
  1144           )
  1145 	 (MenuItem
  1145          (MenuItem
  1146 	    enabled: hasContextSelected
  1146             enabled: hasContextSelected
  1147 	    label: 'Find Handler For...'
  1147             label: 'Find Handler For...'
  1148 	    itemValue: findHandlerFor
  1148             itemValue: findHandlerFor
  1149 	  )
  1149           )
  1150 	 (MenuItem
  1150          (MenuItem
  1151 	    label: 'Find Dialog Opener...'
  1151             label: 'Find Dialog Opener...'
  1152 	    itemValue: doGotoDialogOpener
  1152             itemValue: doGotoDialogOpener
  1153 	  )
  1153           )
  1154 	 (MenuItem
  1154          (MenuItem
  1155 	    label: 'Find Application Action Method...'
  1155             label: 'Find Application Action Method...'
  1156 	    itemValue: doGotoApplicationActionMethod
  1156             itemValue: doGotoApplicationActionMethod
  1157 	  )
  1157           )
  1158 	 (MenuItem
  1158          (MenuItem
  1159 	    label: '-'
  1159             label: '-'
  1160 	  )
  1160           )
  1161 	 (MenuItem
  1161          (MenuItem
  1162 	    label: 'Remember Callchain && Highlight on Next Entry'
  1162             label: 'Remember Callchain && Highlight on Next Entry'
  1163 	    itemValue: rememberCallchain
  1163             itemValue: rememberCallchain
  1164 	  )
  1164           )
  1165 	 (MenuItem
  1165          (MenuItem
  1166 	    label: 'Clear Remembered Callchain'
  1166             label: 'Clear Remembered Callchain'
  1167 	    itemValue: clearRememberedCallchain
  1167             itemValue: clearRememberedCallchain
  1168 	  )
  1168           )
  1169 	 )
  1169          )
  1170 	nil
  1170         nil
  1171 	nil
  1171         nil
  1172       )
  1172       )
  1173 !
  1173 !
  1174 
  1174 
  1175 fileMenuSpec
  1175 fileMenuSpec
  1176     "This resource specification was automatically generated
  1176     "This resource specification was automatically generated
  1187 
  1187 
  1188     <resource: #menu>
  1188     <resource: #menu>
  1189 
  1189 
  1190     ^
  1190     ^
  1191      #(Menu
  1191      #(Menu
  1192 	(
  1192         (
  1193 	 (MenuItem
  1193          (MenuItem
  1194 	    enabled: canSendEmail
  1194             enabled: canSendEmail
  1195 	    label: 'Report a Bug via eMail...'
  1195             label: 'Report a Bug via eMail...'
  1196 	    itemValue: doOpenReportMailApp
  1196             itemValue: doOpenReportMailApp
  1197 	  )
  1197           )
  1198 	 (MenuItem
  1198          (MenuItem
  1199 	    label: '-'
  1199             label: '-'
  1200 	  )
  1200           )
  1201 	 (MenuItem
  1201          (MenuItem
  1202 	    enabled: canCloseAllDebuggers
  1202             enabled: canCloseAllDebuggers
  1203 	    label: 'Close all Debuggers...'
  1203             label: 'Close all Debuggers...'
  1204 	    itemValue: closeAllDebuggers
  1204             itemValue: closeAllDebuggers
  1205 	    isVisible: isNotInspecting
  1205             isVisible: isNotInspecting
  1206 	  )
  1206           )
  1207 	 (MenuItem
  1207          (MenuItem
  1208 	    label: '-'
  1208             label: '-'
  1209 	  )
  1209           )
  1210 	 (MenuItem
  1210          (MenuItem
  1211 	    label: 'Exit'
  1211             label: 'Exit'
  1212 	    itemValue: closeRequest
  1212             itemValue: closeRequest
  1213 	    isVisible: isInspecting
  1213             isVisible: isInspecting
  1214 	  )
  1214           )
  1215 	 (MenuItem
  1215          (MenuItem
  1216 	    label: 'Close Debugger and Abort'
  1216             label: 'Close Debugger and Abort'
  1217 	    itemValue: closeRequest
  1217             itemValue: closeRequest
  1218 	    isVisible: isNotInspecting
  1218             isVisible: isNotInspecting
  1219 	  )
  1219           )
  1220 	 )
  1220          )
  1221 	nil
  1221         nil
  1222 	nil
  1222         nil
  1223       )
  1223       )
  1224 !
  1224 !
  1225 
  1225 
  1226 helpMenuSpec
  1226 helpMenuSpec
  1227     "This resource specification was automatically generated
  1227     "This resource specification was automatically generated
  1238 
  1238 
  1239     <resource: #menu>
  1239     <resource: #menu>
  1240 
  1240 
  1241     ^
  1241     ^
  1242      #(Menu
  1242      #(Menu
  1243 	(
  1243         (
  1244 	 (MenuItem
  1244          (MenuItem
  1245 	    label: 'Debugger''s Documentation'
  1245             label: 'Debugger''s Documentation'
  1246 	    itemValue: openHTMLDocument:
  1246             itemValue: openHTMLDocument:
  1247 	    argument: 'tools/debugger/TOP.html'
  1247             argument: 'tools/debugger/TOP.html'
  1248 	  )
  1248           )
  1249 	 (MenuItem
  1249          (MenuItem
  1250 	    label: '-'
  1250             label: '-'
  1251 	  )
  1251           )
  1252 	 (MenuItem
  1252          (MenuItem
  1253 	    label: 'About DebugView...'
  1253             label: 'About DebugView...'
  1254 	    itemValue: openAboutThisApplication
  1254             itemValue: openAboutThisApplication
  1255 	  )
  1255           )
  1256 	 )
  1256          )
  1257 	nil
  1257         nil
  1258 	nil
  1258         nil
  1259       )
  1259       )
  1260 !
  1260 !
  1261 
  1261 
  1262 menuSpec
  1262 menuSpec
  1263     "This resource specification was automatically generated
  1263     "This resource specification was automatically generated
  1274 
  1274 
  1275     <resource: #menu>
  1275     <resource: #menu>
  1276 
  1276 
  1277     ^
  1277     ^
  1278      #(Menu
  1278      #(Menu
  1279 	(
  1279         (
  1280 	 (MenuItem
  1280          (MenuItem
  1281 	    label: 'File'
  1281             label: 'File'
  1282 	    submenuChannel: fileMenuSpec
  1282             submenuChannel: fileMenuSpec
  1283 	  )
  1283           )
  1284 	 (MenuItem
  1284          (MenuItem
  1285 	    label: 'View'
  1285             label: 'View'
  1286 	    submenuChannel: viewMenuSpec
  1286             submenuChannel: viewMenuSpec
  1287 	  )
  1287           )
  1288 	 (MenuItem
  1288          (MenuItem
  1289 	    label: 'Process'
  1289             label: 'Process'
  1290 	    submenuChannel: processMenuSpec
  1290             submenuChannel: processMenuSpec
  1291 	  )
  1291           )
  1292 	 (MenuItem
  1292          (MenuItem
  1293 	    label: 'Context'
  1293             label: 'Context'
  1294 	    submenuChannel: contextMenuSpec
  1294             submenuChannel: contextMenuSpec
  1295 	  )
  1295           )
  1296 	 (MenuItem
  1296          (MenuItem
  1297 	    label: 'Receiver'
  1297             label: 'Receiver'
  1298 	    submenuChannel: classMenuSpec
  1298             submenuChannel: classMenuSpec
  1299 	  )
  1299           )
  1300 	 (MenuItem
  1300          (MenuItem
  1301 	    label: 'Selector'
  1301             label: 'Selector'
  1302 	    submenuChannel: selectorMenuSpec
  1302             submenuChannel: selectorMenuSpec
  1303 	  )
  1303           )
  1304 	 (MenuItem
  1304          (MenuItem
  1305 	    label: 'Breakpoint'
  1305             label: 'Breakpoint'
  1306 	    submenuChannel: breakPointMenuSpec
  1306             submenuChannel: breakPointMenuSpec
  1307 	  )
  1307           )
  1308 	 (MenuItem
  1308          (MenuItem
  1309 	    label: 'MENU_Help'
  1309             label: 'MENU_Help'
  1310 	    startGroup: conditionalRight
  1310             startGroup: conditionalRight
  1311 	    submenuChannel: helpMenuSpec
  1311             submenuChannel: helpMenuSpec
  1312 	  )
  1312           )
  1313 	 )
  1313          )
  1314 	nil
  1314         nil
  1315 	nil
  1315         nil
  1316       )
  1316       )
  1317 !
  1317 !
  1318 
  1318 
  1319 processMenuSpec
  1319 processMenuSpec
  1320     "This resource specification was automatically generated
  1320     "This resource specification was automatically generated
  1331 
  1331 
  1332     <resource: #menu>
  1332     <resource: #menu>
  1333 
  1333 
  1334     ^
  1334     ^
  1335      #(Menu
  1335      #(Menu
  1336 	(
  1336         (
  1337 	 (MenuItem
  1337          (MenuItem
  1338 	    label: 'Continue'
  1338             label: 'Continue'
  1339 	    itemValue: doContinue
  1339             itemValue: doContinue
  1340 	  )
  1340           )
  1341 	 (MenuItem
  1341          (MenuItem
  1342 	    label: 'Next (Line-Step)'
  1342             label: 'Next (Line-Step)'
  1343 	    itemValue: doNext
  1343             itemValue: doNext
  1344 	  )
  1344           )
  1345 	 (MenuItem
  1345          (MenuItem
  1346 	    label: 'Step'
  1346             label: 'Step'
  1347 	    itemValue: doStep
  1347             itemValue: doStep
  1348 	  )
  1348           )
  1349 	 (MenuItem
  1349          (MenuItem
  1350 	    label: '-'
  1350             label: '-'
  1351 	  )
  1351           )
  1352 	 (MenuItem
  1352          (MenuItem
  1353 	    label: 'After 5 Seconds'
  1353             label: 'After 5 Seconds'
  1354 	    submenu:
  1354             submenu:
  1355 	   (Menu
  1355            (Menu
  1356 	      (
  1356               (
  1357 	       (MenuItem
  1357                (MenuItem
  1358 		  label: 'Continue'
  1358                   label: 'Continue'
  1359 		  itemValue: doContinueAfterDelay
  1359                   itemValue: doContinueAfterDelay
  1360 		)
  1360                 )
  1361 	       (MenuItem
  1361                (MenuItem
  1362 		  label: 'Next (Line-Step)'
  1362                   label: 'Next (Line-Step)'
  1363 		  itemValue: doNextAfterDelay
  1363                   itemValue: doNextAfterDelay
  1364 		)
  1364                 )
  1365 	       (MenuItem
  1365                (MenuItem
  1366 		  label: 'Step'
  1366                   label: 'Step'
  1367 		  itemValue: doStepAfterDelay
  1367                   itemValue: doStepAfterDelay
  1368 		)
  1368                 )
  1369 	       )
  1369                )
  1370 	      nil
  1370               nil
  1371 	      nil
  1371               nil
  1372 	    )
  1372             )
  1373 	  )
  1373           )
  1374 	 (MenuItem
  1374          (MenuItem
  1375 	    label: '-'
  1375             label: '-'
  1376 	  )
  1376           )
  1377 	 (MenuItem
  1377          (MenuItem
  1378 	    label: 'Skip to Cursor Line'
  1378             label: 'Skip to Cursor Line'
  1379 	    itemValue: skip
  1379             itemValue: skip
  1380 	  )
  1380           )
  1381 	 (MenuItem
  1381          (MenuItem
  1382 	    label: 'Step Out (Skip until Return)'
  1382             label: 'Step Out (Skip until Return)'
  1383 	    itemValue: skipForReturn
  1383             itemValue: skipForReturn
  1384 	  )
  1384           )
  1385 	 (MenuItem
  1385          (MenuItem
  1386 	    label: 'Skip until Entering...'
  1386             label: 'Skip until Entering...'
  1387 	    itemValue: skipUntilEntering
  1387             itemValue: skipUntilEntering
  1388 	  )
  1388           )
  1389 	 (MenuItem
  1389          (MenuItem
  1390 	    label: '-'
  1390             label: '-'
  1391 	  )
  1391           )
  1392 	 (MenuItem
  1392          (MenuItem
  1393 	    label: 'Abort'
  1393             label: 'Abort'
  1394 	    itemValue: doAbort
  1394             itemValue: doAbort
  1395 	  )
  1395           )
  1396 	 (MenuItem
  1396          (MenuItem
  1397 	    enabled: abortAllIsHandled
  1397             enabled: abortAllIsHandled
  1398 	    label: 'Abort All'
  1398             label: 'Abort All'
  1399 	    itemValue: doAbortAll
  1399             itemValue: doAbortAll
  1400 	  )
  1400           )
  1401 	 (MenuItem
  1401          (MenuItem
  1402 	    label: '-'
  1402             label: '-'
  1403 	  )
  1403           )
  1404 	 (MenuItem
  1404          (MenuItem
  1405 	    label: 'Inspect'
  1405             label: 'Inspect'
  1406 	    itemValue: doInspectProcess
  1406             itemValue: doInspectProcess
  1407 	  )
  1407           )
  1408 	 (MenuItem
  1408          (MenuItem
  1409 	    label: 'Change Priority...'
  1409             label: 'Change Priority...'
  1410 	    itemValue: doChangeProcessPriority
  1410             itemValue: doChangeProcessPriority
  1411 	  )
  1411           )
  1412 	 (MenuItem
  1412          (MenuItem
  1413 	    label: '-'
  1413             label: '-'
  1414 	  )
  1414           )
  1415 	 (MenuItem
  1415          (MenuItem
  1416 	    label: 'Terminate'
  1416             label: 'Terminate'
  1417 	    itemValue: doTerminate
  1417             itemValue: doTerminate
  1418 	  )
  1418           )
  1419 	 (MenuItem
  1419          (MenuItem
  1420 	    label: 'Hard Terminate (Danger)'
  1420             label: 'Hard Terminate (Danger)'
  1421 	    itemValue: quickTerminate
  1421             itemValue: quickTerminate
  1422 	    isVisible: false
  1422             isVisible: false
  1423 	  )
  1423           )
  1424 	 )
  1424          )
  1425 	nil
  1425         nil
  1426 	nil
  1426         nil
  1427       )
  1427       )
  1428 !
  1428 !
  1429 
  1429 
  1430 selectorMenuSpec
  1430 selectorMenuSpec
  1431     "This resource specification was automatically generated
  1431     "This resource specification was automatically generated
  1442 
  1442 
  1443     <resource: #menu>
  1443     <resource: #menu>
  1444 
  1444 
  1445     ^
  1445     ^
  1446      #(Menu
  1446      #(Menu
  1447 	(
  1447         (
  1448 	 (MenuItem
  1448          (MenuItem
  1449 	    label: 'Browse Implementors...'
  1449             label: 'Browse Implementors...'
  1450 	    itemValue: browseImplementorsOf
  1450             itemValue: browseImplementorsOf
  1451 	  )
  1451           )
  1452 	 (MenuItem
  1452          (MenuItem
  1453 	    label: 'Browse Senders...'
  1453             label: 'Browse Senders...'
  1454 	    itemValue: browseSendersOf
  1454             itemValue: browseSendersOf
  1455 	  )
  1455           )
  1456 	 (MenuItem
  1456          (MenuItem
  1457 	    label: '-'
  1457             label: '-'
  1458 	  )
  1458           )
  1459 	 (MenuItem
  1459          (MenuItem
  1460 	    enabled: canDefineMethod
  1460             enabled: canDefineMethod
  1461 	    label: 'Define Missing Method'
  1461             label: 'Define Missing Method'
  1462 	    itemValue: doDefineMethod
  1462             itemValue: doDefineMethod
  1463 	  )
  1463           )
  1464 	 )
  1464          )
  1465 	nil
  1465         nil
  1466 	nil
  1466         nil
  1467       )
  1467       )
  1468 !
  1468 !
  1469 
  1469 
  1470 viewMenuSpec
  1470 viewMenuSpec
  1471     "This resource specification was automatically generated
  1471     "This resource specification was automatically generated
  1482 
  1482 
  1483     <resource: #menu>
  1483     <resource: #menu>
  1484 
  1484 
  1485     ^
  1485     ^
  1486      #(Menu
  1486      #(Menu
  1487 	(
  1487         (
  1488 	 (MenuItem
  1488          (MenuItem
  1489 	    enabled: canShowMore
  1489             enabled: canShowMore
  1490 	    label: 'Show More WalkBack'
  1490             label: 'Show More WalkBack'
  1491 	    itemValue: showMoreWalkback
  1491             itemValue: showMoreWalkback
  1492 	  )
  1492           )
  1493 	 (MenuItem
  1493          (MenuItem
  1494 	    enabled: canShowMore
  1494             enabled: canShowMore
  1495 	    label: 'Show Full WalkBack'
  1495             label: 'Show Full WalkBack'
  1496 	    itemValue: showFullWalkback
  1496             itemValue: showFullWalkback
  1497 	  )
  1497           )
  1498 	 (MenuItem
  1498          (MenuItem
  1499 	    label: '-'
  1499             label: '-'
  1500 	  )
  1500           )
  1501 	 (MenuItem
  1501          (MenuItem
  1502 	    label: 'Show Dense WalkBack'
  1502             label: 'Show Dense WalkBack'
  1503 	    itemValue: showingDenseWalkback:
  1503             itemValue: showingDenseWalkback:
  1504 	    hideMenuOnActivated: false
  1504             hideMenuOnActivated: false
  1505 	    indication: showingDenseWalkback
  1505             indication: showingDenseWalkback
  1506 	  )
  1506           )
  1507 	 (MenuItem
  1507          (MenuItem
  1508 	    enabled: notShowingDenseWalkbackHolder
  1508             enabled: notShowingDenseWalkbackHolder
  1509 	    label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)'
  1509             label: 'Show Support Code (Implementation of Enumerations, Exceptions etc.)'
  1510 	    itemValue: showingSupportCode:
  1510             itemValue: showingSupportCode:
  1511 	    hideMenuOnActivated: false
  1511             hideMenuOnActivated: false
  1512 	    indication: showingSupportCode
  1512             indication: showingSupportCode
  1513 	  )
  1513           )
  1514 	 (MenuItem
  1514          (MenuItem
  1515 	    label: '-'
  1515             label: '-'
  1516 	  )
  1516           )
  1517 	 (MenuItem
  1517          (MenuItem
  1518 	    label: 'Raise Debugger when Entering'
  1518             label: 'Raise Debugger when Entering'
  1519 	    itemValue: autoRaiseView:
  1519             itemValue: autoRaiseView:
  1520 	    hideMenuOnActivated: false
  1520             hideMenuOnActivated: false
  1521 	    indication: autoRaiseView
  1521             indication: autoRaiseView
  1522 	  )
  1522           )
  1523 	 (MenuItem
  1523          (MenuItem
  1524 	    label: '-'
  1524             label: '-'
  1525 	  )
  1525           )
  1526 	 (MenuItem
  1526          (MenuItem
  1527 	    label: 'Settings...'
  1527             label: 'Settings...'
  1528 	    itemValue: openSettingsDialog
  1528             itemValue: openSettingsDialog
  1529 	  )
  1529           )
  1530 	 )
  1530          )
  1531 	nil
  1531         nil
  1532 	nil
  1532         nil
  1533       )
  1533       )
  1534 ! !
  1534 ! !
  1535 
  1535 
  1536 !DebugView class methodsFor:'misc'!
  1536 !DebugView class methodsFor:'misc'!
  1537 
  1537 
  1952 
  1952 
  1953 !DebugView methodsFor:'aspects'!
  1953 !DebugView methodsFor:'aspects'!
  1954 
  1954 
  1955 verboseBacktraceHolder
  1955 verboseBacktraceHolder
  1956     verboseBacktraceHolder isNil ifTrue:[
  1956     verboseBacktraceHolder isNil ifTrue:[
  1957 	verboseBacktraceHolder := ValueHolder with:false
  1957         verboseBacktraceHolder := ValueHolder with:false
  1958     ].
  1958     ].
  1959     ^ verboseBacktraceHolder
  1959     ^ verboseBacktraceHolder
  1960 ! !
  1960 ! !
  1961 
  1961 
  1962 !DebugView methodsFor:'basic'!
  1962 !DebugView methodsFor:'basic'!
  1964 enableDisableActions
  1964 enableDisableActions
  1965     |m|
  1965     |m|
  1966 
  1966 
  1967     m := contextView middleButtonMenu.
  1967     m := contextView middleButtonMenu.
  1968     m notNil ifTrue:[
  1968     m notNil ifTrue:[
  1969 	self updateMenuItems.
  1969         self updateMenuItems.
  1970 
  1970 
  1971 	(inspecting or:[AbortOperationRequest isHandled]) ifTrue:[
  1971         (inspecting or:[AbortOperationRequest isHandled]) ifTrue:[
  1972 	    abortButton enable.
  1972             abortButton enable.
  1973 	    m enable:#doAbort.
  1973             m enable:#doAbort.
  1974 	] ifFalse:[
  1974         ] ifFalse:[
  1975 	    abortButton disable.
  1975             abortButton disable.
  1976 	    m disable:#doAbort.
  1976             m disable:#doAbort.
  1977 	].
  1977         ].
  1978 	exclusive ifTrue:[
  1978         exclusive ifTrue:[
  1979 	    terminateButton disable.
  1979             terminateButton disable.
  1980 	    m disable:#doTerminate.
  1980             m disable:#doTerminate.
  1981 	] ifFalse:[
  1981         ] ifFalse:[
  1982 	    terminateButton enable.
  1982             terminateButton enable.
  1983 	    m enable:#doTerminate.
  1983             m enable:#doTerminate.
  1984 	]
  1984         ]
  1985     ].
  1985     ].
  1986 
  1986 
  1987     mayProceed == false ifTrue:[
  1987     mayProceed == false ifTrue:[
  1988 	continueButton disable.
  1988         continueButton disable.
  1989 	m notNil ifTrue:[m disable:#doContinue].
  1989         m notNil ifTrue:[m disable:#doContinue].
  1990     ] ifFalse:[
  1990     ] ifFalse:[
  1991 	continueButton enable.
  1991         continueButton enable.
  1992 	m notNil ifTrue:[m enable:#doContinue]
  1992         m notNil ifTrue:[m enable:#doContinue]
  1993     ].
  1993     ].
  1994 
  1994 
  1995     "Created: / 16.11.2001 / 17:40:51 / cg"
  1995     "Created: / 16.11.2001 / 17:40:51 / cg"
  1996 !
  1996 !
  1997 
  1997 
  1999     "enter a debugger"
  1999     "enter a debugger"
  2000 
  2000 
  2001     <context: #return>
  2001     <context: #return>
  2002 
  2002 
  2003     ^ self
  2003     ^ self
  2004 	enter:thisContext sender
  2004         enter:thisContext sender
  2005 	select: nil.
  2005         select: nil.
  2006 
  2006 
  2007     "Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2007     "Modified: / 28-08-2012 / 21:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2008 !
  2008 !
  2009 
  2009 
  2010 enter:aContext select:initialSelectionOrNil
  2010 enter:aContext select:initialSelectionOrNil
  2392 
  2392 
  2393 exit_resend
  2393 exit_resend
  2394     |con|
  2394     |con|
  2395 
  2395 
  2396     selectedContext notNil ifTrue:[
  2396     selectedContext notNil ifTrue:[
  2397 	con := selectedContext.
  2397         con := selectedContext.
  2398 	self cacheMyself.
  2398         self cacheMyself.
  2399 	"
  2399         "
  2400 	 have to catch errors occuring in unwind-blocks
  2400          have to catch errors occuring in unwind-blocks
  2401 	"
  2401         "
  2402 	Error handle:[:ex |
  2402         Error handle:[:ex |
  2403 	    'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2403             'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2404 	    ex description infoPrintCR.
  2404             ex description infoPrintCR.
  2405 	    ex proceed
  2405             ex proceed
  2406 	] do:[
  2406         ] do:[
  2407 	    ^ con unwindThenResend.
  2407             ^ con unwindThenResend.
  2408 	].
  2408         ].
  2409 	'DebugView [warning]: cannot resend selected context''s message' errorPrintCR
  2409         'DebugView [warning]: cannot resend selected context''s message' errorPrintCR
  2410     ]
  2410     ]
  2411 !
  2411 !
  2412 
  2412 
  2413 exit_restart
  2413 exit_restart
  2414     |con|
  2414     |con|
  2415 
  2415 
  2416     selectedContext notNil ifTrue:[
  2416     selectedContext notNil ifTrue:[
  2417 	con := selectedContext.
  2417         con := selectedContext.
  2418 	self cacheMyself.
  2418         self cacheMyself.
  2419 	"
  2419         "
  2420 	 have to catch errors occuring in unwind-blocks
  2420          have to catch errors occuring in unwind-blocks
  2421 	"
  2421         "
  2422 	Error handle:[:ex |
  2422         Error handle:[:ex |
  2423 	    'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2423             'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2424 	    ex description infoPrintCR.
  2424             ex description infoPrintCR.
  2425 	    ex proceed
  2425             ex proceed
  2426 	] do:[
  2426         ] do:[
  2427 	    con unwindAndRestart.
  2427             con unwindAndRestart.
  2428 	].
  2428         ].
  2429 	'DebugView [warning]: cannot restart selected context' errorPrintCR
  2429         'DebugView [warning]: cannot restart selected context' errorPrintCR
  2430     ]
  2430     ]
  2431 
  2431 
  2432     "Created: / 16-11-2001 / 17:23:17 / cg"
  2432     "Created: / 16-11-2001 / 17:23:17 / cg"
  2433     "Modified: / 26-09-2012 / 15:09:52 / cg"
  2433     "Modified: / 26-09-2012 / 15:09:52 / cg"
  2434 !
  2434 !
  2437     |con retVal|
  2437     |con retVal|
  2438 
  2438 
  2439     retVal := nil.
  2439     retVal := nil.
  2440 
  2440 
  2441     selectedContext notNil ifTrue:[
  2441     selectedContext notNil ifTrue:[
  2442 	"
  2442         "
  2443 	 if there is a selection in the codeView,
  2443          if there is a selection in the codeView,
  2444 	 evaluate it and use the result as return value
  2444          evaluate it and use the result as return value
  2445 	"
  2445         "
  2446 "/ disabled for now, there is almost always a selection (the current line)
  2446 "/ disabled for now, there is almost always a selection (the current line)
  2447 "/ and that is syntactically incorrect ...
  2447 "/ and that is syntactically incorrect ...
  2448 "/ ... leading to a popup warning from the codeView
  2448 "/ ... leading to a popup warning from the codeView
  2449 "/
  2449 "/
  2450 "/                codeView hasSelection ifTrue:[
  2450 "/                codeView hasSelection ifTrue:[
  2458 "/                        s := codeView selection asString.
  2458 "/                        s := codeView selection asString.
  2459 "/                        retVal := codeView doItAction value:s.
  2459 "/                        retVal := codeView doItAction value:s.
  2460 "/                    ].
  2460 "/                    ].
  2461 "/                ].
  2461 "/                ].
  2462 
  2462 
  2463 	con := selectedContext.
  2463         con := selectedContext.
  2464 	self cacheMyself.
  2464         self cacheMyself.
  2465 	"
  2465         "
  2466 	 have to catch errors occuring in unwind-blocks
  2466          have to catch errors occuring in unwind-blocks
  2467 	"
  2467         "
  2468 	Error handle:[:ex |
  2468         Error handle:[:ex |
  2469 	    'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2469             'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2470 	    ex description infoPrintCR.
  2470             ex description infoPrintCR.
  2471 	    ex proceed
  2471             ex proceed
  2472 	] do:[
  2472         ] do:[
  2473 	    con unwind:retVal.
  2473             con unwind:retVal.
  2474 	].
  2474         ].
  2475 	'DebugView [warning]: cannot return from selected context' errorPrintCR
  2475         'DebugView [warning]: cannot return from selected context' errorPrintCR
  2476     ]
  2476     ]
  2477 
  2477 
  2478     "Created: / 16.11.2001 / 17:22:24 / cg"
  2478     "Created: / 16.11.2001 / 17:22:24 / cg"
  2479     "Modified: / 17.11.2001 / 23:20:21 / cg"
  2479     "Modified: / 17.11.2001 / 23:20:21 / cg"
  2480 !
  2480 !
  2483 
  2483 
  2484     "
  2484     "
  2485      have to catch errors occuring in unwind-blocks
  2485      have to catch errors occuring in unwind-blocks
  2486     "
  2486     "
  2487     Error handle:[:ex |
  2487     Error handle:[:ex |
  2488 	'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2488         'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2489 	ex description infoPrintCR.
  2489         ex description infoPrintCR.
  2490 	ex proceed
  2490         ex proceed
  2491     ] do:[
  2491     ] do:[
  2492 	self cacheMyself.
  2492         self cacheMyself.
  2493 	Processor activeProcess terminate.
  2493         Processor activeProcess terminate.
  2494     ].
  2494     ].
  2495     'DebugView [warning]: cannot terminate process' errorPrintCR
  2495     'DebugView [warning]: cannot terminate process' errorPrintCR
  2496 
  2496 
  2497     "Created: / 16.11.2001 / 17:24:20 / cg"
  2497     "Created: / 16.11.2001 / 17:24:20 / cg"
  2498     "Modified: / 17.11.2001 / 23:20:27 / cg"
  2498     "Modified: / 17.11.2001 / 23:20:27 / cg"
  2514     "
  2514     "
  2515     self cacheMyself.
  2515     self cacheMyself.
  2516     con := thisContext sender.
  2516     con := thisContext sender.
  2517 
  2517 
  2518     Error handle:[:ex |
  2518     Error handle:[:ex |
  2519 	'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2519         'DebugView [info]: ignored error while unwinding: ' infoPrint.
  2520 	ex description infoPrintCR.
  2520         ex description infoPrintCR.
  2521 	ex proceed
  2521         ex proceed
  2522     ] do:[
  2522     ] do:[
  2523 	"/ find the enter:select context.
  2523         "/ find the enter:select context.
  2524 	[(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[
  2524         [(con selector ~~ #enter:select:) or:[con receiver ~~ self]] whileTrue:[
  2525 	    con := con sender
  2525             con := con sender
  2526 	].
  2526         ].
  2527 
  2527 
  2528 	"/ must skip over its caller (because this one has a ControlInterrupt handler too)
  2528         "/ must skip over its caller (because this one has a ControlInterrupt handler too)
  2529 	con sender receiver == self class ifTrue:[
  2529         con sender receiver == self class ifTrue:[
  2530 	    con := con sender.
  2530             con := con sender.
  2531 	    con sender receiver == self class ifTrue:[
  2531             con sender receiver == self class ifTrue:[
  2532 		con := con sender methodHome.
  2532                 con := con sender methodHome.
  2533 	    ].
  2533             ].
  2534 	].
  2534         ].
  2535 
  2535 
  2536 	con unwindThenDo:aBlock.
  2536         con unwindThenDo:aBlock.
  2537     ].
  2537     ].
  2538     'DebugView [warning]: abort failed' errorPrintCR
  2538     'DebugView [warning]: abort failed' errorPrintCR
  2539 
  2539 
  2540     "Created: / 16.11.2001 / 17:20:45 / cg"
  2540     "Created: / 16.11.2001 / 17:20:45 / cg"
  2541     "Modified: / 18.11.2001 / 00:58:14 / cg"
  2541     "Modified: / 18.11.2001 / 00:58:14 / cg"
  2736 
  2736 
  2737 selectContextWithIndex:index
  2737 selectContextWithIndex:index
  2738     self showSelection:index.
  2738     self showSelection:index.
  2739     contextView setSelection:index.
  2739     contextView setSelection:index.
  2740     index > 1 ifTrue:[
  2740     index > 1 ifTrue:[
  2741 	contextView scrollToLine:(index - 1)
  2741         contextView scrollToLine:(index - 1)
  2742     ].
  2742     ].
  2743 !
  2743 !
  2744 
  2744 
  2745 setInitialSelectionOnEntry:initialSelectionOrNil context:aContext
  2745 setInitialSelectionOnEntry:initialSelectionOrNil context:aContext
  2746     |selection|
  2746     |selection|
  2747 
  2747 
  2748     selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext.
  2748     selection := self initialSelectionOnEntry:initialSelectionOrNil context:aContext.
  2749     selection notNil ifTrue:[
  2749     selection notNil ifTrue:[
  2750 	self selectContextWithIndex:selection
  2750         self selectContextWithIndex:selection
  2751     ].
  2751     ].
  2752 
  2752 
  2753     "Created: / 16.11.2001 / 17:28:07 / cg"
  2753     "Created: / 16.11.2001 / 17:28:07 / cg"
  2754     "Modified: / 17.11.2001 / 20:27:21 / cg"
  2754     "Modified: / 17.11.2001 / 20:27:21 / cg"
  2755 !
  2755 !
  2931 
  2931 
  2932 helpTextFor:aComponent
  2932 helpTextFor:aComponent
  2933     |s|
  2933     |s|
  2934 
  2934 
  2935     aComponent == abortButton ifTrue:[
  2935     aComponent == abortButton ifTrue:[
  2936 	s := 'HELP_ABORT'
  2936         s := 'HELP_ABORT'
  2937     ].
  2937     ].
  2938     aComponent == terminateButton ifTrue:[
  2938     aComponent == terminateButton ifTrue:[
  2939 	s := 'HELP_TERMINATE'
  2939         s := 'HELP_TERMINATE'
  2940     ].
  2940     ].
  2941     aComponent == continueButton ifTrue:[
  2941     aComponent == continueButton ifTrue:[
  2942 	continueButton label = (resources string:'Stop') ifTrue:[
  2942         continueButton label = (resources string:'Stop') ifTrue:[
  2943 	    s := 'HELP_STOP'
  2943             s := 'HELP_STOP'
  2944 	] ifFalse:[
  2944         ] ifFalse:[
  2945 	    s := 'HELP_CONTINUE'
  2945             s := 'HELP_CONTINUE'
  2946 	]
  2946         ]
  2947     ].
  2947     ].
  2948     aComponent == stepButton ifTrue:[
  2948     aComponent == stepButton ifTrue:[
  2949 	s := 'HELP_STEP'
  2949         s := 'HELP_STEP'
  2950     ].
  2950     ].
  2951     aComponent == nextButton ifTrue:[
  2951     aComponent == nextButton ifTrue:[
  2952 	s := 'HELP_NEXT'
  2952         s := 'HELP_NEXT'
  2953     ].
  2953     ].
  2954     aComponent == nextOverButton ifTrue:[
  2954     aComponent == nextOverButton ifTrue:[
  2955 	s := 'HELP_NEXTOVER'
  2955         s := 'HELP_NEXTOVER'
  2956     ].
  2956     ].
  2957     aComponent == nextOutButton ifTrue:[
  2957     aComponent == nextOutButton ifTrue:[
  2958 	s := 'HELP_NEXTOUT'
  2958         s := 'HELP_NEXTOUT'
  2959     ].
  2959     ].
  2960     aComponent == stepButton ifTrue:[
  2960     aComponent == stepButton ifTrue:[
  2961 	s := 'HELP_STEP'
  2961         s := 'HELP_STEP'
  2962     ].
  2962     ].
  2963     aComponent == sendButton ifTrue:[
  2963     aComponent == sendButton ifTrue:[
  2964 	s := 'HELP_SEND'
  2964         s := 'HELP_SEND'
  2965     ].
  2965     ].
  2966     aComponent == returnButton ifTrue:[
  2966     aComponent == returnButton ifTrue:[
  2967 	returnButton enabled ifTrue:[
  2967         returnButton enabled ifTrue:[
  2968 	    s := 'HELP_RETURN'
  2968             s := 'HELP_RETURN'
  2969 	] ifFalse:[
  2969         ] ifFalse:[
  2970 	    s := 'HELP_RETURN_DISABLED'
  2970             s := 'HELP_RETURN_DISABLED'
  2971 	].
  2971         ].
  2972     ].
  2972     ].
  2973     aComponent == restartButton ifTrue:[
  2973     aComponent == restartButton ifTrue:[
  2974 	restartButton enabled ifTrue:[
  2974         restartButton enabled ifTrue:[
  2975 	    s := 'HELP_RESTART'
  2975             s := 'HELP_RESTART'
  2976 	] ifFalse:[
  2976         ] ifFalse:[
  2977 	    s := 'HELP_RESTART_DISABLED'
  2977             s := 'HELP_RESTART_DISABLED'
  2978 	].
  2978         ].
  2979     ].
  2979     ].
  2980     aComponent == resendButton ifTrue:[
  2980     aComponent == resendButton ifTrue:[
  2981 	resendButton enabled ifTrue:[
  2981         resendButton enabled ifTrue:[
  2982 	    s := 'HELP_RESEND'
  2982             s := 'HELP_RESEND'
  2983 	] ifFalse:[
  2983         ] ifFalse:[
  2984 	    s := 'HELP_RESEND_DISABLED'
  2984             s := 'HELP_RESEND_DISABLED'
  2985 	].
  2985         ].
  2986     ].
  2986     ].
  2987     aComponent == contextView ifTrue:[
  2987     aComponent == contextView ifTrue:[
  2988 	s := 'HELP_WALKBACK'
  2988         s := 'HELP_WALKBACK'
  2989     ].
  2989     ].
  2990     aComponent == codeView ifTrue:[
  2990     aComponent == codeView ifTrue:[
  2991 	s := 'HELP_CODEVIEW'
  2991         s := 'HELP_CODEVIEW'
  2992     ].
  2992     ].
  2993     aComponent == monitorToggle ifTrue:[
  2993     aComponent == monitorToggle ifTrue:[
  2994 	s := 'HELP_MONITOR'
  2994         s := 'HELP_MONITOR'
  2995     ].
  2995     ].
  2996     aComponent == updateButton ifTrue:[
  2996     aComponent == updateButton ifTrue:[
  2997 	s := 'HELP_UPDATE'
  2997         s := 'HELP_UPDATE'
  2998     ].
  2998     ].
  2999     aComponent == gotoDialogOpenerButton ifTrue:[
  2999     aComponent == gotoDialogOpenerButton ifTrue:[
  3000 	s := 'HELP_GOTO_DIALOG_OPENER'
  3000         s := 'HELP_GOTO_DIALOG_OPENER'
  3001     ].
  3001     ].
  3002     aComponent == gotoApplicationActionMethodButton ifTrue:[
  3002     aComponent == gotoApplicationActionMethodButton ifTrue:[
  3003 	s := 'HELP_GOTO_APPLICATION_ACTION'
  3003         s := 'HELP_GOTO_APPLICATION_ACTION'
  3004     ].
  3004     ].
  3005 "/    aComponent == stopButton ifTrue:[
  3005 "/    aComponent == stopButton ifTrue:[
  3006 "/        s := 'HELP_STOP'
  3006 "/        s := 'HELP_STOP'
  3007 "/    ].
  3007 "/    ].
  3008     (aComponent isComponentOf:receiverInspector) ifTrue:[
  3008     (aComponent isComponentOf:receiverInspector) ifTrue:[
  3009 	s := 'HELP_REC_INSP'
  3009         s := 'HELP_REC_INSP'
  3010     ].
  3010     ].
  3011     (aComponent isComponentOf:contextInspector) ifTrue:[
  3011     (aComponent isComponentOf:contextInspector) ifTrue:[
  3012 	s := 'HELP_CON_INSP'
  3012         s := 'HELP_CON_INSP'
  3013     ].
  3013     ].
  3014 
  3014 
  3015     s notNil ifTrue:[
  3015     s notNil ifTrue:[
  3016 	^ resources stringWithCRs:s
  3016         ^ resources stringWithCRs:s
  3017     ].
  3017     ].
  3018     ^ nil
  3018     ^ nil
  3019 
  3019 
  3020     "Modified: 29.8.1995 / 23:38:54 / claus"
  3020     "Modified: 29.8.1995 / 23:38:54 / claus"
  3021     "Modified: 4.3.1997 / 01:54:03 / cg"
  3021     "Modified: 4.3.1997 / 01:54:03 / cg"
  3419     separator := View extent:(30 @ 5) in:bpanel.
  3419     separator := View extent:(30 @ 5) in:bpanel.
  3420     separator borderWidth:0; level:0.
  3420     separator borderWidth:0; level:0.
  3421 
  3421 
  3422     self initializeDefineButtonIn:bpanel.
  3422     self initializeDefineButtonIn:bpanel.
  3423     (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[
  3423     (UserPreferences current allowSendMailFromDebugger and:[SendMailTool notNil]) ifTrue:[
  3424 	self initializeReportButtonIn:bpanel.
  3424         self initializeReportButtonIn:bpanel.
  3425     ].
  3425     ].
  3426 
  3426 
  3427 
  3427 
  3428     "Created: / 17.11.2001 / 20:56:20 / cg"
  3428     "Created: / 17.11.2001 / 20:56:20 / cg"
  3429     "Modified: / 17.11.2001 / 21:03:18 / cg"
  3429     "Modified: / 17.11.2001 / 21:03:18 / cg"
  3431 
  3431 
  3432 initializeCodeViewIn:panel
  3432 initializeCodeViewIn:panel
  3433     |scrollableCodeView|
  3433     |scrollableCodeView|
  3434 
  3434 
  3435     (UserPreferences current useCodeView2In: #Debugger) ifTrue:[
  3435     (UserPreferences current useCodeView2In: #Debugger) ifTrue:[
  3436 	scrollableCodeView := codeView := Tools::CodeView2 new.
  3436         scrollableCodeView := codeView := Tools::CodeView2 new.
  3437 	codeView model: ValueHolder new.
  3437         codeView model: ValueHolder new.
  3438 	codeView methodHolder: ValueHolder new.
  3438         codeView methodHolder: ValueHolder new.
  3439 	codeView classHolder: ValueHolder new.
  3439         codeView classHolder: ValueHolder new.
  3440     ] ifFalse:[
  3440     ] ifFalse:[
  3441 	scrollableCodeView := HVScrollableView
  3441         scrollableCodeView := HVScrollableView
  3442 		    for:CodeView
  3442                     for:CodeView
  3443 		    miniScrollerH:true
  3443                     miniScrollerH:true
  3444 		    miniScrollerV:false
  3444                     miniScrollerV:false
  3445 		    in:panel.
  3445                     in:panel.
  3446 
  3446 
  3447 	codeView := scrollableCodeView scrolledView.
  3447         codeView := scrollableCodeView scrolledView.
  3448 	codeView enableMotionEvents. "/ for active help
  3448         codeView enableMotionEvents. "/ for active help
  3449     ].
  3449     ].
  3450 
  3450 
  3451      (UserPreferences current showAcceptCancelBarInBrowser
  3451      (UserPreferences current showAcceptCancelBarInBrowser
  3452 	and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
  3452         and:[codeView isCodeView2 not or:[UserPreferences current codeView2ShowAcceptCancel not]]) ifTrue:[
  3453 	ViewWithAcceptAndCancelBar notNil ifTrue:[
  3453         ViewWithAcceptAndCancelBar notNil ifTrue:[
  3454 	    |v|
  3454             |v|
  3455 
  3455 
  3456 	    v := ViewWithAcceptAndCancelBar new.
  3456             v := ViewWithAcceptAndCancelBar new.
  3457 	    v slaveView:scrollableCodeView.
  3457             v slaveView:scrollableCodeView.
  3458 	    v reallyModifiedHolder:(codeView isCodeView2
  3458             v reallyModifiedHolder:(codeView isCodeView2
  3459 					ifTrue:[ codeView reallyModifiedChannel ]
  3459                                         ifTrue:[ codeView reallyModifiedChannel ]
  3460 					ifFalse:[
  3460                                         ifFalse:[
  3461 					    BlockValue
  3461                                             BlockValue
  3462 						with:[:m |
  3462                                                 with:[:m |
  3463 						    |same|
  3463                                                     |same|
  3464 
  3464 
  3465 						    same := (codeView contentsAsString string = currentMethod source string).
  3465                                                     same := (codeView contentsAsString string = currentMethod source string).
  3466 						    codeView modifiedChannel setValue:false.  "/ so it triggers again
  3466                                                     codeView modifiedChannel setValue:false.  "/ so it triggers again
  3467 						    same not.
  3467                                                     same not.
  3468 						]
  3468                                                 ]
  3469 						argument:codeView modifiedChannel
  3469                                                 argument:codeView modifiedChannel
  3470 					]).
  3470                                         ]).
  3471 	    v cancelAction:
  3471             v cancelAction:
  3472 		[
  3472                 [
  3473 		    "/ codeView setClipboardText:(codeView contents).   "/ for undo
  3473                     "/ codeView setClipboardText:(codeView contents).   "/ for undo
  3474 		    codeView device rememberInCopyBufferHistory:(codeView contents).  "/ for undo
  3474                     codeView device rememberInCopyBufferHistory:(codeView contents).  "/ for undo
  3475 		    codeView contents:(currentMethod source).
  3475                     codeView contents:(currentMethod source).
  3476 		    codeView modifiedChannel setValue:false; changed.   "/ trigger
  3476                     codeView modifiedChannel setValue:false; changed.   "/ trigger
  3477 		    codeView requestFocus.
  3477                     codeView requestFocus.
  3478 		].
  3478                 ].
  3479 	    v compareAction:
  3479             v compareAction:
  3480 		[
  3480                 [
  3481 		    v := DiffCodeView
  3481                     v := DiffCodeView
  3482 			    openOn:codeView contentsAsString
  3482                             openOn:codeView contentsAsString
  3483 			    label:(resources string:'Changed definition (to be accepted ?)')
  3483                             label:(resources string:'Changed definition (to be accepted ?)')
  3484 			    and:currentMethod source
  3484                             and:currentMethod source
  3485 			    label:(resources string:'Method''s Original Code').
  3485                             label:(resources string:'Method''s Original Code').
  3486 		    v label:(resources string:'Changed Code in Debugger').
  3486                     v label:(resources string:'Changed Code in Debugger').
  3487 		    v waitUntilVisible.
  3487                     v waitUntilVisible.
  3488 		    "/ codeView requestFocus
  3488                     "/ codeView requestFocus
  3489 		].
  3489                 ].
  3490 	    scrollableCodeView := v.
  3490             scrollableCodeView := v.
  3491 	]
  3491         ]
  3492     ].
  3492     ].
  3493 
  3493 
  3494     panel add:scrollableCodeView.
  3494     panel add:scrollableCodeView.
  3495     ^ scrollableCodeView
  3495     ^ scrollableCodeView
  3496 
  3496 
  3499 
  3499 
  3500 initializeContextListViewIn:panel
  3500 initializeContextListViewIn:panel
  3501     |v|
  3501     |v|
  3502 
  3502 
  3503     v := HVScrollableView
  3503     v := HVScrollableView
  3504 		for:SelectionInListView
  3504                 for:SelectionInListView
  3505 		miniScrollerH:true
  3505                 miniScrollerH:true
  3506 		miniScrollerV:false
  3506                 miniScrollerV:false
  3507 		in:panel.
  3507                 in:panel.
  3508     v autoHideHorizontalScrollBar:true.
  3508     v autoHideHorizontalScrollBar:true.
  3509 
  3509 
  3510     contextView := v scrolledView.
  3510     contextView := v scrolledView.
  3511     contextView action:[:lineNr | self showSelection:lineNr].
  3511     contextView action:[:lineNr | self showSelection:lineNr].
  3512     contextView doubleClickAction:[:line | self browseImplementingClass].
  3512     contextView doubleClickAction:[:line | self browseImplementingClass].
  3592     |hpanel|
  3592     |hpanel|
  3593 
  3593 
  3594     hpanel := VariableHorizontalPanel in:panel.
  3594     hpanel := VariableHorizontalPanel in:panel.
  3595 
  3595 
  3596     receiverInspector := InspectorView
  3596     receiverInspector := InspectorView
  3597 				origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)
  3597                                 origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)
  3598 				    in:hpanel.
  3598                                     in:hpanel.
  3599     receiverInspector fieldListLabel:'Receiver'.
  3599     receiverInspector fieldListLabel:'Receiver'.
  3600 
  3600 
  3601     contextInspector := ContextInspectorView
  3601     contextInspector := ContextInspectorView
  3602 				origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  3602                                 origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  3603 				    in:hpanel.
  3603                                     in:hpanel.
  3604     contextInspector fieldListLabel:'Context'.
  3604     contextInspector fieldListLabel:'Context'.
  3605 
  3605 
  3606     ^ hpanel
  3606     ^ hpanel
  3607 !
  3607 !
  3608 
  3608 
  3723 
  3723 
  3724 postRealize
  3724 postRealize
  3725     super postRealize.
  3725     super postRealize.
  3726 
  3726 
  3727     inspecting ifTrue:[
  3727     inspecting ifTrue:[
  3728 	inspectedProcess notNil ifTrue:[
  3728         inspectedProcess notNil ifTrue:[
  3729 	    "
  3729             "
  3730 	     set prio somewhat higher (by 2, to allow walkBack-update process
  3730              set prio somewhat higher (by 2, to allow walkBack-update process
  3731 	     to run between mine and the debugged processes prio)
  3731              to run between mine and the debugged processes prio)
  3732 	    "
  3732             "
  3733 	    Processor activeProcess
  3733             Processor activeProcess
  3734 		priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)).
  3734                 priority:(((inspectedProcess priority + 2) min:(Processor highIOPriority)) max:(Processor userSchedulingPriority+1)).
  3735 	]
  3735         ]
  3736     ].
  3736     ].
  3737 
  3737 
  3738     self sensor addEventListener:self.
  3738     self sensor addEventListener:self.
  3739 
  3739 
  3740     "Created: 24.7.1997 / 18:17:44 / cg"
  3740     "Created: 24.7.1997 / 18:17:44 / cg"
  3743 reinitialize
  3743 reinitialize
  3744     "/ redefined - since the debugView runs on top of
  3744     "/ redefined - since the debugView runs on top of
  3745     "/ the debuggee, there would be no event loop for me.
  3745     "/ the debuggee, there would be no event loop for me.
  3746 
  3746 
  3747     self drawableId notNil ifTrue:[
  3747     self drawableId notNil ifTrue:[
  3748 	^ self
  3748         ^ self
  3749     ].
  3749     ].
  3750     "physically create the view & subviews"
  3750     "physically create the view & subviews"
  3751     self recreate.
  3751     self recreate.
  3752 !
  3752 !
  3753 
  3753 
  3765     receiverInspector release.
  3765     receiverInspector release.
  3766     contextInspector release.
  3766     contextInspector release.
  3767     inspectedProcess := nil.
  3767     inspectedProcess := nil.
  3768     contextArray := nil.
  3768     contextArray := nil.
  3769     ((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[
  3769     ((exitAction == #restart) or:[exitAction == #return or:[exitAction == #resend]]) ifFalse:[
  3770 	selectedContext := nil.
  3770         selectedContext := nil.
  3771     ].
  3771     ].
  3772     actualContext := firstContext := nil.
  3772     actualContext := firstContext := nil.
  3773     steppedContext := wrapperContext := nil.
  3773     steppedContext := wrapperContext := nil.
  3774     catchBlock := nil.
  3774     catchBlock := nil.
  3775     grabber := nil.
  3775     grabber := nil.
  3827 
  3827 
  3828 !DebugView methodsFor:'interrupt handling'!
  3828 !DebugView methodsFor:'interrupt handling'!
  3829 
  3829 
  3830 contextInterrupt
  3830 contextInterrupt
  3831     DebuggingDebugger == true ifTrue:[
  3831     DebuggingDebugger == true ifTrue:[
  3832 	'contextIRQ' printCR.
  3832         'contextIRQ' printCR.
  3833 	thisContext methodHome sender fullPrint.
  3833         thisContext methodHome sender fullPrint.
  3834     ].
  3834     ].
  3835     self stepOrNext
  3835     self stepOrNext
  3836 
  3836 
  3837     "Modified: / 30.10.1997 / 21:22:25 / cg"
  3837     "Modified: / 30.10.1997 / 21:22:25 / cg"
  3838 !
  3838 !
  3839 
  3839 
  3840 stepInterrupt
  3840 stepInterrupt
  3841     DebuggingDebugger == true ifTrue:[
  3841     DebuggingDebugger == true ifTrue:[
  3842 	'stepIRQ' print.
  3842         'stepIRQ' print.
  3843 	"/ ' in ' print. thisContext sender fullPrint.
  3843         "/ ' in ' print. thisContext sender fullPrint.
  3844 	'' printCR.
  3844         '' printCR.
  3845     ].
  3845     ].
  3846     Processor yield.
  3846     Processor yield.
  3847     self stepOrNext
  3847     self stepOrNext
  3848 
  3848 
  3849     "Modified: / 20-07-2012 / 14:06:54 / cg"
  3849     "Modified: / 20-07-2012 / 14:06:54 / cg"
  4532     selectedContext isNil ifTrue:[^ self].
  4532     selectedContext isNil ifTrue:[^ self].
  4533 
  4533 
  4534     cls := selectedContext receiver class.
  4534     cls := selectedContext receiver class.
  4535     sel := selectedContext selector.
  4535     sel := selectedContext selector.
  4536     (cls includesSelector:sel) ifFalse:[
  4536     (cls includesSelector:sel) ifFalse:[
  4537 	sel := nil
  4537         sel := nil
  4538     ].
  4538     ].
  4539     Tools::NewSystemBrowser addToBookMarks:cls selector:sel
  4539     Tools::NewSystemBrowser addToBookMarks:cls selector:sel
  4540 !
  4540 !
  4541 
  4541 
  4542 autoRaiseView
  4542 autoRaiseView
  4553 
  4553 
  4554 autoUpdateOff
  4554 autoUpdateOff
  4555     "stop the update process"
  4555     "stop the update process"
  4556 
  4556 
  4557     updateProcess notNil ifTrue:[
  4557     updateProcess notNil ifTrue:[
  4558 	monitorToggle lampColor:(Color yellow).
  4558         monitorToggle lampColor:(Color yellow).
  4559 	updateProcess terminate.
  4559         updateProcess terminate.
  4560 	updateProcess := nil
  4560         updateProcess := nil
  4561     ]
  4561     ]
  4562 !
  4562 !
  4563 
  4563 
  4564 autoUpdateOn
  4564 autoUpdateOn
  4565     "fork a subprocess which updates the contextList in regular intervals"
  4565     "fork a subprocess which updates the contextList in regular intervals"
  4566 
  4566 
  4567     updateProcess isNil ifTrue:[
  4567     updateProcess isNil ifTrue:[
  4568 	updateProcess :=
  4568         updateProcess :=
  4569 	    [
  4569             [
  4570 		[true] whileTrue:[
  4570                 [true] whileTrue:[
  4571 		    monitorToggle showLamp ifTrue:[
  4571                     monitorToggle showLamp ifTrue:[
  4572 			monitorToggle lampColor:(Color yellow).
  4572                         monitorToggle lampColor:(Color yellow).
  4573 		    ] ifFalse:[
  4573                     ] ifFalse:[
  4574 			monitorToggle activeForegroundColor:Color black.
  4574                         monitorToggle activeForegroundColor:Color black.
  4575 		    ].
  4575                     ].
  4576 		    (Delay forSeconds:0.25) wait.
  4576                     (Delay forSeconds:0.25) wait.
  4577 		    self updateContext.
  4577                     self updateContext.
  4578 		    monitorToggle showLamp ifTrue:[
  4578                     monitorToggle showLamp ifTrue:[
  4579 			monitorToggle lampColor:(Color red).
  4579                         monitorToggle lampColor:(Color red).
  4580 		    ] ifFalse:[
  4580                     ] ifFalse:[
  4581 			monitorToggle activeForegroundColor:Color red.
  4581                         monitorToggle activeForegroundColor:Color red.
  4582 		    ].
  4582                     ].
  4583 		    (Delay forSeconds:0.25) wait.
  4583                     (Delay forSeconds:0.25) wait.
  4584 		    self updateContext.
  4584                     self updateContext.
  4585 		]
  4585                 ]
  4586 	    ] forkAt:(Processor activePriority - 1)
  4586             ] forkAt:(Processor activePriority - 1)
  4587     ]
  4587     ]
  4588 
  4588 
  4589 !
  4589 !
  4590 
  4590 
  4591 browseBlocksHome
  4591 browseBlocksHome
  4631     selectedContext isNil ifTrue:[^ self].
  4631     selectedContext isNil ifTrue:[^ self].
  4632 
  4632 
  4633     cls := selectedContext receiver class.
  4633     cls := selectedContext receiver class.
  4634     sel := selectedContext selector.
  4634     sel := selectedContext selector.
  4635     (cls includesSelector:sel) ifFalse:[
  4635     (cls includesSelector:sel) ifFalse:[
  4636 	sel := nil
  4636         sel := nil
  4637     ].
  4637     ].
  4638     cls browserClass openInClass:cls selector:sel.
  4638     cls browserClass openInClass:cls selector:sel.
  4639 
  4639 
  4640     "Modified: / 3.2.1998 / 20:23:36 / cg"
  4640     "Modified: / 3.2.1998 / 20:23:36 / cg"
  4641 !
  4641 !
  4690     con := selectedContext ? actualContext.
  4690     con := selectedContext ? actualContext.
  4691     con isNil ifTrue:[^ self].
  4691     con isNil ifTrue:[^ self].
  4692 
  4692 
  4693     mthd := con method.
  4693     mthd := con method.
  4694     mthd notNil ifTrue:[
  4694     mthd notNil ifTrue:[
  4695 	who := mthd who.
  4695         who := mthd who.
  4696 	who notNil ifTrue:[
  4696         who notNil ifTrue:[
  4697 	    cls := who methodClass.
  4697             cls := who methodClass.
  4698 	    sel := who methodSelector.
  4698             sel := who methodSelector.
  4699 	] ifFalse:[
  4699         ] ifFalse:[
  4700 	    "might have been re-accepted"
  4700             "might have been re-accepted"
  4701 	    (home := con methodHome) notNil ifTrue:[
  4701             (home := con methodHome) notNil ifTrue:[
  4702 		(sel := home selector) notNil ifTrue:[
  4702                 (sel := home selector) notNil ifTrue:[
  4703 		    cls := home receiver class
  4703                     cls := home receiver class
  4704 			    whichClassImplements:selectedContext selector.
  4704                             whichClassImplements:selectedContext selector.
  4705 		    cls notNil ifTrue:[
  4705                     cls notNil ifTrue:[
  4706 			Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs.
  4706                         Dialog information:'Method has been changed/moved in the meanwhile.\Browser will show the most recent (current) version.' withCRs.
  4707 		    ].
  4707                     ].
  4708 		]
  4708                 ]
  4709 	    ].
  4709             ].
  4710 	].
  4710         ].
  4711     ].
  4711     ].
  4712     cls isNil ifTrue:[
  4712     cls isNil ifTrue:[
  4713 	"/ class not found - try receiver
  4713         "/ class not found - try receiver
  4714 	cls := con receiver class
  4714         cls := con receiver class
  4715     ].
  4715     ].
  4716 
  4716 
  4717     cls browserClass openInClass:cls selector:sel.
  4717     cls browserClass openInClass:cls selector:sel.
  4718 
  4718 
  4719     "Created: / 22-11-1995 / 21:27:01 / cg"
  4719     "Created: / 22-11-1995 / 21:27:01 / cg"
  4722 
  4722 
  4723 browseImplementors
  4723 browseImplementors
  4724     "open a browser on the implementors of the selected method's selector"
  4724     "open a browser on the implementors of the selected method's selector"
  4725 
  4725 
  4726     selectedContext isNil ifTrue:[
  4726     selectedContext isNil ifTrue:[
  4727 	^ self showError:'** select a context first **'
  4727         ^ self showError:'** select a context first **'
  4728     ].
  4728     ].
  4729     "/ selectedContext receiver class browserClass
  4729     "/ selectedContext receiver class browserClass
  4730     self withWaitCursorDo:[
  4730     self withWaitCursorDo:[
  4731 	UserPreferences systemBrowserClass
  4731         UserPreferences systemBrowserClass
  4732 	     browseImplementorsOf:selectedContext selector.
  4732              browseImplementorsOf:selectedContext selector.
  4733     ]
  4733     ]
  4734 
  4734 
  4735     "Modified: / 19-07-2012 / 11:44:03 / cg"
  4735     "Modified: / 19-07-2012 / 11:44:03 / cg"
  4736 !
  4736 !
  4737 
  4737 
  4739     "open a browser on the implementors of some selector"
  4739     "open a browser on the implementors of some selector"
  4740 
  4740 
  4741     |initial selector sel|
  4741     |initial selector sel|
  4742 
  4742 
  4743     (sel := codeView selection) notNil ifTrue:[
  4743     (sel := codeView selection) notNil ifTrue:[
  4744 	initial := SystemBrowser extractSelectorFrom:sel
  4744         initial := SystemBrowser extractSelectorFrom:sel
  4745     ].
  4745     ].
  4746     initial isNil ifTrue:[
  4746     initial isNil ifTrue:[
  4747 	initial := selectedContext isNil
  4747         initial := selectedContext isNil
  4748 			    ifTrue:[nil]
  4748                             ifTrue:[nil]
  4749 			    ifFalse:[selectedContext selector].
  4749                             ifFalse:[selectedContext selector].
  4750     ].
  4750     ].
  4751     selector := Dialog
  4751     selector := Dialog
  4752 		    requestSelector:'Selector to browse implementors of:'
  4752                     requestSelector:'Selector to browse implementors of:'
  4753 		    initialAnswer:initial.
  4753                     initialAnswer:initial.
  4754 
  4754 
  4755     selector notEmptyOrNil ifTrue:[
  4755     selector notEmptyOrNil ifTrue:[
  4756 	self withWaitCursorDo:[
  4756         self withWaitCursorDo:[
  4757 	    UserPreferences systemBrowserClass
  4757             UserPreferences systemBrowserClass
  4758 		browseImplementorsMatching:selector.
  4758                 browseImplementorsMatching:selector.
  4759 	]
  4759         ]
  4760     ]
  4760     ]
  4761 
  4761 
  4762     "Modified: / 19-07-2012 / 11:43:52 / cg"
  4762     "Modified: / 19-07-2012 / 11:43:52 / cg"
  4763 !
  4763 !
  4764 
  4764 
  4779     |cls sel|
  4779     |cls sel|
  4780 
  4780 
  4781     selectedContext isNil ifTrue:[^ self].
  4781     selectedContext isNil ifTrue:[^ self].
  4782 
  4782 
  4783     selectedContext isCheapBlockContext ifTrue:[
  4783     selectedContext isCheapBlockContext ifTrue:[
  4784 	cls := selectedContext method mclass.
  4784         cls := selectedContext method mclass.
  4785 	sel := selectedContext method selector.
  4785         sel := selectedContext method selector.
  4786     ] ifFalse:[
  4786     ] ifFalse:[
  4787 	cls := selectedContext receiver class.
  4787         cls := selectedContext receiver class.
  4788 	sel := selectedContext selector.
  4788         sel := selectedContext selector.
  4789     ].
  4789     ].
  4790     (cls includesSelector:sel) ifFalse:[
  4790     (cls includesSelector:sel) ifFalse:[
  4791 	sel := nil
  4791         sel := nil
  4792     ].
  4792     ].
  4793     cls browserClass openInClass:cls selector:sel.
  4793     cls browserClass openInClass:cls selector:sel.
  4794 
  4794 
  4795     "Modified: / 19-07-2012 / 11:29:48 / cg"
  4795     "Modified: / 19-07-2012 / 11:29:48 / cg"
  4796 !
  4796 !
  4797 
  4797 
  4798 browseSenders
  4798 browseSenders
  4799     "open a browser on the senders of the selected method's selector"
  4799     "open a browser on the senders of the selected method's selector"
  4800 
  4800 
  4801     selectedContext isNil ifTrue:[
  4801     selectedContext isNil ifTrue:[
  4802 	^ self showError:'** select a context first **'
  4802         ^ self showError:'** select a context first **'
  4803     ].
  4803     ].
  4804     self withWaitCursorDo:[
  4804     self withWaitCursorDo:[
  4805 	UserPreferences systemBrowserClass
  4805         UserPreferences systemBrowserClass
  4806 	    browseAllCallsOn:selectedContext selector.
  4806             browseAllCallsOn:selectedContext selector.
  4807     ]
  4807     ]
  4808 
  4808 
  4809     "Modified: / 19-07-2012 / 11:43:02 / cg"
  4809     "Modified: / 19-07-2012 / 11:43:02 / cg"
  4810 !
  4810 !
  4811 
  4811 
  4813     "open a browser on the senders of some selector"
  4813     "open a browser on the senders of some selector"
  4814 
  4814 
  4815     |initial selector sel|
  4815     |initial selector sel|
  4816 
  4816 
  4817     (sel := codeView selection) notNil ifTrue:[
  4817     (sel := codeView selection) notNil ifTrue:[
  4818 	initial := SystemBrowser extractSelectorFrom:sel
  4818         initial := SystemBrowser extractSelectorFrom:sel
  4819     ].
  4819     ].
  4820     initial isNil ifTrue:[
  4820     initial isNil ifTrue:[
  4821 	initial := selectedContext isNil
  4821         initial := selectedContext isNil
  4822 			    ifTrue:[nil]
  4822                             ifTrue:[nil]
  4823 			    ifFalse:[selectedContext selector].
  4823                             ifFalse:[selectedContext selector].
  4824     ].
  4824     ].
  4825     selector := Dialog
  4825     selector := Dialog
  4826 		    requestSelector:'Selector to browse senders of:'
  4826                     requestSelector:'Selector to browse senders of:'
  4827 		    initialAnswer:initial.
  4827                     initialAnswer:initial.
  4828 
  4828 
  4829     selector notEmptyOrNil ifTrue:[
  4829     selector notEmptyOrNil ifTrue:[
  4830 	self withWaitCursorDo:[
  4830         self withWaitCursorDo:[
  4831 	    UserPreferences systemBrowserClass
  4831             UserPreferences systemBrowserClass
  4832 		browseAllCallsOn:selector asSymbol.
  4832                 browseAllCallsOn:selector asSymbol.
  4833 	]
  4833         ]
  4834     ]
  4834     ]
  4835 
  4835 
  4836     "Modified: / 19-07-2012 / 11:43:29 / cg"
  4836     "Modified: / 19-07-2012 / 11:43:29 / cg"
  4837 !
  4837 !
  4838 
  4838 
  4845 !
  4845 !
  4846 
  4846 
  4847 closeAllDebuggers
  4847 closeAllDebuggers
  4848     (Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?')
  4848     (Dialog confirm:'Close all Debuggers (without confirmation if code was changed)?')
  4849     ifFalse:[
  4849     ifFalse:[
  4850 	^ self
  4850         ^ self
  4851     ].
  4851     ].
  4852 
  4852 
  4853     self class allInstancesDo:[:debugger |
  4853     self class allInstancesDo:[:debugger |
  4854 	debugger ~~ self ifTrue:[
  4854         debugger ~~ self ifTrue:[
  4855 	    debugger busy ifTrue:[
  4855             debugger busy ifTrue:[
  4856 		debugger destroyWithConfirmation:true.
  4856                 debugger destroyWithConfirmation:true.
  4857 	    ].
  4857             ].
  4858 	].
  4858         ].
  4859     ].
  4859     ].
  4860     self closeRequest.
  4860     self closeRequest.
  4861 
  4861 
  4862     "Created: / 23-03-2012 / 12:40:22 / cg"
  4862     "Created: / 23-03-2012 / 12:40:22 / cg"
  4863 !
  4863 !
  4877      Show the full verbose context without filtering."
  4877      Show the full verbose context without filtering."
  4878 
  4878 
  4879     |infoText|
  4879     |infoText|
  4880 
  4880 
  4881     firstContext isNil ifTrue:[
  4881     firstContext isNil ifTrue:[
  4882 	infoText := 'No context, no walkback'.
  4882         infoText := 'No context, no walkback'.
  4883     ] ifFalse:[
  4883     ] ifFalse:[
  4884 	exceptionInfoLabel notNil ifTrue:[
  4884         exceptionInfoLabel notNil ifTrue:[
  4885 	    infoText := exceptionInfoLabel label , '\\' withCRs.
  4885             infoText := exceptionInfoLabel label , '\\' withCRs.
  4886 	] ifFalse:[
  4886         ] ifFalse:[
  4887 	    infoText := ''
  4887             infoText := ''
  4888 	].
  4888         ].
  4889 	infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection.
  4889         infoText := infoText asStringCollection, firstContext fullPrintAllString asStringCollection.
  4890     ].
  4890     ].
  4891 
  4891 
  4892     self setClipboardText:infoText
  4892     self setClipboardText:infoText
  4893 
  4893 
  4894     "Modified: 28.8.1995 / 15:31:59 / claus"
  4894     "Modified: 28.8.1995 / 15:31:59 / claus"
  4987     |oldPrio newPrio s|
  4987     |oldPrio newPrio s|
  4988 
  4988 
  4989     oldPrio := (inspectedProcess ? Processor activeProcess) priority.
  4989     oldPrio := (inspectedProcess ? Processor activeProcess) priority.
  4990 
  4990 
  4991     [
  4991     [
  4992 	s := Dialog
  4992         s := Dialog
  4993 		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)\')
  4993                 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)\')
  4994 		initialAnswer:oldPrio printString.
  4994                 initialAnswer:oldPrio printString.
  4995 	s isEmptyOrNil ifTrue:[^ self].
  4995         s isEmptyOrNil ifTrue:[^ self].
  4996 	newPrio := Integer readFrom:s onError:nil.
  4996         newPrio := Integer readFrom:s onError:nil.
  4997 	newPrio isNil
  4997         newPrio isNil
  4998     ] whileTrue.
  4998     ] whileTrue.
  4999 
  4999 
  5000     newPrio := newPrio max:(Processor lowestPriority).
  5000     newPrio := newPrio max:(Processor lowestPriority).
  5001     newPrio := newPrio min:(Processor highestPriority).
  5001     newPrio := newPrio min:(Processor highestPriority).
  5002     newPrio >= Processor highIOPriority ifTrue:[
  5002     newPrio >= Processor highIOPriority ifTrue:[
  5003 	(Dialog
  5003         (Dialog
  5004 		confirm:(resources
  5004                 confirm:(resources
  5005 			    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?'))
  5005                             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?'))
  5006 	ifFalse:[^ self].
  5006         ifFalse:[^ self].
  5007     ].
  5007     ].
  5008     (inspectedProcess ? Processor activeProcess) priority:newPrio.
  5008     (inspectedProcess ? Processor activeProcess) priority:newPrio.
  5009 
  5009 
  5010     "Created: / 07-03-2012 / 14:15:09 / cg"
  5010     "Created: / 07-03-2012 / 14:15:09 / cg"
  5011 !
  5011 !
  5083 
  5083 
  5084     selectionIndex := contextView selection.
  5084     selectionIndex := contextView selection.
  5085     restart := true.
  5085     restart := true.
  5086 
  5086 
  5087     selectorToDefine notNil ifTrue:[
  5087     selectorToDefine notNil ifTrue:[
  5088 	selector := selectorToDefine.
  5088         selector := selectorToDefine.
  5089 	receiversClass := classToDefineIn.
  5089         receiversClass := classToDefineIn.
  5090     ] ifFalse:[
  5090     ] ifFalse:[
  5091 	selector := actualContext selector.
  5091         selector := actualContext selector.
  5092 	receiversClass := actualContext receiver class.
  5092         receiversClass := actualContext receiver class.
  5093     ].
  5093     ].
  5094 
  5094 
  5095     implClass := actualContext receiver class whichClassIncludesSelector:selector.
  5095     implClass := actualContext receiver class whichClassIncludesSelector:selector.
  5096     implClass notNil ifTrue:[
  5096     implClass notNil ifTrue:[
  5097 	"/ must be a subclassResponsibility
  5097         "/ must be a subclassResponsibility
  5098 
  5098 
  5099 	idx := contextArray identityIndexOf:actualContext.
  5099         idx := contextArray identityIndexOf:actualContext.
  5100 	idx > 1 ifTrue:[
  5100         idx > 1 ifTrue:[
  5101 	    callee := contextArray at:idx-1.
  5101             callee := contextArray at:idx-1.
  5102 
  5102 
  5103 	    callee selector == #subclassResponsibility ifTrue:[
  5103             callee selector == #subclassResponsibility ifTrue:[
  5104 		restart := false.
  5104                 restart := false.
  5105 	    ]
  5105             ]
  5106 	].
  5106         ].
  5107     ].
  5107     ].
  5108 
  5108 
  5109     "generate nice argument names"
  5109     "generate nice argument names"
  5110     bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag.
  5110     bagOfClassNames := (actualContext args collect:[:eachArg | eachArg class name]) asBag.
  5111     bagOfUsedClassNames := Bag new.
  5111     bagOfUsedClassNames := Bag new.
  5112     argNames := actualContext args
  5112     argNames := actualContext args
  5113 		    collect:
  5113                     collect:
  5114 			[:eachArg |
  5114                         [:eachArg |
  5115 			    |nm|
  5115                             |nm|
  5116 
  5116 
  5117 			    nm := eachArg class nameWithoutPrefix.
  5117                             nm := eachArg class nameWithoutPrefix.
  5118 			    (bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[
  5118                             (bagOfClassNames occurrencesOf:nm) == 1 ifTrue:[
  5119 				nm article , nm
  5119                                 nm article , nm
  5120 			    ] ifFalse:[
  5120                             ] ifFalse:[
  5121 				bagOfUsedClassNames add:nm.
  5121                                 bagOfUsedClassNames add:nm.
  5122 				nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString
  5122                                 nm asLowercaseFirst , (bagOfUsedClassNames occurrencesOf:nm) printString
  5123 			    ].
  5123                             ].
  5124 			].
  5124                         ].
  5125 
  5125 
  5126     proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames.
  5126     proto := Method methodDefinitionTemplateForSelector:selector andArgumentNames:argNames.
  5127 
  5127 
  5128     haltStmtDef := '    self halt:''please define %2 here''.'.
  5128     haltStmtDef := '    self halt:''please define %2 here''.'.
  5129     haltStmtFix := '    self halt:''please change %2 as required''.'.
  5129     haltStmtFix := '    self halt:''please change %2 as required''.'.
  5130 
  5130 
  5131 
  5131 
  5132     ( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[
  5132     ( { UndefinedObject . True . False } includes:receiversClass ) ifTrue:[
  5133 	(self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?')
  5133         (self confirm:'Are you sure you want to add this method (to ',receiversClass name,') ?')
  5134 	ifFalse:[
  5134         ifFalse:[
  5135 	    ^ self
  5135             ^ self
  5136 	]
  5136         ]
  5137     ].
  5137     ].
  5138 
  5138 
  5139 
  5139 
  5140     "/ code for a getter
  5140     "/ code for a getter
  5141     (receiversClass instVarNames includes:selector) ifTrue:[
  5141     (receiversClass instVarNames includes:selector) ifTrue:[
  5142 	code := '%1\' , haltStmtFix , '\    ^ %2'.
  5142         code := '%1\' , haltStmtFix , '\    ^ %2'.
  5143 	cat := 'accessing'.
  5143         cat := 'accessing'.
  5144     ].
  5144     ].
  5145 
  5145 
  5146     "/ code for a setter
  5146     "/ code for a setter
  5147     (selector numArgs == 1
  5147     (selector numArgs == 1
  5148     and:[(selector endsWith:':')
  5148     and:[(selector endsWith:':')
  5149     and:[receiversClass instVarNames includes:(selector copyButLast:1)]])
  5149     and:[receiversClass instVarNames includes:(selector copyButLast:1)]])
  5150     ifTrue:[
  5150     ifTrue:[
  5151 	varName := selector copyButLast:1.
  5151         varName := selector copyButLast:1.
  5152 	argName := argNames first.
  5152         argName := argNames first.
  5153 	code := '%1\' , haltStmtFix , '\    %3 := %4.'.
  5153         code := '%1\' , haltStmtFix , '\    %3 := %4.'.
  5154 	cat := 'accessing'.
  5154         cat := 'accessing'.
  5155     ].
  5155     ].
  5156 
  5156 
  5157     "/ code for a tester
  5157     "/ code for a tester
  5158     (selector numArgs == 0
  5158     (selector numArgs == 0
  5159     and:[(selector startsWith:'is')
  5159     and:[(selector startsWith:'is')
  5160     and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]])
  5160     and:[(Smalltalk classNamed:(selector copyFrom:3)) notNil ]])
  5161     ifTrue:[
  5161     ifTrue:[
  5162 	(receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[
  5162         (receiversClass nameWithoutPrefix = (selector copyFrom:3)) ifTrue:[
  5163 	    code := '%1\' , haltStmtFix , '\    ^ true.'.
  5163             code := '%1\' , haltStmtFix , '\    ^ true.'.
  5164 	] ifFalse:[
  5164         ] ifFalse:[
  5165 	    code := '%1\' , haltStmtFix , '\    ^ false.'.
  5165             code := '%1\' , haltStmtFix , '\    ^ false.'.
  5166 	].
  5166         ].
  5167 	cat := 'testing'.
  5167         cat := 'testing'.
  5168     ].
  5168     ].
  5169 
  5169 
  5170 "/    actualContext receiver isClass ifTrue:[
  5170 "/    actualContext receiver isClass ifTrue:[
  5171 "/        selector == #new ifTrue:[
  5171 "/        selector == #new ifTrue:[
  5172 "/            code := '%1\' , haltStmt , '\    ^ self basicNew initialize'
  5172 "/            code := '%1\' , haltStmt , '\    ^ self basicNew initialize'
  5174 "/        selector == #'new:' ifTrue:[
  5174 "/        selector == #'new:' ifTrue:[
  5175 "/            code := '%1\' , haltStmt , '\    ^ (self basicNew:arg) initialize'
  5175 "/            code := '%1\' , haltStmt , '\    ^ (self basicNew:arg) initialize'
  5176 "/        ].
  5176 "/        ].
  5177 "/    ].
  5177 "/    ].
  5178     code isNil ifTrue:[
  5178     code isNil ifTrue:[
  5179 	code := '%1\' , haltStmtDef
  5179         code := '%1\' , haltStmtDef
  5180     ].
  5180     ].
  5181 
  5181 
  5182     self
  5182     self
  5183 	codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs
  5183         codeAccept:(code bindWith:proto with:selector with:varName with:argName) withCRs
  5184 	inClass:receiversClass
  5184         inClass:receiversClass
  5185 	unwind:false
  5185         unwind:false
  5186 	category:cat
  5186         category:cat
  5187 	onCancel:[^ self].
  5187         onCancel:[^ self].
  5188 
  5188 
  5189     self doShowSelection:selectionIndex.
  5189     self doShowSelection:selectionIndex.
  5190     restart ifTrue:[
  5190     restart ifTrue:[
  5191 	self doRestart
  5191         self doRestart
  5192     ]
  5192     ]
  5193 
  5193 
  5194     "Modified: / 23-03-2012 / 09:49:31 / cg"
  5194     "Modified: / 23-03-2012 / 09:49:31 / cg"
  5195 !
  5195 !
  5196 
  5196 
  5198     "select the first application-model context.
  5198     "select the first application-model context.
  5199      This is another great helper, when you hit an exception,
  5199      This is another great helper, when you hit an exception,
  5200      to quickly navigate to the responsible code of you application"
  5200      to quickly navigate to the responsible code of you application"
  5201 
  5201 
  5202     contextArray keysAndValuesDo:[:i :c |
  5202     contextArray keysAndValuesDo:[:i :c |
  5203 	|nextCon nextRcvr dialog|
  5203         |nextCon nextRcvr dialog|
  5204 
  5204 
  5205 	"/ find the first appModel context
  5205         "/ find the first appModel context
  5206 	nextCon := contextArray at:i+1.
  5206         nextCon := contextArray at:i+1.
  5207 	"/
  5207         "/
  5208 	"/ while not in the appModel
  5208         "/ while not in the appModel
  5209 	"/
  5209         "/
  5210 	[
  5210         [
  5211 	    nextRcvr := nextCon receiver.
  5211             nextRcvr := nextCon receiver.
  5212 	    (nextRcvr isKindOf:ApplicationModel)
  5212             (nextRcvr isKindOf:ApplicationModel)
  5213 	] whileFalse:[
  5213         ] whileFalse:[
  5214 	    nextCon := nextCon sender
  5214             nextCon := nextCon sender
  5215 	].
  5215         ].
  5216 	self selectContext:nextCon.
  5216         self selectContext:nextCon.
  5217 	^ self.
  5217         ^ self.
  5218     ].
  5218     ].
  5219     "/ not found
  5219     "/ not found
  5220     gotoApplicationActionMethodButton disable.
  5220     gotoApplicationActionMethodButton disable.
  5221 !
  5221 !
  5222 
  5222 
  5224     "select the context where the dialog was opened.
  5224     "select the context where the dialog was opened.
  5225      This is a great helper, when you press interrupt while a modal dialog
  5225      This is a great helper, when you press interrupt while a modal dialog
  5226      is open, to quickly navigate to the corresponding opening code of you application"
  5226      is open, to quickly navigate to the corresponding opening code of you application"
  5227 
  5227 
  5228     contextArray keysAndValuesDo:[:i :c |
  5228     contextArray keysAndValuesDo:[:i :c |
  5229 	|nextCon nextRcvr dialog|
  5229         |nextCon nextRcvr dialog|
  5230 
  5230 
  5231 	"/ find the openModal, then walk upward
  5231         "/ find the openModal, then walk upward
  5232 	((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[
  5232         ((c selector == #openModal) or:[c selector == #openModal:]) ifTrue:[
  5233 	    dialog := c receiver.
  5233             dialog := c receiver.
  5234 	    nextCon := contextArray at:i+1.
  5234             nextCon := contextArray at:i+1.
  5235 	    "/
  5235             "/
  5236 	    "/ while still in dialog code
  5236             "/ while still in dialog code
  5237 	    "/
  5237             "/
  5238 	    [
  5238             [
  5239 		nextRcvr := nextCon receiver.
  5239                 nextRcvr := nextCon receiver.
  5240 		(nextRcvr == dialog)
  5240                 (nextRcvr == dialog)
  5241 		or:[ nextRcvr == dialog class
  5241                 or:[ nextRcvr == dialog class
  5242 		or:[ nextRcvr == DialogBox ]]
  5242                 or:[ nextRcvr == DialogBox ]]
  5243 	    ] whileTrue:[
  5243             ] whileTrue:[
  5244 		(nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[
  5244                 (nextCon isBlockContext and:[ nextCon methodHome notNil]) ifTrue:[
  5245 		    nextCon := nextCon methodHome
  5245                     nextCon := nextCon methodHome
  5246 		].
  5246                 ].
  5247 		nextCon := nextCon sender.
  5247                 nextCon := nextCon sender.
  5248 	    ].
  5248             ].
  5249 	    "/
  5249             "/
  5250 	    "/ while still in a Notification
  5250             "/ while still in a Notification
  5251 	    "/
  5251             "/
  5252 	    [
  5252             [
  5253 		nextRcvr := nextCon receiver.
  5253                 nextRcvr := nextCon receiver.
  5254 		(nextRcvr isKindOf:UserInformation)
  5254                 (nextRcvr isKindOf:UserInformation)
  5255 		or:[ nextRcvr isBehavior
  5255                 or:[ nextRcvr isBehavior
  5256 		     and:[nextRcvr includesBehavior:UserInformation]]
  5256                      and:[nextRcvr includesBehavior:UserInformation]]
  5257 	    ] whileTrue:[
  5257             ] whileTrue:[
  5258 		nextCon := nextCon sender
  5258                 nextCon := nextCon sender
  5259 	    ].
  5259             ].
  5260 	    "/
  5260             "/
  5261 	    "/ while still in UIBuilder
  5261             "/ while still in UIBuilder
  5262 	    "/
  5262             "/
  5263 	    [
  5263             [
  5264 		nextRcvr := nextCon receiver.
  5264                 nextRcvr := nextCon receiver.
  5265 		(nextRcvr isKindOf:WindowBuilder)
  5265                 (nextRcvr isKindOf:WindowBuilder)
  5266 	    ] whileTrue:[
  5266             ] whileTrue:[
  5267 		nextCon := nextCon sender
  5267                 nextCon := nextCon sender
  5268 	    ].
  5268             ].
  5269 	    "/
  5269             "/
  5270 	    "/ while still in SimpleDialog
  5270             "/ while still in SimpleDialog
  5271 	    "/
  5271             "/
  5272 	    [
  5272             [
  5273 		nextRcvr := nextCon receiver.
  5273                 nextRcvr := nextCon receiver.
  5274 		(nextRcvr class == SimpleDialog)
  5274                 (nextRcvr class == SimpleDialog)
  5275 	    ] whileTrue:[
  5275             ] whileTrue:[
  5276 		nextCon := nextCon sender
  5276                 nextCon := nextCon sender
  5277 	    ].
  5277             ].
  5278 	    "/
  5278             "/
  5279 	    "/ while still in applicationModel support code
  5279             "/ while still in applicationModel support code
  5280 	    "/
  5280             "/
  5281 	    [
  5281             [
  5282 		(nextCon selector startsWith:'openDialogSpec').
  5282                 (nextCon selector startsWith:'openDialogSpec').
  5283 	    ] whileTrue:[
  5283             ] whileTrue:[
  5284 		nextCon := nextCon sender
  5284                 nextCon := nextCon sender
  5285 	    ].
  5285             ].
  5286 	    self selectContext:nextCon.
  5286             self selectContext:nextCon.
  5287 	    ^ self.
  5287             ^ self.
  5288 	]
  5288         ]
  5289     ].
  5289     ].
  5290     "/ not found
  5290     "/ not found
  5291     gotoDialogOpenerButton disable.
  5291     gotoDialogOpenerButton disable.
  5292 !
  5292 !
  5293 
  5293 
  5354     "Modified: 7.3.1997 / 18:39:00 / cg"
  5354     "Modified: 7.3.1997 / 18:39:00 / cg"
  5355 !
  5355 !
  5356 
  5356 
  5357 doNoTrace
  5357 doNoTrace
  5358     traceView notNil ifTrue:[
  5358     traceView notNil ifTrue:[
  5359 	traceView topView destroy.
  5359         traceView topView destroy.
  5360 	traceView := nil.
  5360         traceView := nil.
  5361     ].
  5361     ].
  5362     tracing := false
  5362     tracing := false
  5363 !
  5363 !
  5364 
  5364 
  5365 doOpenReportMailApp
  5365 doOpenReportMailApp
  5368     | str |
  5368     | str |
  5369 
  5369 
  5370     str := '' writeStream.
  5370     str := '' writeStream.
  5371 
  5371 
  5372     str nextPutLine:('Error notification from '
  5372     str nextPutLine:('Error notification from '
  5373 		    , OperatingSystem getLoginName
  5373                     , OperatingSystem getLoginName
  5374 		    , '@'
  5374                     , '@'
  5375 		    , OperatingSystem getHostName).
  5375                     , OperatingSystem getHostName).
  5376     str cr.
  5376     str cr.
  5377 
  5377 
  5378     str nextPutLine:('Time: ' , Timestamp now printString).
  5378     str nextPutLine:('Time: ' , Timestamp now printString).
  5379     str nextPutLine:('STX Version: ' , Smalltalk versionString).
  5379     str nextPutLine:('STX Version: ' , Smalltalk versionString).
  5380     str nextPutLine:('Description: ' , self label).
  5380     str nextPutLine:('Description: ' , self label).
  5383 "/    str nextPutLine:('Parameter: ', printedException parameter printString).
  5383 "/    str nextPutLine:('Parameter: ', printedException parameter printString).
  5384     str nextPutLine:'Backtrace:'.
  5384     str nextPutLine:'Backtrace:'.
  5385     str cr.
  5385     str cr.
  5386 
  5386 
  5387     firstContext notNil ifTrue:[
  5387     firstContext notNil ifTrue:[
  5388 	firstContext fullPrintAllOn:str.
  5388         firstContext fullPrintAllOn:str.
  5389     ].
  5389     ].
  5390     str cr;cr.
  5390     str cr;cr.
  5391 
  5391 
  5392     SendMailTool
  5392     SendMailTool
  5393 	openForMessage:(str contents)
  5393         openForMessage:(str contents)
  5394 	withSubject:('STX Error:[', self label, ']')
  5394         withSubject:('STX Error:[', self label, ']')
  5395 	preOpenBlock:[:inst|
  5395         preOpenBlock:[:inst|
  5396 	    inst recipientEntryField value:'error@exept.de'
  5396             inst recipientEntryField value:'error@exept.de'
  5397 	].
  5397         ].
  5398 
  5398 
  5399     "Modified: / 20-09-2007 / 12:40:40 / cg"
  5399     "Modified: / 20-09-2007 / 12:40:40 / cg"
  5400 !
  5400 !
  5401 
  5401 
  5402 doResend
  5402 doResend
  5672 
  5672 
  5673 doTraceStep
  5673 doTraceStep
  5674     "tracestep - not implemented yet"
  5674     "tracestep - not implemented yet"
  5675 
  5675 
  5676     canContinue ifTrue:[
  5676     canContinue ifTrue:[
  5677 	tracing := true.
  5677         tracing := true.
  5678 	self doStep
  5678         self doStep
  5679     ]
  5679     ]
  5680 !
  5680 !
  5681 
  5681 
  5682 exit
  5682 exit
  5683     "exit from menu: immediate exit from smalltalk"
  5683     "exit from menu: immediate exit from smalltalk"
  5691     con := self selectedContext.
  5691     con := self selectedContext.
  5692     con isNil ifTrue:[^ self].
  5692     con isNil ifTrue:[^ self].
  5693 
  5693 
  5694     con := con sender.
  5694     con := con sender.
  5695     [con notNil] whileTrue:[
  5695     [con notNil] whileTrue:[
  5696 	(aBlock value:con) ifTrue:[
  5696         (aBlock value:con) ifTrue:[
  5697 	    (self selectContext:con) ifTrue:[
  5697             (self selectContext:con) ifTrue:[
  5698 		additionalAction value:con.
  5698                 additionalAction value:con.
  5699 		^ self.
  5699                 ^ self.
  5700 	    ]
  5700             ]
  5701 	].
  5701         ].
  5702 	con := con sender.
  5702         con := con sender.
  5703     ].
  5703     ].
  5704 
  5704 
  5705     Dialog information:'None found'.
  5705     Dialog information:'None found'.
  5706 !
  5706 !
  5707 
  5707 
  5710 
  5710 
  5711     stringToSearch := Dialog request:'Search what:'.
  5711     stringToSearch := Dialog request:'Search what:'.
  5712     stringToSearch isEmptyOrNil ifTrue:[^ self].
  5712     stringToSearch isEmptyOrNil ifTrue:[^ self].
  5713 
  5713 
  5714     self
  5714     self
  5715 	findContextForWhich:[:con |
  5715         findContextForWhich:[:con |
  5716 	    con method notNil
  5716             con method notNil
  5717 	    and:[ (source := con method source) notNil
  5717             and:[ (source := con method source) notNil
  5718 	    and:[ (source includesString:stringToSearch) ]]
  5718             and:[ (source includesString:stringToSearch) ]]
  5719 	]
  5719         ]
  5720 	thenDo:[:con |
  5720         thenDo:[:con |
  5721 	    codeView searchFwd:stringToSearch.
  5721             codeView searchFwd:stringToSearch.
  5722 	]
  5722         ]
  5723 !
  5723 !
  5724 
  5724 
  5725 findContextWithValueInVariable
  5725 findContextWithValueInVariable
  5726     |valueStringToSearch|
  5726     |valueStringToSearch|
  5727 
  5727 
  5728     valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'.
  5728     valueStringToSearch := Dialog request:'Search for a local value whith printString containing:'.
  5729     valueStringToSearch isEmptyOrNil ifTrue:[^ self].
  5729     valueStringToSearch isEmptyOrNil ifTrue:[^ self].
  5730 
  5730 
  5731     self
  5731     self
  5732 	findContextForWhich:[:con |
  5732         findContextForWhich:[:con |
  5733 	    con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase]
  5733             con argsAndVars contains:[:val | val printString asLowercase includesString: valueStringToSearch asLowercase]
  5734 	]
  5734         ]
  5735 	thenDo:[:con | ]
  5735         thenDo:[:con | ]
  5736 !
  5736 !
  5737 
  5737 
  5738 findHandlerFor
  5738 findHandlerFor
  5739     |exClass con|
  5739     |exClass con|
  5740 
  5740 
  5741     (con := self selectedContext) isNil ifTrue:[
  5741     (con := self selectedContext) isNil ifTrue:[
  5742 	con := contextArray at:1
  5742         con := contextArray at:1
  5743     ].
  5743     ].
  5744     con sender isNil ifTrue:[
  5744     con sender isNil ifTrue:[
  5745 	self information:'Context has already returned'.
  5745         self information:'Context has already returned'.
  5746 	^ self
  5746         ^ self
  5747     ].
  5747     ].
  5748 
  5748 
  5749     exClass := Dialog
  5749     exClass := Dialog
  5750 		choose:'Exception class:'
  5750                 choose:'Exception class:'
  5751 		fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name])
  5751                 fromList:(GenericException withAllSubclasses copyAsOrderedCollection sort:[:a :b | a name < b name])
  5752 		lines:25
  5752                 lines:25
  5753 		title:'Choose Exception class'.
  5753                 title:'Choose Exception class'.
  5754     exClass isNil ifTrue:[^ self].
  5754     exClass isNil ifTrue:[^ self].
  5755 
  5755 
  5756     self
  5756     self
  5757 	findContextForWhich:[:con |
  5757         findContextForWhich:[:con |
  5758 	    con isHandleContext
  5758             con isHandleContext
  5759 	    and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ]
  5759             and:[ (con receiver handlerForSignal:exClass context:con originator:nil) notNil ]
  5760 	]
  5760         ]
  5761 	thenDo:[:con |
  5761         thenDo:[:con |
  5762 	    self selectContext:con sender.
  5762             self selectContext:con sender.
  5763 	]
  5763         ]
  5764 !
  5764 !
  5765 
  5765 
  5766 findHomeContext
  5766 findHomeContext
  5767     |con home|
  5767     |con home|
  5768 
  5768 
  5769     (con := self selectedContext) isNil ifTrue:[
  5769     (con := self selectedContext) isNil ifTrue:[
  5770 	self beep.
  5770         self beep.
  5771 	^ self.
  5771         ^ self.
  5772     ].
  5772     ].
  5773     (home := con home) isNil ifTrue:[
  5773     (home := con home) isNil ifTrue:[
  5774 	self beep.
  5774         self beep.
  5775 	^ self.
  5775         ^ self.
  5776     ].
  5776     ].
  5777 
  5777 
  5778     "/ still have to find it - home could be elsewhere (another process)
  5778     "/ still have to find it - home could be elsewhere (another process)
  5779     "/ (i.e. cannot simply select it)
  5779     "/ (i.e. cannot simply select it)
  5780 
  5780 
  5781     self
  5781     self
  5782 	findContextForWhich:[:con |
  5782         findContextForWhich:[:con |
  5783 	    con == home
  5783             con == home
  5784 	]
  5784         ]
  5785 	thenDo:[:con |
  5785         thenDo:[:con |
  5786 	    self selectContext:con.
  5786             self selectContext:con.
  5787 	]
  5787         ]
  5788 !
  5788 !
  5789 
  5789 
  5790 findNextExceptionHandlerContext
  5790 findNextExceptionHandlerContext
  5791     self
  5791     self
  5792 	findContextForWhich:[:con |
  5792         findContextForWhich:[:con |
  5793 	    con isHandleContext
  5793             con isHandleContext
  5794 	]
  5794         ]
  5795 	thenDo:[:con |
  5795         thenDo:[:con |
  5796 	    self selectContext:con sender.
  5796             self selectContext:con sender.
  5797 	]
  5797         ]
  5798 !
  5798 !
  5799 
  5799 
  5800 inspectContext
  5800 inspectContext
  5801     "launch an inspector on the currently selected context"
  5801     "launch an inspector on the currently selected context"
  5802 
  5802 
  5803     |con|
  5803     |con|
  5804 
  5804 
  5805     (con := self selectedContext) notNil ifTrue:[
  5805     (con := self selectedContext) notNil ifTrue:[
  5806 	con inspect.
  5806         con inspect.
  5807     ]
  5807     ]
  5808 
  5808 
  5809     "Modified: / 17-07-2012 / 12:52:34 / cg"
  5809     "Modified: / 17-07-2012 / 12:52:34 / cg"
  5810 !
  5810 !
  5811 
  5811 
  5813     "launch an inspector on the currently selected context's method"
  5813     "launch an inspector on the currently selected context's method"
  5814 
  5814 
  5815     |con|
  5815     |con|
  5816 
  5816 
  5817     (con := self selectedContext) notNil ifTrue:[
  5817     (con := self selectedContext) notNil ifTrue:[
  5818 	con method inspect.
  5818         con method inspect.
  5819     ]
  5819     ]
  5820 !
  5820 !
  5821 
  5821 
  5822 inspectProcessesApplication
  5822 inspectProcessesApplication
  5823     "inspect the application (of the process, if it is a GUI process)"
  5823     "inspect the application (of the process, if it is a GUI process)"
  5977 
  5977 
  5978 openSettingsDialog
  5978 openSettingsDialog
  5979     |settingsList|
  5979     |settingsList|
  5980 
  5980 
  5981     settingsList :=
  5981     settingsList :=
  5982 	#(
  5982         #(
  5983 	   #('Debugger'       #'AbstractSettingsApplication::DebuggerSettingsAppl'            )
  5983            #('Debugger'       #'AbstractSettingsApplication::DebuggerSettingsAppl'            )
  5984 	   #('Editor'         #'AbstractSettingsApplication::EditSettingsAppl'                )
  5984            #('Editor'         #'AbstractSettingsApplication::EditSettingsAppl'                )
  5985 	   #('Syntax Color'   #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
  5985            #('Syntax Color'   #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
  5986 	   #('Code Format'    #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
  5986            #('Code Format'    #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
  5987 	).
  5987         ).
  5988 
  5988 
  5989     SettingsDialog
  5989     SettingsDialog
  5990 	openWithList:settingsList
  5990         openWithList:settingsList
  5991 	label:(resources string:'Debugger Settings').
  5991         label:(resources string:'Debugger Settings').
  5992 !
  5992 !
  5993 
  5993 
  5994 processesApplication
  5994 processesApplication
  5995     "if the debugged process is a GUI process,
  5995     "if the debugged process is a GUI process,
  5996      AND it has an applicaiton, return it.
  5996      AND it has an applicaiton, return it.
  5998 
  5998 
  5999     |p wgs app nonModalWGs|
  5999     |p wgs app nonModalWGs|
  6000 
  6000 
  6001     p := inspectedProcess ? Processor activeProcess.
  6001     p := inspectedProcess ? Processor activeProcess.
  6002     (p notNil and:[p isGUIProcess]) ifTrue:[
  6002     (p notNil and:[p isGUIProcess]) ifTrue:[
  6003 	wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p].
  6003         wgs := WindowGroup scheduledWindowGroups select:[:wg | wg process == p].
  6004 	nonModalWGs := wgs reject:[:wg | wg isModal].
  6004         nonModalWGs := wgs reject:[:wg | wg isModal].
  6005 	nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application].
  6005         nonModalWGs notEmpty ifTrue:[^ nonModalWGs first application].
  6006 
  6006 
  6007 	wgs do:[:wg |
  6007         wgs do:[:wg |
  6008 	    |wgi|
  6008             |wgi|
  6009 
  6009 
  6010 	    wgi := wg.
  6010             wgi := wg.
  6011 	    [wgi notNil] whileTrue:[
  6011             [wgi notNil] whileTrue:[
  6012 		(app := wgi application) notNil ifTrue:[^ app].
  6012                 (app := wgi application) notNil ifTrue:[^ app].
  6013 		wgi isModal ifTrue:[
  6013                 wgi isModal ifTrue:[
  6014 		    wgi := wgi previousGroup
  6014                     wgi := wgi previousGroup
  6015 		] ifFalse:[
  6015                 ] ifFalse:[
  6016 		    wgi := nil.
  6016                     wgi := nil.
  6017 		]
  6017                 ]
  6018 	    ]
  6018             ]
  6019 	]
  6019         ]
  6020     ].
  6020     ].
  6021     ^ nil
  6021     ^ nil
  6022 !
  6022 !
  6023 
  6023 
  6024 quickTerminate
  6024 quickTerminate
  6025     "quick terminate - the process will get no chance for cleanup actions"
  6025     "quick terminate - the process will get no chance for cleanup actions"
  6026 
  6026 
  6027     inspecting ifTrue:[
  6027     inspecting ifTrue:[
  6028 	self processPerform:#terminateNoSignal.
  6028         self processPerform:#terminateNoSignal.
  6029 	^ self
  6029         ^ self
  6030     ].
  6030     ].
  6031 
  6031 
  6032     steppedContext := wrapperContext := nil.
  6032     steppedContext := wrapperContext := nil.
  6033     haveControl := false.
  6033     haveControl := false.
  6034     exitAction := #quickTerminate.
  6034     exitAction := #quickTerminate.
  6036     "exit private event-loop"
  6036     "exit private event-loop"
  6037     catchBlock value.
  6037     catchBlock value.
  6038 
  6038 
  6039     "/ not reached (normally)
  6039     "/ not reached (normally)
  6040     inspecting ifFalse:[
  6040     inspecting ifFalse:[
  6041 	'DebugView [warning]: quick terminate failed' errorPrintCR.
  6041         'DebugView [warning]: quick terminate failed' errorPrintCR.
  6042 	(self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[
  6042         (self confirm:'Regular quick terminate failed - do it the hard way ?') ifTrue:[
  6043 	    Debugger newDebugger.
  6043             Debugger newDebugger.
  6044 	    Processor activeProcess terminateNoSignal.
  6044             Processor activeProcess terminateNoSignal.
  6045 	]
  6045         ]
  6046     ].
  6046     ].
  6047     terminateButton turnOff.
  6047     terminateButton turnOff.
  6048 
  6048 
  6049     "Modified: 10.1.1997 / 17:42:10 / cg"
  6049     "Modified: 10.1.1997 / 17:42:10 / cg"
  6050 !
  6050 !
  6063 selectContext:aContext
  6063 selectContext:aContext
  6064     |idx|
  6064     |idx|
  6065 
  6065 
  6066     idx := contextArray identityIndexOf:aContext.
  6066     idx := contextArray identityIndexOf:aContext.
  6067     idx == 0 ifTrue:[
  6067     idx == 0 ifTrue:[
  6068 	"/ some contexts hidden?
  6068         "/ some contexts hidden?
  6069 	(self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[
  6069         (self showingDenseWalkback or:[self showingSupportCode not]) ifTrue:[
  6070 	    Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'.
  6070             Dialog information:'Context is hidden - disabling the "hideSupportCode" option (see view menu)'.
  6071 	    self showFullWalkback.
  6071             self showFullWalkback.
  6072 	    self showingDenseWalkback:false.
  6072             self showingDenseWalkback:false.
  6073 	    self showingSupportCode:true.
  6073             self showingSupportCode:true.
  6074 	].
  6074         ].
  6075 	idx := contextArray identityIndexOf:aContext.
  6075         idx := contextArray identityIndexOf:aContext.
  6076     ].
  6076     ].
  6077     idx ~~ 0 ifTrue:[
  6077     idx ~~ 0 ifTrue:[
  6078 	self selectContextWithIndex:idx.
  6078         self selectContextWithIndex:idx.
  6079 	^ true.
  6079         ^ true.
  6080     ].
  6080     ].
  6081     ^ false
  6081     ^ false
  6082 !
  6082 !
  6083 
  6083 
  6084 selectedContext
  6084 selectedContext
  6096 
  6096 
  6097 showFullWalkback
  6097 showFullWalkback
  6098     "double the number of contexts shown"
  6098     "double the number of contexts shown"
  6099 
  6099 
  6100     contextArray notNil ifTrue:[
  6100     contextArray notNil ifTrue:[
  6101 	nChainShown := 9999.
  6101         nChainShown := 9999.
  6102 	self redisplayBacktrace.
  6102         self redisplayBacktrace.
  6103     ]
  6103     ]
  6104 
  6104 
  6105     "Created: / 23-07-2012 / 12:24:02 / cg"
  6105     "Created: / 23-07-2012 / 12:24:02 / cg"
  6106 !
  6106 !
  6107 
  6107 
  6108 showMore
  6108 showMore
  6109     "double the number of contexts shown"
  6109     "double the number of contexts shown"
  6110 
  6110 
  6111     contextArray notNil ifTrue:[
  6111     contextArray notNil ifTrue:[
  6112 	nChainShown := nChainShown * 2.
  6112         nChainShown := nChainShown * 2.
  6113 	self redisplayBacktrace.
  6113         self redisplayBacktrace.
  6114     ]
  6114     ]
  6115 
  6115 
  6116     "Modified: / 17.11.2001 / 20:14:31 / cg"
  6116     "Modified: / 17.11.2001 / 20:14:31 / cg"
  6117 !
  6117 !
  6118 
  6118 
  6188     "skip until some particular method is invoked."
  6188     "skip until some particular method is invoked."
  6189 
  6189 
  6190     |selector|
  6190     |selector|
  6191 
  6191 
  6192     selector := Dialog
  6192     selector := Dialog
  6193 		request:'Skip until entering what (matchpattern):'
  6193                 request:'Skip until entering what (matchpattern):'
  6194 		initialAnswer:self goodSkipUntilSelector.
  6194                 initialAnswer:self goodSkipUntilSelector.
  6195     selector size == 0 ifTrue:[^ self].
  6195     selector size == 0 ifTrue:[^ self].
  6196 
  6196 
  6197     stepUntilEntering := selector asSymbol.
  6197     stepUntilEntering := selector asSymbol.
  6198     stepHow := #send.
  6198     stepHow := #send.
  6199     self doStep:-1.
  6199     self doStep:-1.
  6201     "Modified: 3.3.1997 / 20:56:32 / cg"
  6201     "Modified: 3.3.1997 / 20:56:32 / cg"
  6202 !
  6202 !
  6203 
  6203 
  6204 toggleShowSupportCode
  6204 toggleShowSupportCode
  6205     hideSupportCode ifTrue:[
  6205     hideSupportCode ifTrue:[
  6206 	self showSupportCode
  6206         self showSupportCode
  6207     ] ifFalse:[
  6207     ] ifFalse:[
  6208 	self hideSupportCode
  6208         self hideSupportCode
  6209     ].
  6209     ].
  6210 
  6210 
  6211     "Modified: / 17-11-2001 / 20:07:45 / cg"
  6211     "Modified: / 17-11-2001 / 20:07:45 / cg"
  6212     "Created: / 10-06-2012 / 21:28:17 / cg"
  6212     "Created: / 10-06-2012 / 21:28:17 / cg"
  6213 !
  6213 !
  6223 
  6223 
  6224     |m mthd cls mCls rCls|
  6224     |m mthd cls mCls rCls|
  6225 
  6225 
  6226     m := contextView middleButtonMenu.
  6226     m := contextView middleButtonMenu.
  6227     m notNil ifTrue:[
  6227     m notNil ifTrue:[
  6228 	m disable:#removeBreakpoint.
  6228         m disable:#removeBreakpoint.
  6229 	m disable:#addBreakpoint.
  6229         m disable:#addBreakpoint.
  6230 	canShowMore ifFalse:[
  6230         canShowMore ifFalse:[
  6231 	    m disable:#showMore
  6231             m disable:#showMore
  6232 	].
  6232         ].
  6233 
  6233 
  6234 	selectedContext notNil ifTrue:[
  6234         selectedContext notNil ifTrue:[
  6235 	    m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn).
  6235             m enableAll:#(browseImplementors browseSenders inspectContext skip skipForReturn).
  6236 
  6236 
  6237 	    mthd := selectedContext method.
  6237             mthd := selectedContext method.
  6238 	    mthd notNil ifTrue:[
  6238             mthd notNil ifTrue:[
  6239 		cls := mCls := mthd containingClass.
  6239                 cls := mCls := mthd containingClass.
  6240 		mthd isBreakpointed ifTrue:[
  6240                 mthd isBreakpointed ifTrue:[
  6241 		    m enable:#removeBreakpoint.
  6241                     m enable:#removeBreakpoint.
  6242 		] ifFalse:[
  6242                 ] ifFalse:[
  6243 		    m enable:#addBreakpoint.
  6243                     m enable:#addBreakpoint.
  6244 		]
  6244                 ]
  6245 	    ].
  6245             ].
  6246 	    (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[
  6246             (selectedContext isBlockContext and:[selectedContext home isNil]) ifTrue:[
  6247 		"/ a cheap block's context
  6247                 "/ a cheap block's context
  6248 	    ] ifFalse:[
  6248             ] ifFalse:[
  6249 		rCls := selectedContext receiver class.
  6249                 rCls := selectedContext receiver class.
  6250 		cls isNil ifTrue:[
  6250                 cls isNil ifTrue:[
  6251 		    cls := rCls
  6251                     cls := rCls
  6252 		].
  6252                 ].
  6253 	    ].
  6253             ].
  6254 	    cls notNil ifTrue:[
  6254             cls notNil ifTrue:[
  6255 		m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  6255                 m enableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  6256 		rCls == mCls ifTrue:[
  6256                 rCls == mCls ifTrue:[
  6257 		    m disable:#browseReceiversClass
  6257                     m disable:#browseReceiversClass
  6258 		].
  6258                 ].
  6259 		mCls isNil ifTrue:[
  6259                 mCls isNil ifTrue:[
  6260 		    m disable:#browseImplementingClass
  6260                     m disable:#browseImplementingClass
  6261 		]
  6261                 ]
  6262 
  6262 
  6263 	    ] ifFalse:[
  6263             ] ifFalse:[
  6264 		m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  6264                 m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy browseFullClassProtocol).
  6265 	    ].
  6265             ].
  6266 	    mthd notNil ifTrue:[
  6266             mthd notNil ifTrue:[
  6267 		m enableAll:#(browseImplementingClass).
  6267                 m enableAll:#(browseImplementingClass).
  6268 	    ].
  6268             ].
  6269 	    selectedContext isCheapBlockContext ifTrue:[
  6269             selectedContext isCheapBlockContext ifTrue:[
  6270 		m disableAll:#(browseReceiversClass).
  6270                 m disableAll:#(browseReceiversClass).
  6271 	    ].
  6271             ].
  6272 	    selectedContext receiver isBlock ifTrue:[
  6272             selectedContext receiver isBlock ifTrue:[
  6273 		m enableAll:#(browseBlocksHome).
  6273                 m enableAll:#(browseBlocksHome).
  6274 	    ] ifFalse:[
  6274             ] ifFalse:[
  6275 		m disableAll:#(browseBlocksHome).
  6275                 m disableAll:#(browseBlocksHome).
  6276 	    ].
  6276             ].
  6277 	] ifFalse:[
  6277         ] ifFalse:[
  6278 	    m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy
  6278             m disableAll:#(browseImplementingClass browseReceiversClass browseClassHierarchy
  6279 			   browseBlocksHome browseFullClassProtocol).
  6279                            browseBlocksHome browseFullClassProtocol).
  6280 	]
  6280         ]
  6281     ]
  6281     ]
  6282 
  6282 
  6283     "Modified: / 19-07-2012 / 11:53:30 / cg"
  6283     "Modified: / 19-07-2012 / 11:53:30 / cg"
  6284 ! !
  6284 ! !
  6285 
  6285 
  6289     "add a breakpoint on the selected contexts method - if any"
  6289     "add a breakpoint on the selected contexts method - if any"
  6290 
  6290 
  6291     |implementorClass method|
  6291     |implementorClass method|
  6292 
  6292 
  6293     selectedContext isNil ifTrue:[
  6293     selectedContext isNil ifTrue:[
  6294 	^ self showError:'** select a context first **'
  6294         ^ self showError:'** select a context first **'
  6295     ].
  6295     ].
  6296     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6296     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6297 	^ self
  6297         ^ self
  6298     ].
  6298     ].
  6299 
  6299 
  6300     implementorClass := selectedContext methodClass.
  6300     implementorClass := selectedContext methodClass.
  6301     implementorClass notNil ifTrue:[
  6301     implementorClass notNil ifTrue:[
  6302 	method := implementorClass compiledMethodAt:selectedContext selector.
  6302         method := implementorClass compiledMethodAt:selectedContext selector.
  6303 	(method notNil and:[method isBreakpointed not]) ifTrue:[
  6303         (method notNil and:[method isBreakpointed not]) ifTrue:[
  6304 	    method setBreakPoint
  6304             method setBreakPoint
  6305 	]
  6305         ]
  6306     ].
  6306     ].
  6307     contextView middleButtonMenu disable:#addBreakpoint.
  6307     contextView middleButtonMenu disable:#addBreakpoint.
  6308     contextView middleButtonMenu enable:#removeBreakpoint.
  6308     contextView middleButtonMenu enable:#removeBreakpoint.
  6309 
  6309 
  6310     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6310     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6328     self allowBreakPointsInDebugger:true
  6328     self allowBreakPointsInDebugger:true
  6329 !
  6329 !
  6330 
  6330 
  6331 ignoreAllHaltsForCurrentProcess
  6331 ignoreAllHaltsForCurrentProcess
  6332     self
  6332     self
  6333 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6333         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6334 	orThisReceiverClass:false orCurrentProcess:true
  6334         orThisReceiverClass:false orCurrentProcess:true
  6335 	orIfCalledFromMethod:nil
  6335         orIfCalledFromMethod:nil
  6336 	forAll:true.
  6336         forAll:true.
  6337 
  6337 
  6338     "Created: / 27-01-2012 / 11:32:14 / cg"
  6338     "Created: / 27-01-2012 / 11:32:14 / cg"
  6339 !
  6339 !
  6340 
  6340 
  6341 ignoreAllHaltsForThisReceiverClass
  6341 ignoreAllHaltsForThisReceiverClass
  6342     self
  6342     self
  6343 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6343         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6344 	orThisReceiverClass:true orCurrentProcess:false
  6344         orThisReceiverClass:true orCurrentProcess:false
  6345 	orIfCalledFromMethod:nil
  6345         orIfCalledFromMethod:nil
  6346 	forAll:true.
  6346         forAll:true.
  6347 
  6347 
  6348     "Created: / 27-01-2012 / 11:32:14 / cg"
  6348     "Created: / 27-01-2012 / 11:32:14 / cg"
  6349 !
  6349 !
  6350 
  6350 
  6351 ignoreAllHaltsForever
  6351 ignoreAllHaltsForever
  6352     self
  6352     self
  6353 	addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false
  6353         addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false
  6354 	orThisReceiverClass:false orCurrentProcess:false
  6354         orThisReceiverClass:false orCurrentProcess:false
  6355 	orIfCalledFromMethod:nil
  6355         orIfCalledFromMethod:nil
  6356 	forAll:true.
  6356         forAll:true.
  6357 
  6357 
  6358     "Created: / 08-05-2011 / 10:19:56 / cg"
  6358     "Created: / 08-05-2011 / 10:19:56 / cg"
  6359 !
  6359 !
  6360 
  6360 
  6361 ignoreAllHaltsIfCalledFromMethod:aMethod
  6361 ignoreAllHaltsIfCalledFromMethod:aMethod
  6362     self
  6362     self
  6363 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6363         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6364 	orThisReceiverClass:false orCurrentProcess:false
  6364         orThisReceiverClass:false orCurrentProcess:false
  6365 	orIfCalledFromMethod:aMethod
  6365         orIfCalledFromMethod:aMethod
  6366 	forAll:true.
  6366         forAll:true.
  6367 !
  6367 !
  6368 
  6368 
  6369 ignoreAllHaltsUntilShiftKeyIsPressed
  6369 ignoreAllHaltsUntilShiftKeyIsPressed
  6370     self
  6370     self
  6371 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  6371         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  6372 	orThisReceiverClass:false orCurrentProcess:false
  6372         orThisReceiverClass:false orCurrentProcess:false
  6373 	orIfCalledFromMethod:nil
  6373         orIfCalledFromMethod:nil
  6374 	forAll:true.
  6374         forAll:true.
  6375 
  6375 
  6376     "Created: / 27-01-2012 / 11:32:14 / cg"
  6376     "Created: / 27-01-2012 / 11:32:14 / cg"
  6377 !
  6377 !
  6378 
  6378 
  6379 ignoreBreakpointsWithThisParameterForever
  6379 ignoreBreakpointsWithThisParameterForever
  6383     "Created: / 06-03-2012 / 12:35:48 / cg"
  6383     "Created: / 06-03-2012 / 12:35:48 / cg"
  6384 !
  6384 !
  6385 
  6385 
  6386 ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
  6386 ignoreBreakpointsWithThisParameterUntilShiftKeyIsPressed
  6387     self
  6387     self
  6388 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  6388         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  6389 	orThisReceiverClass:false orCurrentProcess:false
  6389         orThisReceiverClass:false orCurrentProcess:false
  6390 	orIfCalledFromMethod:nil
  6390         orIfCalledFromMethod:nil
  6391 	forAll:false.
  6391         forAll:false.
  6392 
  6392 
  6393     "Created: / 06-03-2012 / 12:35:22 / cg"
  6393     "Created: / 06-03-2012 / 12:35:22 / cg"
  6394 !
  6394 !
  6395 
  6395 
  6396 ignoreHaltForCurrentProcess
  6396 ignoreHaltForCurrentProcess
  6397     self
  6397     self
  6398 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6398         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6399 	orThisReceiverClass:false orCurrentProcess:true
  6399         orThisReceiverClass:false orCurrentProcess:true
  6400 	orIfCalledFromMethod:nil
  6400         orIfCalledFromMethod:nil
  6401 	forAll:false.
  6401         forAll:false.
  6402 
  6402 
  6403     "Created: / 27-01-2012 / 11:32:14 / cg"
  6403     "Created: / 27-01-2012 / 11:32:14 / cg"
  6404 !
  6404 !
  6405 
  6405 
  6406 ignoreHaltForThisReceiverClass
  6406 ignoreHaltForThisReceiverClass
  6407     self
  6407     self
  6408 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6408         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6409 	orThisReceiverClass:true orCurrentProcess:false
  6409         orThisReceiverClass:true orCurrentProcess:false
  6410 	orIfCalledFromMethod:nil
  6410         orIfCalledFromMethod:nil
  6411 	forAll:false.
  6411         forAll:false.
  6412 
  6412 
  6413     "Created: / 27-01-2012 / 11:32:14 / cg"
  6413     "Created: / 27-01-2012 / 11:32:14 / cg"
  6414 !
  6414 !
  6415 
  6415 
  6416 ignoreHaltForever
  6416 ignoreHaltForever
  6417     self
  6417     self
  6418 	addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false
  6418         addIgnoredHaltForCount:-1 orTimeDuration:nil orUntilShiftKey:false
  6419 	orThisReceiverClass:false orCurrentProcess:false
  6419         orThisReceiverClass:false orCurrentProcess:false
  6420 	orIfCalledFromMethod:nil
  6420         orIfCalledFromMethod:nil
  6421 	forAll:false.
  6421         forAll:false.
  6422 
  6422 
  6423     "Modified: / 27-01-2012 / 11:31:37 / cg"
  6423     "Modified: / 27-01-2012 / 11:31:37 / cg"
  6424 !
  6424 !
  6425 
  6425 
  6426 ignoreHaltIfCalledFromMethod:aMethod
  6426 ignoreHaltIfCalledFromMethod:aMethod
  6427     self
  6427     self
  6428 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6428         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:false
  6429 	orThisReceiverClass:false orCurrentProcess:false
  6429         orThisReceiverClass:false orCurrentProcess:false
  6430 	orIfCalledFromMethod:aMethod
  6430         orIfCalledFromMethod:aMethod
  6431 	forAll:false.
  6431         forAll:false.
  6432 !
  6432 !
  6433 
  6433 
  6434 ignoreHaltUntilShiftKeyIsPressed
  6434 ignoreHaltUntilShiftKeyIsPressed
  6435     self
  6435     self
  6436 	addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  6436         addIgnoredHaltForCount:nil orTimeDuration:nil orUntilShiftKey:true
  6437 	orThisReceiverClass:false orCurrentProcess:false
  6437         orThisReceiverClass:false orCurrentProcess:false
  6438 	orIfCalledFromMethod:nil
  6438         orIfCalledFromMethod:nil
  6439 	forAll:false.
  6439         forAll:false.
  6440 
  6440 
  6441     "Created: / 27-01-2012 / 11:36:54 / cg"
  6441     "Created: / 27-01-2012 / 11:36:54 / cg"
  6442 !
  6442 !
  6443 
  6443 
  6444 menuForIgnoreAllBreakpointsIfCalledFromAnyOf
  6444 menuForIgnoreAllBreakpointsIfCalledFromAnyOf
  6461     m := Menu new.
  6461     m := Menu new.
  6462     count := 0.
  6462     count := 0.
  6463     already := IdentitySet new.
  6463     already := IdentitySet new.
  6464 
  6464 
  6465     contextArray do:[:con |
  6465     contextArray do:[:con |
  6466 	|mthd cls sel|
  6466         |mthd cls sel|
  6467 
  6467 
  6468 	mthd := con method.
  6468         mthd := con method.
  6469 	mthd notNil ifTrue:[
  6469         mthd notNil ifTrue:[
  6470 	    mthd isWrapped ifFalse:[
  6470             mthd isWrapped ifFalse:[
  6471 		(already includes:already) ifFalse:[
  6471                 (already includes:already) ifFalse:[
  6472 		    already add:mthd.
  6472                     already add:mthd.
  6473 		    m addItem:(MenuItem
  6473                     m addItem:(MenuItem
  6474 				label: (mthd whoString)
  6474                                 label: (mthd whoString)
  6475 				itemValue: [ forAllHaltsBoolean
  6475                                 itemValue: [ forAllHaltsBoolean
  6476 						ifTrue:[self ignoreHaltIfCalledFromMethod:mthd]
  6476                                                 ifTrue:[self ignoreHaltIfCalledFromMethod:mthd]
  6477 						ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd]
  6477                                                 ifFalse:[self ignoreAllHaltsIfCalledFromMethod:mthd]
  6478 					   ]
  6478                                            ]
  6479 				translateLabel: false).
  6479                                 translateLabel: false).
  6480 		    count := count + 1.
  6480                     count := count + 1.
  6481 		    (count > 20) ifTrue:[
  6481                     (count > 20) ifTrue:[
  6482 			^ m
  6482                         ^ m
  6483 		    ].
  6483                     ].
  6484 		]
  6484                 ]
  6485 	    ]
  6485             ]
  6486 	]
  6486         ]
  6487     ].
  6487     ].
  6488     ^ m
  6488     ^ m
  6489 !
  6489 !
  6490 
  6490 
  6491 openBreakPointBrowser
  6491 openBreakPointBrowser
  6496 
  6496 
  6497 openIgnoreAllHaltsUntilTimeElapsedDialog
  6497 openIgnoreAllHaltsUntilTimeElapsedDialog
  6498     |answer dT|
  6498     |answer dT|
  6499 
  6499 
  6500     [
  6500     [
  6501 	answer := Dialog
  6501         answer := Dialog
  6502 		    request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?')
  6502                     request:(resources string:'How long should all halts/breakpoints be ignored [smh] ?')
  6503 		    initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6503                     initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6504 	answer isEmptyOrNil ifTrue:[^ self].
  6504         answer isEmptyOrNil ifTrue:[^ self].
  6505 
  6505 
  6506 	dT := TimeDuration readFrom:answer onError:[ nil ].
  6506         dT := TimeDuration readFrom:answer onError:[ nil ].
  6507 	dT notNil ifTrue:[
  6507         dT notNil ifTrue:[
  6508 	    LastIgnoreHaltDuration := dT.
  6508             LastIgnoreHaltDuration := dT.
  6509 	    self
  6509             self
  6510 		addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  6510                 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  6511 		orThisReceiverClass:false orCurrentProcess:false
  6511                 orThisReceiverClass:false orCurrentProcess:false
  6512 		orIfCalledFromMethod:nil
  6512                 orIfCalledFromMethod:nil
  6513 		forAll:true.
  6513                 forAll:true.
  6514 	    ^ self.
  6514             ^ self.
  6515 	].
  6515         ].
  6516     ] loop
  6516     ] loop
  6517 
  6517 
  6518     "Created: / 08-05-2011 / 10:19:20 / cg"
  6518     "Created: / 08-05-2011 / 10:19:20 / cg"
  6519 !
  6519 !
  6520 
  6520 
  6521 openIgnoreBreakpointsWithThisParameterNTimesDialog
  6521 openIgnoreBreakpointsWithThisParameterNTimesDialog
  6522     |answer n|
  6522     |answer n|
  6523 
  6523 
  6524     [
  6524     [
  6525 	answer := Dialog
  6525         answer := Dialog
  6526 		    request:(resources
  6526                     request:(resources
  6527 				string:'How often should breakpoints with parameter "%1" be ignored ?'
  6527                                 string:'How often should breakpoints with parameter "%1" be ignored ?'
  6528 				with:breakPointParameter)
  6528                                 with:breakPointParameter)
  6529 		    initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  6529                     initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  6530 	answer isEmptyOrNil ifTrue:[^ self].
  6530         answer isEmptyOrNil ifTrue:[^ self].
  6531 
  6531 
  6532 	n := Integer readFrom:answer onError:nil.
  6532         n := Integer readFrom:answer onError:nil.
  6533 	n notNil ifTrue:[
  6533         n notNil ifTrue:[
  6534 	    LastIgnoreHaltNTimes := n.
  6534             LastIgnoreHaltNTimes := n.
  6535 	    self
  6535             self
  6536 		addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false
  6536                 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false
  6537 		orThisReceiverClass:false orCurrentProcess:false
  6537                 orThisReceiverClass:false orCurrentProcess:false
  6538 		orIfCalledFromMethod:nil
  6538                 orIfCalledFromMethod:nil
  6539 		forAll:false.
  6539                 forAll:false.
  6540 	    ^ self.
  6540             ^ self.
  6541 	].
  6541         ].
  6542     ] loop.
  6542     ] loop.
  6543 
  6543 
  6544     "Modified: / 27-01-2012 / 11:31:44 / cg"
  6544     "Modified: / 27-01-2012 / 11:31:44 / cg"
  6545     "Created: / 06-03-2012 / 12:28:51 / cg"
  6545     "Created: / 06-03-2012 / 12:28:51 / cg"
  6546 !
  6546 !
  6547 
  6547 
  6548 openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
  6548 openIgnoreBreakpointsWithThisParameterUntilTimeElapsedDialog
  6549     |answer dT|
  6549     |answer dT|
  6550 
  6550 
  6551     [
  6551     [
  6552 	answer := Dialog
  6552         answer := Dialog
  6553 		    request:(resources
  6553                     request:(resources
  6554 				string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?'
  6554                                 string:'How long should breakpoints with parameter "%1" be ignored (s/m/h) ?'
  6555 				with:breakPointParameter)
  6555                                 with:breakPointParameter)
  6556 		    initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6556                     initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6557 	answer isEmptyOrNil ifTrue:[^ self].
  6557         answer isEmptyOrNil ifTrue:[^ self].
  6558 
  6558 
  6559 	dT := TimeDuration readFrom:answer onError:[ nil ].
  6559         dT := TimeDuration readFrom:answer onError:[ nil ].
  6560 	dT notNil ifTrue:[
  6560         dT notNil ifTrue:[
  6561 	    LastIgnoreHaltDuration := dT.
  6561             LastIgnoreHaltDuration := dT.
  6562 	    self
  6562             self
  6563 		addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  6563                 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  6564 		orThisReceiverClass:false orCurrentProcess:false
  6564                 orThisReceiverClass:false orCurrentProcess:false
  6565 		orIfCalledFromMethod:nil
  6565                 orIfCalledFromMethod:nil
  6566 		forAll:false.
  6566                 forAll:false.
  6567 	    ^ self.
  6567             ^ self.
  6568 	].
  6568         ].
  6569     ] loop
  6569     ] loop
  6570 
  6570 
  6571     "Created: / 06-03-2012 / 12:03:36 / cg"
  6571     "Created: / 06-03-2012 / 12:03:36 / cg"
  6572 !
  6572 !
  6573 
  6573 
  6574 openIgnoreHaltNTimesDialog
  6574 openIgnoreHaltNTimesDialog
  6575     |answer n|
  6575     |answer n|
  6576 
  6576 
  6577     [
  6577     [
  6578 	answer := Dialog
  6578         answer := Dialog
  6579 		    request:(resources string:'How often should this halt be ignored ?')
  6579                     request:(resources string:'How often should this halt be ignored ?')
  6580 		    initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  6580                     initialAnswer:(LastIgnoreHaltNTimes ? '') printString.
  6581 	answer isEmptyOrNil ifTrue:[^ self].
  6581         answer isEmptyOrNil ifTrue:[^ self].
  6582 
  6582 
  6583 	n := Integer readFrom:answer onError:nil.
  6583         n := Integer readFrom:answer onError:nil.
  6584 	n notNil ifTrue:[
  6584         n notNil ifTrue:[
  6585 	    LastIgnoreHaltNTimes := n.
  6585             LastIgnoreHaltNTimes := n.
  6586 	    self
  6586             self
  6587 		addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false
  6587                 addIgnoredHaltForCount:n orTimeDuration:nil orUntilShiftKey:false
  6588 		orThisReceiverClass:false orCurrentProcess:false
  6588                 orThisReceiverClass:false orCurrentProcess:false
  6589 		orIfCalledFromMethod:nil
  6589                 orIfCalledFromMethod:nil
  6590 		forAll:false.
  6590                 forAll:false.
  6591 	    ^ self.
  6591             ^ self.
  6592 	].
  6592         ].
  6593     ] loop.
  6593     ] loop.
  6594 
  6594 
  6595     "Modified: / 27-01-2012 / 11:31:44 / cg"
  6595     "Modified: / 27-01-2012 / 11:31:44 / cg"
  6596 !
  6596 !
  6597 
  6597 
  6598 openIgnoreHaltUntilTimeElapsedDialog
  6598 openIgnoreHaltUntilTimeElapsedDialog
  6599     |answer dT|
  6599     |answer dT|
  6600 
  6600 
  6601     [
  6601     [
  6602 	answer := Dialog
  6602         answer := Dialog
  6603 		    request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?')
  6603                     request:(resources string:'How long should this halt/breakpoint be ignored (s/m/h) ?')
  6604 		    initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6604                     initialAnswer:(LastIgnoreHaltDuration ? '30s') printString.
  6605 	answer isEmptyOrNil ifTrue:[^ self].
  6605         answer isEmptyOrNil ifTrue:[^ self].
  6606 
  6606 
  6607 	dT := TimeDuration readFrom:answer onError:[ nil ].
  6607         dT := TimeDuration readFrom:answer onError:[ nil ].
  6608 	dT notNil ifTrue:[
  6608         dT notNil ifTrue:[
  6609 	    LastIgnoreHaltDuration := dT.
  6609             LastIgnoreHaltDuration := dT.
  6610 	    self
  6610             self
  6611 		addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  6611                 addIgnoredHaltForCount:nil orTimeDuration:dT orUntilShiftKey:false
  6612 		orThisReceiverClass:false orCurrentProcess:false
  6612                 orThisReceiverClass:false orCurrentProcess:false
  6613 		orIfCalledFromMethod:nil
  6613                 orIfCalledFromMethod:nil
  6614 		forAll:false.
  6614                 forAll:false.
  6615 	    ^ self.
  6615             ^ self.
  6616 	].
  6616         ].
  6617     ] loop
  6617     ] loop
  6618 
  6618 
  6619     "Modified: / 27-01-2012 / 11:31:47 / cg"
  6619     "Modified: / 27-01-2012 / 11:31:47 / cg"
  6620 !
  6620 !
  6621 
  6621 
  6622 removeAllBreakpoints
  6622 removeAllBreakpoints
  6623     "remove all trace & breakpoints - if any"
  6623     "remove all trace & breakpoints - if any"
  6624 
  6624 
  6625     self withExecuteCursorDo:[
  6625     self withExecuteCursorDo:[
  6626 	(MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[
  6626         (MessageTracer notNil and:[MessageTracer isLoaded]) ifTrue:[
  6627 	    MessageTracer unwrapAllMethods
  6627             MessageTracer unwrapAllMethods
  6628 	].
  6628         ].
  6629 	(MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[
  6629         (MethodWithBreakpoints notNil and:[MethodWithBreakpoints isLoaded]) ifTrue:[
  6630 	    MethodWithBreakpoints removeAllBreakpoints
  6630             MethodWithBreakpoints removeAllBreakpoints
  6631 	].
  6631         ].
  6632     ]
  6632     ]
  6633 
  6633 
  6634     "Modified: / 21.5.1998 / 01:44:43 / cg"
  6634     "Modified: / 21.5.1998 / 01:44:43 / cg"
  6635 !
  6635 !
  6636 
  6636 
  6638     "remove breakpoint on the selected contexts method - if any"
  6638     "remove breakpoint on the selected contexts method - if any"
  6639 
  6639 
  6640     |implementorClass method|
  6640     |implementorClass method|
  6641 
  6641 
  6642     selectedContext isNil ifTrue:[
  6642     selectedContext isNil ifTrue:[
  6643 	^ self showError:'** select a context first **'
  6643         ^ self showError:'** select a context first **'
  6644     ].
  6644     ].
  6645     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6645     (MessageTracer isNil or:[MessageTracer isLoaded not]) ifTrue:[
  6646 	^ self
  6646         ^ self
  6647     ].
  6647     ].
  6648 
  6648 
  6649     implementorClass := selectedContext methodClass.
  6649     implementorClass := selectedContext methodClass.
  6650     implementorClass notNil ifTrue:[
  6650     implementorClass notNil ifTrue:[
  6651 	method := implementorClass compiledMethodAt:selectedContext selector.
  6651         method := implementorClass compiledMethodAt:selectedContext selector.
  6652 	(method notNil and:[method isBreakpointed]) ifTrue:[
  6652         (method notNil and:[method isBreakpointed]) ifTrue:[
  6653 	    method clearBreakPoint
  6653             method clearBreakPoint
  6654 	]
  6654         ]
  6655     ].
  6655     ].
  6656     contextView middleButtonMenu disable:#removeBreakpoint.
  6656     contextView middleButtonMenu disable:#removeBreakpoint.
  6657     contextView middleButtonMenu enable:#addBreakpoint.
  6657     contextView middleButtonMenu enable:#addBreakpoint.
  6658 
  6658 
  6659     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6659     "Modified: / 13.1.1998 / 00:24:47 / cg"
  6682 explainSelection
  6682 explainSelection
  6683     |interval crsrPos|
  6683     |interval crsrPos|
  6684 
  6684 
  6685     interval := self selectedInterval.
  6685     interval := self selectedInterval.
  6686     interval isEmpty ifTrue:[
  6686     interval isEmpty ifTrue:[
  6687 	crsrPos := codeView characterPositionOfCursor.
  6687         crsrPos := codeView characterPositionOfCursor.
  6688 	codeView characterUnderCursor isSeparator ifTrue:[
  6688         codeView characterUnderCursor isSeparator ifTrue:[
  6689 	    crsrPos := (crsrPos - 1) max:1
  6689             crsrPos := (crsrPos - 1) max:1
  6690 	].
  6690         ].
  6691 	interval := crsrPos to:crsrPos.
  6691         interval := crsrPos to:crsrPos.
  6692     ].
  6692     ].
  6693     self
  6693     self
  6694 	withNodeValueAtInterval:interval
  6694         withNodeValueAtInterval:interval
  6695 	do:[:value :description |
  6695         do:[:value :description |
  6696 	    self showValue:value
  6696             self showValue:value
  6697 	].
  6697         ].
  6698 !
  6698 !
  6699 
  6699 
  6700 findNodeForInterval:interval
  6700 findNodeForInterval:interval
  6701     |source|
  6701     |source|
  6702 
  6702 
  6739     lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering].
  6739     lastStepUntilEntering notNil ifTrue:[^ lastStepUntilEntering].
  6740     selectedContext isNil ifTrue:[^ nil].
  6740     selectedContext isNil ifTrue:[^ nil].
  6741     current := selectedContext selector.
  6741     current := selectedContext selector.
  6742     current isNil ifTrue:[^ nil].
  6742     current isNil ifTrue:[^ nil].
  6743     ('change:*' match:current) ifTrue:[
  6743     ('change:*' match:current) ifTrue:[
  6744 	^ 'update:*'
  6744         ^ 'update:*'
  6745     ].
  6745     ].
  6746     ^ nil
  6746     ^ nil
  6747 !
  6747 !
  6748 
  6748 
  6749 haltSelectors
  6749 haltSelectors
  6779 
  6779 
  6780 processPerform:aMessage
  6780 processPerform:aMessage
  6781     "do something, then update the context list"
  6781     "do something, then update the context list"
  6782 
  6782 
  6783     inspectedProcess isDead ifTrue:[
  6783     inspectedProcess isDead ifTrue:[
  6784 	self showTerminated.
  6784         self showTerminated.
  6785 	^ self
  6785         ^ self
  6786     ].
  6786     ].
  6787     inspectedProcess perform:aMessage.
  6787     inspectedProcess perform:aMessage.
  6788 
  6788 
  6789     "
  6789     "
  6790      give the process a chance to run, then update
  6790      give the process a chance to run, then update
  6835 !
  6835 !
  6836 
  6836 
  6837 showError:message
  6837 showError:message
  6838     codeView contents:(resources string:message).
  6838     codeView contents:(resources string:message).
  6839     shown ifTrue:[
  6839     shown ifTrue:[
  6840 	exclusive ifTrue:[
  6840         exclusive ifTrue:[
  6841 	    "/ consider this a kludge:
  6841             "/ consider this a kludge:
  6842 	    "/ if exclusive, cannot use flash, since it suspends
  6842             "/ if exclusive, cannot use flash, since it suspends
  6843 	    "/ (but we cannot suspend here ...)
  6843             "/ (but we cannot suspend here ...)
  6844 	    codeView redrawInverted. self flush.
  6844             codeView redrawInverted. self flush.
  6845 	    OperatingSystem millisecondDelay:200.
  6845             OperatingSystem millisecondDelay:200.
  6846 	    codeView redraw
  6846             codeView redraw
  6847 	] ifFalse:[
  6847         ] ifFalse:[
  6848 	    codeView flash
  6848             codeView flash
  6849 	]
  6849         ]
  6850     ]
  6850     ]
  6851 
  6851 
  6852     "Modified: / 18.11.2001 / 00:01:13 / cg"
  6852     "Modified: / 18.11.2001 / 00:01:13 / cg"
  6853 !
  6853 !
  6854 
  6854 
  6877 updateButtonsAndMenuItemsForContext:aContext
  6877 updateButtonsAndMenuItemsForContext:aContext
  6878     |m|
  6878     |m|
  6879 
  6879 
  6880     m := contextView middleButtonMenu.
  6880     m := contextView middleButtonMenu.
  6881     m notNil ifTrue:[
  6881     m notNil ifTrue:[
  6882 	self updateMenuItems.
  6882         self updateMenuItems.
  6883 
  6883 
  6884 	(inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[
  6884         (inspecting or:[AbortOperationRequest isHandledIn:aContext]) ifTrue:[
  6885 	    abortButton enable.
  6885             abortButton enable.
  6886 	    m enable:#doAbort.
  6886             m enable:#doAbort.
  6887 	] ifFalse:[
  6887         ] ifFalse:[
  6888 	    abortButton disable.
  6888             abortButton disable.
  6889 	    m disable:#doAbort.
  6889             m disable:#doAbort.
  6890 	].
  6890         ].
  6891 	exclusive ifTrue:[
  6891         exclusive ifTrue:[
  6892 	    terminateButton disable.
  6892             terminateButton disable.
  6893 	    m disable:#doTerminate.
  6893             m disable:#doTerminate.
  6894 	] ifFalse:[
  6894         ] ifFalse:[
  6895 	    terminateButton enable.
  6895             terminateButton enable.
  6896 	    m enable:#doTerminate.
  6896             m enable:#doTerminate.
  6897 	].
  6897         ].
  6898     ].
  6898     ].
  6899 
  6899 
  6900     mayProceed == false ifTrue:[
  6900     mayProceed == false ifTrue:[
  6901 	continueButton disable.
  6901         continueButton disable.
  6902 	m notNil ifTrue:[m disable:#doContinue].
  6902         m notNil ifTrue:[m disable:#doContinue].
  6903     ] ifFalse:[
  6903     ] ifFalse:[
  6904 	continueButton enable.
  6904         continueButton enable.
  6905 	m notNil ifTrue:[m enable:#doContinue]
  6905         m notNil ifTrue:[m enable:#doContinue]
  6906     ].
  6906     ].
  6907 
  6907 
  6908     isStoppedInModalDialog ifTrue:[
  6908     isStoppedInModalDialog ifTrue:[
  6909 	gotoDialogOpenerButton enable.
  6909         gotoDialogOpenerButton enable.
  6910 	gotoDialogOpenerButton beVisible.
  6910         gotoDialogOpenerButton beVisible.
  6911     ] ifFalse:[
  6911     ] ifFalse:[
  6912 	gotoDialogOpenerButton beInvisible.
  6912         gotoDialogOpenerButton beInvisible.
  6913     ].
  6913     ].
  6914 
  6914 
  6915     (isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[
  6915     (isStoppedInModalDialog not & isStoppedInApplicationAction) ifTrue:[
  6916 	gotoApplicationActionMethodButton enable.
  6916         gotoApplicationActionMethodButton enable.
  6917 	gotoApplicationActionMethodButton beVisible.
  6917         gotoApplicationActionMethodButton beVisible.
  6918     ] ifFalse:[
  6918     ] ifFalse:[
  6919 	gotoApplicationActionMethodButton beInvisible.
  6919         gotoApplicationActionMethodButton beInvisible.
  6920     ].
  6920     ].
  6921 
  6921 
  6922     "Created: / 06-07-2011 / 12:24:53 / cg"
  6922     "Created: / 06-07-2011 / 12:24:53 / cg"
  6923 !
  6923 !
  6924 
  6924 
  6925 updateContext
  6925 updateContext
  6926     |oldContext idx|
  6926     |oldContext idx|
  6927 
  6927 
  6928     inspectedProcess state == #dead ifTrue:[
  6928     inspectedProcess state == #dead ifTrue:[
  6929 	self showTerminated.
  6929         self showTerminated.
  6930 	^ self
  6930         ^ self
  6931     ].
  6931     ].
  6932 
  6932 
  6933     oldContext := selectedContext.
  6933     oldContext := selectedContext.
  6934     [
  6934     [
  6935 	(self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[
  6935         (self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[
  6936 	    oldContext notNil ifTrue:[
  6936             oldContext notNil ifTrue:[
  6937 		contextArray notNil ifTrue:[
  6937                 contextArray notNil ifTrue:[
  6938 		    idx := contextArray identityIndexOf:oldContext.
  6938                     idx := contextArray identityIndexOf:oldContext.
  6939 		    idx ~~ 0 ifTrue:[
  6939                     idx ~~ 0 ifTrue:[
  6940 			self showSelection:idx
  6940                         self showSelection:idx
  6941 		    ] ifFalse:[
  6941                     ] ifFalse:[
  6942 			codeView contents:('** context returned **')
  6942                         codeView contents:('** context returned **')
  6943 		    ]
  6943                     ]
  6944 		]
  6944                 ]
  6945 	    ]
  6945             ]
  6946 	].
  6946         ].
  6947     ] valueUninterruptably.
  6947     ] valueUninterruptably.
  6948 
  6948 
  6949     "Modified: 20.10.1996 / 18:11:24 / cg"
  6949     "Modified: 20.10.1996 / 18:11:24 / cg"
  6950 !
  6950 !
  6951 
  6951 
  6955     |node definingNode nm nmBold nameSymbol
  6955     |node definingNode nm nmBold nameSymbol
  6956      varIdx parentNode receiver con receiversNonMetaClass|
  6956      varIdx parentNode receiver con receiversNonMetaClass|
  6957 
  6957 
  6958     "/ interval printCR.
  6958     "/ interval printCR.
  6959     Error
  6959     Error
  6960 	handle:[:ex | ]
  6960         handle:[:ex | ]
  6961 	do:[
  6961         do:[
  6962 	    [
  6962             [
  6963 		node := self findNodeForInterval:interval
  6963                 node := self findNodeForInterval:interval
  6964 	    ] valueWithWatchDog:[ ^ self ] afterMilliseconds:50.
  6964             ] valueWithWatchDog:[ ^ self ] afterMilliseconds:50.
  6965 	].
  6965         ].
  6966 
  6966 
  6967     node isNil ifTrue:[ ^ self ].
  6967     node isNil ifTrue:[ ^ self ].
  6968     node isVariable ifFalse:[
  6968     node isVariable ifFalse:[
  6969 	"/ Transcript showCR:node.
  6969         "/ Transcript showCR:node.
  6970 	^ self
  6970         ^ self
  6971     ].
  6971     ].
  6972 
  6972 
  6973     nm := node name.
  6973     nm := node name.
  6974     nmBold := nm allBold.
  6974     nmBold := nm allBold.
  6975     actualContext isNil ifTrue:[^ self ].
  6975     actualContext isNil ifTrue:[^ self ].
  6976     actualContext methodHome isNil ifTrue:[^ self ].
  6976     actualContext methodHome isNil ifTrue:[^ self ].
  6977     receiver := actualContext methodHome receiver.
  6977     receiver := actualContext methodHome receiver.
  6978 
  6978 
  6979     (nm = 'self') ifTrue:[
  6979     (nm = 'self') ifTrue:[
  6980 	aBlock value:receiver value:'receiver' allBold.
  6980         aBlock value:receiver value:'receiver' allBold.
  6981 	^ self
  6981         ^ self
  6982     ].
  6982     ].
  6983     (nm = 'super') ifTrue:[
  6983     (nm = 'super') ifTrue:[
  6984 	aBlock value:receiver value:'receiver' allBold.
  6984         aBlock value:receiver value:'receiver' allBold.
  6985 	^ self
  6985         ^ self
  6986     ].
  6986     ].
  6987     (nm = 'thisContext') ifTrue:[
  6987     (nm = 'thisContext') ifTrue:[
  6988 	aBlock value:actualContext value:'context' allBold.
  6988         aBlock value:actualContext value:'context' allBold.
  6989 	^ self
  6989         ^ self
  6990     ].
  6990     ].
  6991 
  6991 
  6992     definingNode := node whoDefines:nm.
  6992     definingNode := node whoDefines:nm.
  6993     definingNode isNil ifTrue:[
  6993     definingNode isNil ifTrue:[
  6994 	(receiver class allInstVarNames includes:nm) ifTrue:[
  6994         (receiver class allInstVarNames includes:nm) ifTrue:[
  6995 "/aBlock value:'xIII' value:'instVar'.
  6995 "/aBlock value:'xIII' value:'instVar'.
  6996 	    receiver class isMetaclass ifTrue:[
  6996             receiver class isMetaclass ifTrue:[
  6997 		aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold.
  6997                 aBlock value:(receiver instVarNamed:nm) value:'classInstVar ',nmBold.
  6998 	    ] ifFalse:[
  6998             ] ifFalse:[
  6999 		aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold.
  6999                 aBlock value:(receiver instVarNamed:nm) value:'instVar ',nmBold.
  7000 	    ].
  7000             ].
  7001 	    ^ self
  7001             ^ self
  7002 	].
  7002         ].
  7003 
  7003 
  7004 	receiversNonMetaClass := receiver class theNonMetaclass.
  7004         receiversNonMetaClass := receiver class theNonMetaclass.
  7005 	(receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[
  7005         (receiversNonMetaClass privateClasses contains:[:cls | cls nameWithoutPrefix = nm]) ifTrue:[
  7006 	    aBlock value:'' value:'private class ',nmBold.
  7006             aBlock value:'' value:'private class ',nmBold.
  7007 	    ^ self
  7007             ^ self
  7008 	].
  7008         ].
  7009 	(receiversNonMetaClass classVarNames includes:nm) ifTrue:[
  7009         (receiversNonMetaClass classVarNames includes:nm) ifTrue:[
  7010 	    aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold.
  7010             aBlock value:((currentMethod mclass ? receiversNonMetaClass) theNonMetaclass classVarAt:nm) value:'classVar ',nmBold.
  7011 	    ^ self
  7011             ^ self
  7012 	].
  7012         ].
  7013 	receiversNonMetaClass sharedPoolNames do:[:eachPoolName |
  7013         receiversNonMetaClass sharedPoolNames do:[:eachPoolName |
  7014 	    |pool|
  7014             |pool|
  7015 
  7015 
  7016 	    pool := Smalltalk at:eachPoolName.
  7016             pool := Smalltalk at:eachPoolName.
  7017 	    pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName].
  7017             pool isNil ifTrue:[ pool := receiversNonMetaClass topNameSpace at:eachPoolName].
  7018 	    (pool classVarNames includes:nm) ifTrue:[
  7018             (pool classVarNames includes:nm) ifTrue:[
  7019 		aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '.
  7019                 aBlock value:(pool classVarAt:nm) value:'poolVar ',nm allBold,' in ',eachPoolName allBold,' '.
  7020 		^ self
  7020                 ^ self
  7021 	    ].
  7021             ].
  7022 	].
  7022         ].
  7023 	nameSymbol := nm asSymbolIfInterned.
  7023         nameSymbol := nm asSymbolIfInterned.
  7024 	nameSymbol notNil ifTrue:[
  7024         nameSymbol notNil ifTrue:[
  7025 	    (Smalltalk includesKey:nameSymbol) ifTrue:[
  7025             (Smalltalk includesKey:nameSymbol) ifTrue:[
  7026 		(Smalltalk at:nameSymbol) isClass ifTrue:[
  7026                 (Smalltalk at:nameSymbol) isClass ifTrue:[
  7027 		    aBlock value:'class: ',nmBold value:nil.
  7027                     aBlock value:'class: ',nmBold value:nil.
  7028 		] ifFalse:[
  7028                 ] ifFalse:[
  7029 		    aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold.
  7029                     aBlock value:(Smalltalk at:nameSymbol) value:'global ',nmBold.
  7030 		].
  7030                 ].
  7031 		^ self
  7031                 ^ self
  7032 	    ].
  7032             ].
  7033 	].
  7033         ].
  7034 	aBlock value:'' value:'unknown'.
  7034         aBlock value:'' value:'unknown'.
  7035 	^ self
  7035         ^ self
  7036     ].
  7036     ].
  7037 "/definingNode printCR.
  7037 "/definingNode printCR.
  7038 
  7038 
  7039     definingNode isMethod ifTrue:[
  7039     definingNode isMethod ifTrue:[
  7040 	varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  7040         varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  7041 	varIdx ~~ 0 ifTrue:[
  7041         varIdx ~~ 0 ifTrue:[
  7042 	    Error
  7042             Error
  7043 		handle:[:ex | ]
  7043                 handle:[:ex | ]
  7044 		do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ].
  7044                 do:[ aBlock value:(actualContext methodHome argAt:varIdx) value:'methodArg ',nmBold ].
  7045 	    ^ self
  7045             ^ self
  7046 	].
  7046         ].
  7047 	varIdx := definingNode temporaries findFirst:[:var | var name = nm].
  7047         varIdx := definingNode temporaries findFirst:[:var | var name = nm].
  7048 	varIdx ~~ 0 ifTrue:[
  7048         varIdx ~~ 0 ifTrue:[
  7049 	    actualContext methodHome numVars >= varIdx ifTrue:[
  7049             actualContext methodHome numVars >= varIdx ifTrue:[
  7050 		Error
  7050                 Error
  7051 		    handle:[:ex | ]
  7051                     handle:[:ex | ]
  7052 		    do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  7052                     do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  7053 		^ self
  7053                 ^ self
  7054 	    ]
  7054             ]
  7055 	].
  7055         ].
  7056     ].
  7056     ].
  7057 
  7057 
  7058     definingNode isBlock ifTrue:[
  7058     definingNode isBlock ifTrue:[
  7059 	varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  7059         varIdx := definingNode arguments findFirst:[:arg | arg name = nm].
  7060 	(definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[
  7060         (definingNode arguments contains:[:arg | arg name = nm]) ifTrue:[
  7061 	    varIdx ~~ 0 ifTrue:[
  7061             varIdx ~~ 0 ifTrue:[
  7062 		"/ am I in this block ?
  7062                 "/ am I in this block ?
  7063 		(actualContext lineNumber notNil
  7063                 (actualContext lineNumber notNil
  7064 		and:[ definingNode lastLineNumber notNil
  7064                 and:[ definingNode lastLineNumber notNil
  7065 		and:[ (actualContext lineNumber
  7065                 and:[ (actualContext lineNumber
  7066 			    between:definingNode firstLineNumber
  7066                             between:definingNode firstLineNumber
  7067 			    and:definingNode lastLineNumber)
  7067                             and:definingNode lastLineNumber)
  7068 		and:[ varIdx <= actualContext numArgs ] ]])
  7068                 and:[ varIdx <= actualContext numArgs ] ]])
  7069 		ifTrue:[
  7069                 ifTrue:[
  7070 		    aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold .
  7070                     aBlock value:(actualContext argAt:varIdx) value:'blockArg ',nmBold .
  7071 		    ^ self
  7071                     ^ self
  7072 		].
  7072                 ].
  7073 		aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  7073                 aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  7074 		^ self
  7074                 ^ self
  7075 	    ]
  7075             ]
  7076 	].
  7076         ].
  7077     ].
  7077     ].
  7078 
  7078 
  7079     parentNode := definingNode parent.
  7079     parentNode := definingNode parent.
  7080 
  7080 
  7081     [parentNode notNil] whileTrue:[
  7081     [parentNode notNil] whileTrue:[
  7082 	"/'isMethod ' print. parentNode isMethod printCR.
  7082         "/'isMethod ' print. parentNode isMethod printCR.
  7083 	parentNode isMethod ifTrue:[
  7083         parentNode isMethod ifTrue:[
  7084 	    varIdx := parentNode temporaries findFirst:[:var | var name = nm].
  7084             varIdx := parentNode temporaries findFirst:[:var | var name = nm].
  7085 	    varIdx ~~ 0 ifTrue:[
  7085             varIdx ~~ 0 ifTrue:[
  7086 		actualContext methodHome numVars >= varIdx ifTrue:[
  7086                 actualContext methodHome numVars >= varIdx ifTrue:[
  7087 		    Error
  7087                     Error
  7088 			handle:[:ex | ]
  7088                         handle:[:ex | ]
  7089 			do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  7089                         do:[ aBlock value:(actualContext methodHome varAt:varIdx) value:'methodVar ',nmBold ].
  7090 		    ^ self
  7090                     ^ self
  7091 		]
  7091                 ]
  7092 	    ].
  7092             ].
  7093 	].
  7093         ].
  7094 	"/'isBlock ' print. parentNode isBlock printCR.
  7094         "/'isBlock ' print. parentNode isBlock printCR.
  7095 	parentNode isBlock ifTrue:[
  7095         parentNode isBlock ifTrue:[
  7096 	    "/ we don't have any information on the inlineability
  7096             "/ we don't have any information on the inlineability
  7097 	    "/ of this block here (RBParser does not know what
  7097             "/ of this block here (RBParser does not know what
  7098 	    "/ the compiler does).
  7098             "/ the compiler does).
  7099 	    "/ therefore, it is questionable if we can use the
  7099             "/ therefore, it is questionable if we can use the
  7100 	    "/ context's home context here.
  7100             "/ context's home context here.
  7101 	    "/ am I in this block ?
  7101             "/ am I in this block ?
  7102 	    con := actualContext.
  7102             con := actualContext.
  7103 	    [con notNil
  7103             [con notNil
  7104 	    and:[ parentNode lastLineNumber notNil
  7104             and:[ parentNode lastLineNumber notNil
  7105 	    and:[ con lineNumber notNil
  7105             and:[ con lineNumber notNil
  7106 	    and:[ con lineNumber
  7106             and:[ con lineNumber
  7107 		    between:parentNode firstLineNumber
  7107                     between:parentNode firstLineNumber
  7108 		    and:parentNode lastLineNumber ]]]] whileTrue:[
  7108                     and:parentNode lastLineNumber ]]]] whileTrue:[
  7109 		con := con sender.
  7109                 con := con sender.
  7110 	    ].
  7110             ].
  7111 	    con notNil ifTrue:[
  7111             con notNil ifTrue:[
  7112 		varIdx := parentNode arguments findFirst:[:arg | arg name = nm].
  7112                 varIdx := parentNode arguments findFirst:[:arg | arg name = nm].
  7113 		varIdx ~~ 0 ifTrue:[
  7113                 varIdx ~~ 0 ifTrue:[
  7114 		    Error
  7114                     Error
  7115 			handle:[:ex | ]
  7115                         handle:[:ex | ]
  7116 			do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ].
  7116                         do:[ aBlock value:(con argAt:varIdx) value:'blockArg ',nmBold ].
  7117 		    ^ self
  7117                     ^ self
  7118 		].
  7118                 ].
  7119 		varIdx := parentNode body temporaries findFirst:[:var | var name = nm].
  7119                 varIdx := parentNode body temporaries findFirst:[:var | var name = nm].
  7120 		varIdx ~~ 0 ifTrue:[
  7120                 varIdx ~~ 0 ifTrue:[
  7121 		    Error
  7121                     Error
  7122 			handle:[:ex | ]
  7122                         handle:[:ex | ]
  7123 			do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ].
  7123                         do:[ aBlock value:(con varAt:varIdx) value:'blockVar ',nmBold ].
  7124 		    ^ self
  7124                     ^ self
  7125 		].
  7125                 ].
  7126 	    ].
  7126             ].
  7127 	].
  7127         ].
  7128 	parentNode := parentNode parent.
  7128         parentNode := parentNode parent.
  7129     ].
  7129     ].
  7130     aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  7130     aBlock value:nmBold , ' is not in scope of selected context' value:nil.
  7131 
  7131 
  7132     "Modified: / 18-01-2011 / 17:57:34 / cg"
  7132     "Modified: / 18-01-2011 / 17:57:34 / cg"
  7133 ! !
  7133 ! !
  7176     "Modified: / 25-11-2016 / 13:25:55 / cg"
  7176     "Modified: / 25-11-2016 / 13:25:55 / cg"
  7177 !
  7177 !
  7178 
  7178 
  7179 canCloseAllDebuggers
  7179 canCloseAllDebuggers
  7180     self class allInstancesDo:[:debugger |
  7180     self class allInstancesDo:[:debugger |
  7181 	debugger ~~ self ifTrue:[
  7181         debugger ~~ self ifTrue:[
  7182 	    debugger busy ifTrue:[^ true].
  7182             debugger busy ifTrue:[^ true].
  7183 	]
  7183         ]
  7184     ].
  7184     ].
  7185     ^ false
  7185     ^ false
  7186 
  7186 
  7187     "Created: / 23-03-2012 / 12:40:18 / cg"
  7187     "Created: / 23-03-2012 / 12:40:18 / cg"
  7188 !
  7188 !
  7261 
  7261 
  7262 selectedContextIsWrapped
  7262 selectedContextIsWrapped
  7263     |con mthd|
  7263     |con mthd|
  7264 
  7264 
  7265     (con := self selectedContext) notNil ifTrue:[
  7265     (con := self selectedContext) notNil ifTrue:[
  7266 	mthd := con method.
  7266         mthd := con method.
  7267 	^ mthd notNil and:[mthd isWrapped]
  7267         ^ mthd notNil and:[mthd isWrapped]
  7268     ].
  7268     ].
  7269     ^ false.
  7269     ^ false.
  7270 
  7270 
  7271     "Modified: / 19-07-2012 / 11:36:28 / cg"
  7271     "Modified: / 19-07-2012 / 11:36:28 / cg"
  7272 !
  7272 !
  7280 ! !
  7280 ! !
  7281 
  7281 
  7282 !DebugView methodsFor:'private-breakpoints'!
  7282 !DebugView methodsFor:'private-breakpoints'!
  7283 
  7283 
  7284 addIgnoredHaltForCount:countOrNil
  7284 addIgnoredHaltForCount:countOrNil
  7285 	orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  7285         orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  7286 	orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess
  7286         orThisReceiverClass:forThisReceiverClass orCurrentProcess:forCurrentProcess
  7287 	orIfCalledFromMethod:ifCalledForMethodOrNil
  7287         orIfCalledFromMethod:ifCalledForMethodOrNil
  7288 	forAll:aBoolean
  7288         forAll:aBoolean
  7289 
  7289 
  7290     |haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil|
  7290     |haltingContext haltingMethod lineNrOfHalt receiverClassOrNil processOrNil|
  7291 
  7291 
  7292     aBoolean ifTrue:[
  7292     aBoolean ifTrue:[
  7293 	haltingMethod := #all
  7293         haltingMethod := #all
  7294     ] ifFalse:[
  7294     ] ifFalse:[
  7295 	haltingContext := self findHaltingContext.
  7295         haltingContext := self findHaltingContext.
  7296 	haltingContext isNil ifTrue:[
  7296         haltingContext isNil ifTrue:[
  7297 	    Transcript showCR:'no halting context found'.
  7297             Transcript showCR:'no halting context found'.
  7298 	    ^ self
  7298             ^ self
  7299 	].
  7299         ].
  7300 
  7300 
  7301 	haltingMethod := haltingContext method.
  7301         haltingMethod := haltingContext method.
  7302 	lineNrOfHalt := haltingContext lineNumber.
  7302         lineNrOfHalt := haltingContext lineNumber.
  7303 	(lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[
  7303         (lineNrOfHalt isNil or:[lineNrOfHalt <= 0]) ifTrue:[
  7304 	    Transcript showCR:'no halt lineNr found'.
  7304             Transcript showCR:'no halt lineNr found'.
  7305 	    ^ self
  7305             ^ self
  7306 	].
  7306         ].
  7307 	forThisReceiverClass ifTrue:[
  7307         forThisReceiverClass ifTrue:[
  7308 	    receiverClassOrNil := haltingContext receiver class
  7308             receiverClassOrNil := haltingContext receiver class
  7309 	].
  7309         ].
  7310 	forCurrentProcess ifTrue:[
  7310         forCurrentProcess ifTrue:[
  7311 	    processOrNil := Processor activeProcess
  7311             processOrNil := Processor activeProcess
  7312 	].
  7312         ].
  7313     ].
  7313     ].
  7314 
  7314 
  7315     self class
  7315     self class
  7316 	ignoreHaltIn:haltingMethod at:lineNrOfHalt
  7316         ignoreHaltIn:haltingMethod at:lineNrOfHalt
  7317 	forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  7317         forCount:countOrNil orTimeDuration:dTOrNil orUntilShiftKey:untilShiftKey
  7318 	orReceiverClass:receiverClassOrNil orProcess:processOrNil
  7318         orReceiverClass:receiverClassOrNil orProcess:processOrNil
  7319 	orIfCalledFromMethod:ifCalledForMethodOrNil
  7319         orIfCalledFromMethod:ifCalledForMethodOrNil
  7320 
  7320 
  7321     "Created: / 27-01-2012 / 11:31:12 / cg"
  7321     "Created: / 27-01-2012 / 11:31:12 / cg"
  7322 !
  7322 !
  7323 
  7323 
  7324 canAddBreakpoint
  7324 canAddBreakpoint
  7339     |haltSelectors|
  7339     |haltSelectors|
  7340 
  7340 
  7341     haltSelectors := self haltSelectors.
  7341     haltSelectors := self haltSelectors.
  7342 
  7342 
  7343     contextArray keysAndValuesDo:[:idx :con |
  7343     contextArray keysAndValuesDo:[:idx :con |
  7344 	|sel con2 sel2 method|
  7344         |sel con2 sel2 method|
  7345 
  7345 
  7346 	sel := con selector.
  7346         sel := con selector.
  7347 	(haltSelectors includes:sel) ifTrue:[
  7347         (haltSelectors includes:sel) ifTrue:[
  7348 	    (method := con method) notNil ifTrue:[
  7348             (method := con method) notNil ifTrue:[
  7349 		method mclass == Object ifTrue:[
  7349                 method mclass == Object ifTrue:[
  7350 		    con2 := contextArray at:idx+1.
  7350                     con2 := contextArray at:idx+1.
  7351 		    sel2 := con2 selector.
  7351                     sel2 := con2 selector.
  7352 		    (haltSelectors includes:sel2) ifTrue:[
  7352                     (haltSelectors includes:sel2) ifTrue:[
  7353 			con2 method mclass == Object ifTrue:[
  7353                         con2 method mclass == Object ifTrue:[
  7354 			    ^ contextArray at:idx+2.
  7354                             ^ contextArray at:idx+2.
  7355 			]
  7355                         ]
  7356 		    ].
  7356                     ].
  7357 		    ^ contextArray at:idx+1
  7357                     ^ contextArray at:idx+1
  7358 		].
  7358                 ].
  7359 		method mclass == Breakpoint ifTrue:[
  7359                 method mclass == Breakpoint ifTrue:[
  7360 (contextArray at:idx+1) infoPrintCR.
  7360 (contextArray at:idx+1) infoPrintCR.
  7361 		    ^ contextArray at:idx+1
  7361                     ^ contextArray at:idx+1
  7362 		].
  7362                 ].
  7363 	    ].
  7363             ].
  7364 	].
  7364         ].
  7365 	con method isWrapped ifTrue:[
  7365         con method isWrapped ifTrue:[
  7366 	    ^ con
  7366             ^ con
  7367 	].
  7367         ].
  7368     ].
  7368     ].
  7369     ^ nil
  7369     ^ nil
  7370 
  7370 
  7371     "Modified: / 27-01-2012 / 11:06:02 / cg"
  7371     "Modified: / 27-01-2012 / 11:06:02 / cg"
  7372 !
  7372 !
  7416 
  7416 
  7417 isCached
  7417 isCached
  7418     "tell whether we are a cached debugger"
  7418     "tell whether we are a cached debugger"
  7419 
  7419 
  7420     CachedExclusive == self ifTrue:[
  7420     CachedExclusive == self ifTrue:[
  7421 	^ true.
  7421         ^ true.
  7422     ].
  7422     ].
  7423     CachedDebugger == self ifTrue:[
  7423     CachedDebugger == self ifTrue:[
  7424 	^ true.
  7424         ^ true.
  7425     ].
  7425     ].
  7426 
  7426 
  7427     ^ false.
  7427     ^ false.
  7428 
  7428 
  7429     "Created: / 10-07-1997 / 15:22:43 / stefan"
  7429     "Created: / 10-07-1997 / 15:22:43 / stefan"
  7434     "do not remember myself any longer for next debug session"
  7434     "do not remember myself any longer for next debug session"
  7435 
  7435 
  7436     cachable := false.
  7436     cachable := false.
  7437 
  7437 
  7438     CachedExclusive == self ifTrue:[
  7438     CachedExclusive == self ifTrue:[
  7439 	CachedExclusive := nil.
  7439         CachedExclusive := nil.
  7440     ].
  7440     ].
  7441     CachedDebugger == self ifTrue:[
  7441     CachedDebugger == self ifTrue:[
  7442 	CachedDebugger := nil.
  7442         CachedDebugger := nil.
  7443     ].
  7443     ].
  7444     OpenDebuggers notNil ifTrue:[
  7444     OpenDebuggers notNil ifTrue:[
  7445 	OpenDebuggers remove:self ifAbsent:[].
  7445         OpenDebuggers remove:self ifAbsent:[].
  7446     ].
  7446     ].
  7447 
  7447 
  7448     "Modified: 31.7.1997 / 21:20:11 / cg"
  7448     "Modified: 31.7.1997 / 21:20:11 / cg"
  7449 ! !
  7449 ! !
  7450 
  7450 
  7486 is:aHomeContext inCallingChainOf:aContext
  7486 is:aHomeContext inCallingChainOf:aContext
  7487     |con|
  7487     |con|
  7488 
  7488 
  7489     con := aContext.
  7489     con := aContext.
  7490     [con notNil and:[con ~~ aHomeContext]] whileTrue:[
  7490     [con notNil and:[con ~~ aHomeContext]] whileTrue:[
  7491 	con := con sender
  7491         con := con sender
  7492     ].
  7492     ].
  7493     ^ con notNil
  7493     ^ con notNil
  7494 
  7494 
  7495     "Created: / 10-06-2012 / 18:46:29 / cg"
  7495     "Created: / 10-06-2012 / 18:46:29 / cg"
  7496 !
  7496 !
  7501     |c cReceiver|
  7501     |c cReceiver|
  7502 
  7502 
  7503     "/ look for a breakpoint-wrapper's context
  7503     "/ look for a breakpoint-wrapper's context
  7504     c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil.
  7504     c := thisContext findNextContextWithSelector:#'raiseRequestWith:errorString:in:' or:nil or:nil.
  7505     c isNil ifTrue:[
  7505     c isNil ifTrue:[
  7506 	^ true.
  7506         ^ true.
  7507     ].
  7507     ].
  7508     cReceiver := c receiver.
  7508     cReceiver := c receiver.
  7509     ^ cReceiver == BreakPointInterrupt
  7509     ^ cReceiver == BreakPointInterrupt
  7510 
  7510 
  7511     "Modified: / 01-08-2013 / 23:34:01 / cg"
  7511     "Modified: / 01-08-2013 / 23:34:01 / cg"
  7521     IgnoredHalts isNil ifTrue:[^ false].
  7521     IgnoredHalts isNil ifTrue:[^ false].
  7522 
  7522 
  7523     "/ look for a method breakpoint-wrapper's context
  7523     "/ look for a method breakpoint-wrapper's context
  7524     c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil.
  7524     c := thisContext findNextContextWithSelector:#doRaise or:nil or:nil.
  7525     c notNil ifTrue:[
  7525     c notNil ifTrue:[
  7526 	((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[
  7526         ((cReceiver := c receiver) isKindOf:NoHandlerError) ifTrue:[
  7527 	    c := c sender findNextContextWithSelector:#doRaise or:nil or:nil.
  7527             c := c sender findNextContextWithSelector:#doRaise or:nil or:nil.
  7528 	    cReceiver := c receiver.
  7528             cReceiver := c receiver.
  7529 	].
  7529         ].
  7530 	(cReceiver isKindOf:BreakPointInterrupt) ifFalse:[
  7530         (cReceiver isKindOf:BreakPointInterrupt) ifFalse:[
  7531 	    c := nil
  7531             c := nil
  7532 	] ifTrue:[
  7532         ] ifTrue:[
  7533 	    [
  7533             [
  7534 		sender := c sender.
  7534                 sender := c sender.
  7535 		((sReceiver := sender receiver) isKindOf:BreakPointInterrupt)
  7535                 ((sReceiver := sender receiver) isKindOf:BreakPointInterrupt)
  7536 		or:[ sReceiver == BreakPointInterrupt ]
  7536                 or:[ sReceiver == BreakPointInterrupt ]
  7537 	    ] whileTrue:[
  7537             ] whileTrue:[
  7538 		c := sender
  7538                 c := sender
  7539 	    ].
  7539             ].
  7540 	    [ (sender := c sender) isBlockContext ] whileTrue:[
  7540             [ (sender := c sender) isBlockContext ] whileTrue:[
  7541 		c := sender
  7541                 c := sender
  7542 	    ].
  7542             ].
  7543 	    sender := nil. "/ avoid keeping a reference to this context
  7543             sender := nil. "/ avoid keeping a reference to this context
  7544 	].
  7544         ].
  7545     ].
  7545     ].
  7546     "/ Transcript showCR:c.
  7546     "/ Transcript showCR:c.
  7547     c isNil ifTrue:[
  7547     c isNil ifTrue:[
  7548 	"/ look for halts or explicit breakpoints
  7548         "/ look for halts or explicit breakpoints
  7549 	c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil.
  7549         c := thisContext findNextContextWithSelector:#halt or:#halt: or:nil.
  7550 	c isNil ifTrue:[
  7550         c isNil ifTrue:[
  7551 	    c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil.
  7551             c := thisContext findNextContextWithSelector:#breakPoint: or:#breakPoint:info: or:nil.
  7552 	    c isNil ifTrue:[
  7552             c isNil ifTrue:[
  7553 	       ^ false
  7553                ^ false
  7554 	    ].
  7554             ].
  7555 	    breakpointParameter := c argAt:1.
  7555             breakpointParameter := c argAt:1.
  7556 	    (self class
  7556             (self class
  7557 		    isBreakpointToBeIgnoredForParameter:breakpointParameter
  7557                     isBreakpointToBeIgnoredForParameter:breakpointParameter
  7558 		    context:(c sender)
  7558                     context:(c sender)
  7559 		    modifyEntryCount:true
  7559                     modifyEntryCount:true
  7560 	    ) ifTrue:[
  7560             ) ifTrue:[
  7561 		^ true.
  7561                 ^ true.
  7562 	    ].
  7562             ].
  7563 	].
  7563         ].
  7564     ].
  7564     ].
  7565 
  7565 
  7566     c := c sender.
  7566     c := c sender.
  7567     "/ a code-breakpoint ?
  7567     "/ a code-breakpoint ?
  7568     (c receiver isKindOf:Breakpoint) ifTrue:[
  7568     (c receiver isKindOf:Breakpoint) ifTrue:[
  7569 	c := c sender.
  7569         c := c sender.
  7570     ].
  7570     ].
  7571     haltingMethod := c method.
  7571     haltingMethod := c method.
  7572 
  7572 
  7573     haltingMethod isWrapped ifTrue:[
  7573     haltingMethod isWrapped ifTrue:[
  7574 	lineNrInHaltingMethod := 1.
  7574         lineNrInHaltingMethod := 1.
  7575     ] ifFalse:[
  7575     ] ifFalse:[
  7576 	lineNrInHaltingMethod := c lineNumber.
  7576         lineNrInHaltingMethod := c lineNumber.
  7577 	"/ Transcript showCR:c.
  7577         "/ Transcript showCR:c.
  7578     ].
  7578     ].
  7579 
  7579 
  7580     ^ self class
  7580     ^ self class
  7581 	isHaltToBeIgnoredIn:haltingMethod
  7581         isHaltToBeIgnoredIn:haltingMethod
  7582 	atLineNr:lineNrInHaltingMethod
  7582         atLineNr:lineNrInHaltingMethod
  7583 	context:c
  7583         context:c
  7584 	modifyEntryCount:true.
  7584         modifyEntryCount:true.
  7585 
  7585 
  7586     "Created: / 22-10-2010 / 12:09:53 / cg"
  7586     "Created: / 22-10-2010 / 12:09:53 / cg"
  7587     "Modified: / 06-03-2012 / 12:54:09 / cg"
  7587     "Modified: / 06-03-2012 / 12:54:09 / cg"
  7588 !
  7588 !
  7589 
  7589 
  7931 
  7931 
  7932     |con|
  7932     |con|
  7933 
  7933 
  7934     con := aContext.
  7934     con := aContext.
  7935     self verboseBacktraceHolder value ifFalse:[
  7935     self verboseBacktraceHolder value ifFalse:[
  7936 	(con notNil and:[con selector == #threadSwitch:]) ifTrue:[
  7936         (con notNil and:[con selector == #threadSwitch:]) ifTrue:[
  7937 	    con := con sender.
  7937             con := con sender.
  7938 	    (con notNil and:[con selector == #timerInterrupt]) ifTrue:[
  7938             (con notNil and:[con selector == #timerInterrupt]) ifTrue:[
  7939 		con := con sender.
  7939                 con := con sender.
  7940 	    ].
  7940             ].
  7941 	].
  7941         ].
  7942     ].
  7942     ].
  7943     ^ self setContext:con releaseInspectors:true
  7943     ^ self setContext:con releaseInspectors:true
  7944 
  7944 
  7945     "Created: / 20.10.1996 / 18:10:21 / cg"
  7945     "Created: / 20.10.1996 / 18:10:21 / cg"
  7946     "Modified: / 17.1.1998 / 12:43:19 / cg"
  7946     "Modified: / 17.1.1998 / 12:43:19 / cg"
  8207 
  8207 
  8208 !DebugView methodsFor:'private-control loop'!
  8208 !DebugView methodsFor:'private-control loop'!
  8209 
  8209 
  8210 controlLoop
  8210 controlLoop
  8211     "this is a kludge:
  8211     "this is a kludge:
  8212 	start a dispatchloop which exits when
  8212         start a dispatchloop which exits when
  8213 	either continue, return or step is pressed
  8213         either continue, return or step is pressed
  8214     "
  8214     "
  8215 
  8215 
  8216     haveControl := true.
  8216     haveControl := true.
  8217     [
  8217     [
  8218 	[haveControl] whileTrue:[
  8218         [haveControl] whileTrue:[
  8219 AbortOperationRequest handle:[:ex |
  8219 AbortOperationRequest handle:[:ex |
  8220 ] do:[
  8220 ] do:[
  8221 	    self controlLoopCatchingErrors
  8221             self controlLoopCatchingErrors
  8222 ]
  8222 ]
  8223 	].
  8223         ].
  8224     ] ensure:[
  8224     ] ensure:[
  8225 	catchBlock := nil.
  8225         catchBlock := nil.
  8226 	haveControl := false
  8226         haveControl := false
  8227     ].
  8227     ].
  8228 
  8228 
  8229     "Modified: 9.7.1996 / 18:29:09 / cg"
  8229     "Modified: 9.7.1996 / 18:29:09 / cg"
  8230 !
  8230 !
  8231 
  8231 
  8388             ].
  8388             ].
  8389             Dialog aboutToOpenBoxNotificationSignal
  8389             Dialog aboutToOpenBoxNotificationSignal
  8390                 handle:[:ex | ex proceed ]
  8390                 handle:[:ex | ex proceed ]
  8391                 do:[
  8391                 do:[
  8392                     answer := Dialog
  8392                     answer := Dialog
  8393                         choose:(ex creator class name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs)
  8393                         choose:(ex creator class theNonMetaclass name,' in debugger:\' withCRs , eMsg , '\\debug again ?' withCRs)
  8394                         labels:#( 'Proceed' 'Cancel' 'Debug' )
  8394                         labels:#( 'Proceed' 'Cancel' 'Debug' )
  8395                         values:#( #proceed #cancel #debug )
  8395                         values:#( #proceed #cancel #debug )
  8396                         default:#cancel.
  8396                         default:#cancel.
  8397                 ].
  8397                 ].
  8398             answer == #debug ifTrue:[
  8398             answer == #debug ifTrue:[
  8399                 'DebugView [info]: caught exception - debugging' infoPrintCR.
  8399                 'DebugView [info]: caught exception - debugging' infoPrintCR.
  8400                 Debugger
  8400                 Debugger
  8401                     enterUnconditional:(ex suspendedContext)
  8401                     enterUnconditional:(ex suspendedContext)
  8402                     withMessage:(ex creator class name,' in debugger: ' , eMsg)
  8402                     withMessage:(ex creator class theNonMetaclass name,' in debugger: ' , eMsg)
  8403                     mayProceed:true.
  8403                     mayProceed:true.
  8404                 ex proceed.
  8404                 ex proceed.
  8405             ].
  8405             ].
  8406             answer == #proceed ifTrue:[
  8406             answer == #proceed ifTrue:[
  8407                 'DebugView [info]: ignored exception - proceeding' infoPrintCR.
  8407                 'DebugView [info]: ignored exception - proceeding' infoPrintCR.
  8548 
  8548 
  8549     self checkIfCodeIsReallyModified ifFalse:[^ true].
  8549     self checkIfCodeIsReallyModified ifFalse:[^ true].
  8550 
  8550 
  8551     (newSelection notNil
  8551     (newSelection notNil
  8552     and:[newSelection = contextView selection]) ifTrue:[
  8552     and:[newSelection = contextView selection]) ifTrue:[
  8553 	^ true
  8553         ^ true
  8554     ].
  8554     ].
  8555 
  8555 
  8556     answer := Dialog
  8556     answer := Dialog
  8557 		confirmWithCancel:('Code modified - change selection anyway ?')
  8557                 confirmWithCancel:('Code modified - change selection anyway ?')
  8558 		labels:#('No' 'No, Show Diffs' 'Yes').
  8558                 labels:#('No' 'No, Show Diffs' 'Yes').
  8559     answer isNil ifTrue:[^ false].
  8559     answer isNil ifTrue:[^ false].
  8560     answer == false ifTrue:[
  8560     answer == false ifTrue:[
  8561 	v := DiffCodeView
  8561         v := DiffCodeView
  8562 		openOn:codeView contents
  8562                 openOn:codeView contents
  8563 		label:(resources string:'Changed code (to be accepted ?)')
  8563                 label:(resources string:'Changed code (to be accepted ?)')
  8564 		and:currentMethod source
  8564                 and:currentMethod source
  8565 		label:(resources string:'Method''s actual (maybe original) code').
  8565                 label:(resources string:'Method''s actual (maybe original) code').
  8566 	v label:(resources string:'Comparing method''s code').
  8566         v label:(resources string:'Comparing method''s code').
  8567 	v waitUntilVisible.
  8567         v waitUntilVisible.
  8568 	^ false
  8568         ^ false
  8569     ].
  8569     ].
  8570 
  8570 
  8571     codeView modified:false.
  8571     codeView modified:false.
  8572     ^ true
  8572     ^ true
  8573 !
  8573 !
  8574 
  8574 
  8575 codeAccept:someCode
  8575 codeAccept:someCode
  8576     "user wants some code to be recompiled"
  8576     "user wants some code to be recompiled"
  8577 
  8577 
  8578     ParseError handle:[:ex |
  8578     ParseError handle:[:ex |
  8579 	ex lineNumber notNil ifTrue:[
  8579         ex lineNumber notNil ifTrue:[
  8580 	    codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition.
  8580             codeView selectLine:ex lineNumber. "/ selectFromCharacterPosition:ex startPosition to:ex endPosition.
  8581 	].
  8581         ].
  8582 	Dialog information:ex description.
  8582         Dialog information:ex description.
  8583 "/            ParseError new
  8583 "/            ParseError new
  8584 "/                errorMessage:aMessage startPosition:position endPosition:endPos;
  8584 "/                errorMessage:aMessage startPosition:position endPosition:endPos;
  8585 "/                parameter:self;
  8585 "/                parameter:self;
  8586 "/                lineNumber:tokenLineNr; "lineNr"
  8586 "/                lineNumber:tokenLineNr; "lineNr"
  8587 "/                raiseRequest.
  8587 "/                raiseRequest.
  8588     ] do:[
  8588     ] do:[
  8589 	^ self codeAccept:someCode unwind:false category:nil onCancel:nil
  8589         ^ self codeAccept:someCode unwind:false category:nil onCancel:nil
  8590     ].
  8590     ].
  8591 
  8591 
  8592     "Modified: / 28-11-2006 / 19:49:04 / cg"
  8592     "Modified: / 28-11-2006 / 19:49:04 / cg"
  8593 !
  8593 !
  8594 
  8594 
  8809 
  8809 
  8810     currentMethod isNil ifTrue:[ ^ self ].
  8810     currentMethod isNil ifTrue:[ ^ self ].
  8811 
  8811 
  8812     cls := currentMethod mclass.
  8812     cls := currentMethod mclass.
  8813     cls notNil ifTrue:[
  8813     cls notNil ifTrue:[
  8814 	language := cls programmingLanguage.
  8814         language := cls programmingLanguage.
  8815     ].
  8815     ].
  8816 
  8816 
  8817     UserInformation handle:[:ex |
  8817     UserInformation handle:[:ex |
  8818 	ex proceed.
  8818         ex proceed.
  8819     ] do:[
  8819     ] do:[
  8820 	DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:selectedContext codeView:codeView.
  8820         DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:selectedContext codeView:codeView.
  8821     ].
  8821     ].
  8822 
  8822 
  8823     "Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  8823     "Modified: / 18-09-2013 / 14:20:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  8824 !
  8824 !
  8825 
  8825 
  8836 doShowSelection:lineNr
  8836 doShowSelection:lineNr
  8837     "user clicked on a header line - show selected code in textView.
  8837     "user clicked on a header line - show selected code in textView.
  8838      Also sent to autoselect an interesting context on entry."
  8838      Also sent to autoselect an interesting context on entry."
  8839 
  8839 
  8840     HaltInterrupt handle:[:ex |
  8840     HaltInterrupt handle:[:ex |
  8841 	ignoreBreakpoints ifFalse:[ex reject].
  8841         ignoreBreakpoints ifFalse:[ex reject].
  8842 	('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR.
  8842         ('DebugView [info]: halt/breakpoint in debugger at %1 ignored [doShowSelection.]' bindWith:ex suspendedContext) infoPrintCR.
  8843 	ex proceed
  8843         ex proceed
  8844     ] do:[
  8844     ] do:[
  8845 	self updateForContext:lineNr
  8845         self updateForContext:lineNr
  8846     ].
  8846     ].
  8847     self updateMenuItems
  8847     self updateMenuItems
  8848 
  8848 
  8849     "Modified: / 17.11.2001 / 22:12:16 / cg"
  8849     "Modified: / 17.11.2001 / 22:12:16 / cg"
  8850 !
  8850 !
  8851 
  8851 
  8852 hideStackInspector
  8852 hideStackInspector
  8853     stackInspector notNil ifTrue:[
  8853     stackInspector notNil ifTrue:[
  8854 	stackInspector destroy.
  8854         stackInspector destroy.
  8855 	stackInspector := nil.
  8855         stackInspector := nil.
  8856 	receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0.
  8856         receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0.
  8857 	contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  8857         contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
  8858     ]
  8858     ]
  8859 !
  8859 !
  8860 
  8860 
  8861 methodCodeToggleChanged
  8861 methodCodeToggleChanged
  8862     |sel|
  8862     |sel|
  8863 
  8863 
  8864     sel := contextView selection.
  8864     sel := contextView selection.
  8865     sel notNil ifTrue:[
  8865     sel notNil ifTrue:[
  8866 	self showSelection:sel
  8866         self showSelection:sel
  8867     ]
  8867     ]
  8868 
  8868 
  8869     "Created: / 18-06-2010 / 12:29:21 / cg"
  8869     "Created: / 18-06-2010 / 12:29:21 / cg"
  8870 !
  8870 !
  8871 
  8871 
  8877 
  8877 
  8878     |evView focusView key rawKey inCodeView|
  8878     |evView focusView key rawKey inCodeView|
  8879 
  8879 
  8880     evView := anEvent view.
  8880     evView := anEvent view.
  8881     evView notNil ifTrue:[
  8881     evView notNil ifTrue:[
  8882 	focusView := evView windowGroup focusView.
  8882         focusView := evView windowGroup focusView.
  8883 	focusView isNil ifTrue:[
  8883         focusView isNil ifTrue:[
  8884 	    focusView := evView.
  8884             focusView := evView.
  8885 	].
  8885         ].
  8886 
  8886 
  8887 	anEvent isKeyPressEvent ifTrue:[
  8887         anEvent isKeyPressEvent ifTrue:[
  8888 	    key := anEvent key.
  8888             key := anEvent key.
  8889 	    rawKey := anEvent rawKey.
  8889             rawKey := anEvent rawKey.
  8890 
  8890 
  8891 	    inCodeView := (focusView == codeView
  8891             inCodeView := (focusView == codeView
  8892 			  or:[focusView isComponentOf:codeView]).
  8892                           or:[focusView isComponentOf:codeView]).
  8893 	    inCodeView ifTrue:[
  8893             inCodeView ifTrue:[
  8894 		key == #CodeCompletion ifTrue:[
  8894                 key == #CodeCompletion ifTrue:[
  8895 		    "/ complete the word before/under the cursor.
  8895                     "/ complete the word before/under the cursor.
  8896 		    self sensor
  8896                     self sensor
  8897 			pushUserEvent:#codeCompletion
  8897                         pushUserEvent:#codeCompletion
  8898 			for:self
  8898                         for:self
  8899 			withArguments:#().
  8899                         withArguments:#().
  8900 		    ^ true
  8900                     ^ true
  8901 		].
  8901                 ].
  8902 	    ].
  8902             ].
  8903 	].
  8903         ].
  8904 
  8904 
  8905 false ifTrue:[
  8905 false ifTrue:[
  8906 	anEvent isButtonReleaseEvent ifTrue:[
  8906         anEvent isButtonReleaseEvent ifTrue:[
  8907 	    anEvent view == codeView ifTrue:[
  8907             anEvent view == codeView ifTrue:[
  8908 		(RBParser notNil and:[RBParser isLoaded])
  8908                 (RBParser notNil and:[RBParser isLoaded])
  8909 		ifTrue:[
  8909                 ifTrue:[
  8910 		    self sensor
  8910                     self sensor
  8911 			pushEvent:anEvent.  "/ must be first in queue
  8911                         pushEvent:anEvent.  "/ must be first in queue
  8912 
  8912 
  8913 		    self sensor
  8913                     self sensor
  8914 		      pushUserEvent:#explainSelection
  8914                       pushUserEvent:#explainSelection
  8915 		      for:self
  8915                       for:self
  8916 		      withArguments:nil.
  8916                       withArguments:nil.
  8917 		    ^ true  "/ eaten
  8917                     ^ true  "/ eaten
  8918 		]
  8918                 ]
  8919 	    ]
  8919             ]
  8920 	].
  8920         ].
  8921 ].
  8921 ].
  8922 
  8922 
  8923     ].
  8923     ].
  8924     ^ false
  8924     ^ false
  8925 !
  8925 !
  8931 showSelection:lineNr
  8931 showSelection:lineNr
  8932     "user clicked on a header line - show selected code in textView.
  8932     "user clicked on a header line - show selected code in textView.
  8933      Also sent to autoselect an interesting context on entry."
  8933      Also sent to autoselect an interesting context on entry."
  8934 
  8934 
  8935     UserNotification
  8935     UserNotification
  8936 	handle:[:ex |
  8936         handle:[:ex |
  8937 	    "/ ex suspendedContext fullPrintAll.
  8937             "/ ex suspendedContext fullPrintAll.
  8938 	    Transcript showCR:ex description.
  8938             Transcript showCR:ex description.
  8939 	    "/ Transcript showCR:ex parameter.
  8939             "/ Transcript showCR:ex parameter.
  8940 	    ex proceed
  8940             ex proceed
  8941 	]
  8941         ]
  8942 	do:[
  8942         do:[
  8943 	    Error
  8943             Error
  8944 		handle:[:ex |
  8944                 handle:[:ex |
  8945 		    |s con|
  8945                     |s con|
  8946 
  8946 
  8947 		    ex creator isControlInterrupt ifTrue:[
  8947                     ex creator isControlInterrupt ifTrue:[
  8948 			'DebugView [info]: halt/break ignored - while showing selection in debugger'
  8948                         'DebugView [info]: halt/break ignored - while showing selection in debugger'
  8949 			    infoPrintCR.
  8949                             infoPrintCR.
  8950 			ex proceed
  8950                         ex proceed
  8951 		    ].
  8951                     ].
  8952 		    ('DebugView [info]: error at %1 when showing selection in debugger ignored'
  8952                     ('DebugView [info]: error at %1 when showing selection in debugger ignored'
  8953 			bindWith:ex suspendedContext) infoPrintCR.
  8953                         bindWith:ex suspendedContext) infoPrintCR.
  8954 		    s := '' writeStream.
  8954                     s := '' writeStream.
  8955 		    s nextPutLine:'**** error in debugger, while extracting source'.
  8955                     s nextPutLine:'**** error in debugger, while extracting source'.
  8956 		    s nextPutLine:'****'.
  8956                     s nextPutLine:'****'.
  8957 		    s nextPutLine:'**** ',(ex description).
  8957                     s nextPutLine:'**** ',(ex description).
  8958 		    s nextPutLine:'****'.
  8958                     s nextPutLine:'****'.
  8959 		    con := ex suspendedContext.
  8959                     con := ex suspendedContext.
  8960 		    s nextPutLine:'**** ',(con printString).
  8960                     s nextPutLine:'**** ',(con printString).
  8961 		    con := con sender.
  8961                     con := con sender.
  8962 		    HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ].
  8962                     HaltInterrupt ignoreIn:[ con fullPrintAllOn:s. ].
  8963 
  8963 
  8964 "/                            [con notNil] whileTrue:[
  8964 "/                            [con notNil] whileTrue:[
  8965 "/                                Error catch:[:ex |
  8965 "/                                Error catch:[:ex |
  8966 "/                                    s nextPutAll: '**** '; nextPutLine:(con printString).
  8966 "/                                    s nextPutAll: '**** '; nextPutLine:(con printString).
  8967 "/                                ].
  8967 "/                                ].
  8971 "/                                ] ifFalse:[
  8971 "/                                ] ifFalse:[
  8972 "/                                    con := con sender.
  8972 "/                                    con := con sender.
  8973 "/                                ]
  8973 "/                                ]
  8974 "/                            ].
  8974 "/                            ].
  8975 
  8975 
  8976 		    codeView contents:(s contents).
  8976                     codeView contents:(s contents).
  8977 		    ex return.
  8977                     ex return.
  8978 		]
  8978                 ]
  8979 		do:[ self doShowSelection:lineNr ]
  8979                 do:[ self doShowSelection:lineNr ]
  8980 	]
  8980         ]
  8981 
  8981 
  8982     "Modified: / 19-07-2012 / 10:56:58 / cg"
  8982     "Modified: / 19-07-2012 / 10:56:58 / cg"
  8983 !
  8983 !
  8984 
  8984 
  8985 showStackInspectorFor:con
  8985 showStackInspectorFor:con
  8986     stackInspector isNil ifTrue:[
  8986     stackInspector isNil ifTrue:[
  8987 	receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0.
  8987         receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0.
  8988 	contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0).
  8988         contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0).
  8989 	stackInspector := InspectorView
  8989         stackInspector := InspectorView
  8990 		    origin:(0.6 @ 0.0)
  8990                     origin:(0.6 @ 0.0)
  8991 		    corner:(1.0 @ 1.0)
  8991                     corner:(1.0 @ 1.0)
  8992 		    in:contextInspector superView.
  8992                     in:contextInspector superView.
  8993 	stackInspector realize.
  8993         stackInspector realize.
  8994 	stackInspector fieldListLabel:'Stack'.
  8994         stackInspector fieldListLabel:'Stack'.
  8995 	stackInspector hideReceiver:true
  8995         stackInspector hideReceiver:true
  8996     ].
  8996     ].
  8997     stackInspector inspect:(con stackFrame asArray).
  8997     stackInspector inspect:(con stackFrame asArray).
  8998     stackInspector showLast
  8998     stackInspector showLast
  8999 !
  8999 !
  9000 
  9000 
  9500     ignoreEndTime := something.
  9500     ignoreEndTime := something.
  9501 !
  9501 !
  9502 
  9502 
  9503 ignoreForProcess:aProcess
  9503 ignoreForProcess:aProcess
  9504     ignoredProcesses isNil ifTrue:[
  9504     ignoredProcesses isNil ifTrue:[
  9505 	ignoredProcesses := WeakIdentitySet new.
  9505         ignoredProcesses := WeakIdentitySet new.
  9506     ].
  9506     ].
  9507     ignoredProcesses add:aProcess
  9507     ignoredProcesses add:aProcess
  9508 !
  9508 !
  9509 
  9509 
  9510 ignoreForReceiverClass:aClass
  9510 ignoreForReceiverClass:aClass
  9511     ignoredReceiverClasses isNil ifTrue:[
  9511     ignoredReceiverClasses isNil ifTrue:[
  9512 	ignoredReceiverClasses := WeakIdentitySet new.
  9512         ignoredReceiverClasses := WeakIdentitySet new.
  9513     ].
  9513     ].
  9514     ignoredReceiverClasses add:aClass
  9514     ignoredReceiverClasses add:aClass
  9515 !
  9515 !
  9516 
  9516 
  9517 ignoreIfCalledFromMethod:aMethod
  9517 ignoreIfCalledFromMethod:aMethod
  9518     ignoredSendingClassAndSelectors isNil ifTrue:[
  9518     ignoredSendingClassAndSelectors isNil ifTrue:[
  9519 	 ignoredSendingClassAndSelectors := OrderedCollection new.
  9519          ignoredSendingClassAndSelectors := OrderedCollection new.
  9520     ].
  9520     ].
  9521 
  9521 
  9522     "/ remember the method's name, not the method.
  9522     "/ remember the method's name, not the method.
  9523     "/ so it can be recompiled and we still detect ignores
  9523     "/ so it can be recompiled and we still detect ignores
  9524     ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector }
  9524     ignoredSendingClassAndSelectors add:{aMethod mclass name . aMethod selector }
  9532 
  9532 
  9533 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'!
  9533 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'misc'!
  9534 
  9534 
  9535 decrementIgnoreCount
  9535 decrementIgnoreCount
  9536     ignoreCount notNil ifTrue:[
  9536     ignoreCount notNil ifTrue:[
  9537 	ignoreCount > 0 ifTrue:[
  9537         ignoreCount > 0 ifTrue:[
  9538 	    ignoreCount := ignoreCount - 1
  9538             ignoreCount := ignoreCount - 1
  9539 	]
  9539         ]
  9540     ]
  9540     ]
  9541 ! !
  9541 ! !
  9542 
  9542 
  9543 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'!
  9543 !DebugView::IgnoredHaltOrBreakpoint methodsFor:'printing'!
  9544 
  9544 
  9589 haltIgnoredInfoString
  9589 haltIgnoredInfoString
  9590     "some string describing why and how this halt is ignored;
  9590     "some string describing why and how this halt is ignored;
  9591      nil if not ignored"
  9591      nil if not ignored"
  9592 
  9592 
  9593     ^ String streamContents:[:s |
  9593     ^ String streamContents:[:s |
  9594 	s nextPutAll:'ignored '.
  9594         s nextPutAll:'ignored '.
  9595 	self printConditionOn:s
  9595         self printConditionOn:s
  9596     ].
  9596     ].
  9597 
  9597 
  9598 "/    ignoreCount notNil ifTrue:[
  9598 "/    ignoreCount notNil ifTrue:[
  9599 "/        ignoreCount > 0 ifTrue:[
  9599 "/        ignoreCount > 0 ifTrue:[
  9600 "/            ^ '%1 more calls ignored' bindWith:ignoreCount
  9600 "/            ^ '%1 more calls ignored' bindWith:ignoreCount
  9627 
  9627 
  9628 isActive
  9628 isActive
  9629     "true if this ignore-entry is still active"
  9629     "true if this ignore-entry is still active"
  9630 
  9630 
  9631     ignoreEndTime notNil ifTrue:[
  9631     ignoreEndTime notNil ifTrue:[
  9632 	^ ignoreEndTime > Timestamp now
  9632         ^ ignoreEndTime > Timestamp now
  9633     ].
  9633     ].
  9634     ignoreCount notNil ifTrue:[
  9634     ignoreCount notNil ifTrue:[
  9635 	^ ignoreCount == -1 or:[ ignoreCount > 0 ]
  9635         ^ ignoreCount == -1 or:[ ignoreCount > 0 ]
  9636     ].
  9636     ].
  9637     ignoredProcesses notNil ifTrue:[
  9637     ignoredProcesses notNil ifTrue:[
  9638 	ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]].
  9638         ignoredProcesses := ignoredProcesses reject:[:p | p notNil and:[p isDead]].
  9639 	ignoredProcesses isEmpty ifTrue:[
  9639         ignoredProcesses isEmpty ifTrue:[
  9640 	    ignoredProcesses := nil.
  9640             ignoredProcesses := nil.
  9641 	    ^ false
  9641             ^ false
  9642 	].
  9642         ].
  9643     ].
  9643     ].
  9644     ^ true
  9644     ^ true
  9645 
  9645 
  9646     "Created: / 06-03-2012 / 12:39:46 / cg"
  9646     "Created: / 06-03-2012 / 12:39:46 / cg"
  9647 !
  9647 !
  9662 
  9662 
  9663 isHaltIgnored
  9663 isHaltIgnored
  9664     "true if this halt should be ignored (sometimes)"
  9664     "true if this halt should be ignored (sometimes)"
  9665 
  9665 
  9666     ignoreUntilShiftKeyPressed == true ifTrue:[
  9666     ignoreUntilShiftKeyPressed == true ifTrue:[
  9667 	^ Screen current shiftDown not
  9667         ^ Screen current shiftDown not
  9668     ].
  9668     ].
  9669     ignoreCount notNil ifTrue:[
  9669     ignoreCount notNil ifTrue:[
  9670 	^ ignoreCount > 0
  9670         ^ ignoreCount > 0
  9671     ].
  9671     ].
  9672     ignoreEndTime notNil ifTrue:[
  9672     ignoreEndTime notNil ifTrue:[
  9673 	^ ignoreEndTime > Timestamp now
  9673         ^ ignoreEndTime > Timestamp now
  9674     ].
  9674     ].
  9675 
  9675 
  9676     ^ true
  9676     ^ true
  9677 
  9677 
  9678     "Modified: / 27-01-2012 / 11:36:01 / cg"
  9678     "Modified: / 27-01-2012 / 11:36:01 / cg"
  9702 
  9702 
  9703 method:methodArg lineNumber:lineNumberArg
  9703 method:methodArg lineNumber:lineNumberArg
  9704     "/ self assert:(methodArg mclass notNil).
  9704     "/ self assert:(methodArg mclass notNil).
  9705 
  9705 
  9706     methodArg == #all ifTrue:[
  9706     methodArg == #all ifTrue:[
  9707 	weakMethodHolder := methodArg
  9707         weakMethodHolder := methodArg
  9708     ] ifFalse:[
  9708     ] ifFalse:[
  9709 	weakMethodHolder := WeakArray with:methodArg.
  9709         weakMethodHolder := WeakArray with:methodArg.
  9710     ].
  9710     ].
  9711     lineNumber := lineNumberArg.
  9711     lineNumber := lineNumberArg.
  9712 
  9712 
  9713     "Modified: / 08-05-2011 / 10:28:41 / cg"
  9713     "Modified: / 08-05-2011 / 10:28:41 / cg"
  9714 ! !
  9714 ! !
  9717 
  9717 
  9718 printOn:aStream
  9718 printOn:aStream
  9719     |method|
  9719     |method|
  9720 
  9720 
  9721     (method := self method) isNil ifTrue:[
  9721     (method := self method) isNil ifTrue:[
  9722 	aStream nextPutAll:'an obsolete IgnoredHalt'.
  9722         aStream nextPutAll:'an obsolete IgnoredHalt'.
  9723 	^ self
  9723         ^ self
  9724     ].
  9724     ].
  9725 
  9725 
  9726     aStream nextPutAll:'Ignore '.
  9726     aStream nextPutAll:'Ignore '.
  9727     method isSymbol ifTrue:[
  9727     method isSymbol ifTrue:[
  9728 	method printOn:aStream.
  9728         method printOn:aStream.
  9729     ] ifFalse:[
  9729     ] ifFalse:[
  9730 	method whoString printOn:aStream.
  9730         method whoString printOn:aStream.
  9731     ].
  9731     ].
  9732     self printConditionOn:aStream.
  9732     self printConditionOn:aStream.
  9733 
  9733 
  9734     "Modified: / 27-07-2012 / 23:04:42 / cg"
  9734     "Modified: / 27-07-2012 / 23:04:42 / cg"
  9735 ! !
  9735 ! !
  9768 
  9768 
  9769     (self isForMethod:aMethod line:line) ifFalse:[^ false].
  9769     (self isForMethod:aMethod line:line) ifFalse:[^ false].
  9770     "/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored.
  9770     "/ Transcript show:'is same; ignored: '; showCR:self isHaltIgnored.
  9771 
  9771 
  9772     context notNil ifTrue:[
  9772     context notNil ifTrue:[
  9773 	ignoredReceiverClasses notNil ifTrue:[
  9773         ignoredReceiverClasses notNil ifTrue:[
  9774 	    ^ ignoredReceiverClasses includes:(context receiver class)
  9774             ^ ignoredReceiverClasses includes:(context receiver class)
  9775 	].
  9775         ].
  9776     ].
  9776     ].
  9777 
  9777 
  9778 "/    Transcript showCR:ignoredProcesses.
  9778 "/    Transcript showCR:ignoredProcesses.
  9779 "/    Transcript showCR:Processor activeProcess.
  9779 "/    Transcript showCR:Processor activeProcess.
  9780     ignoredProcesses notNil ifTrue:[
  9780     ignoredProcesses notNil ifTrue:[
  9781 	^ ignoredProcesses includes:(Processor activeProcess)
  9781         ^ ignoredProcesses includes:(Processor activeProcess)
  9782     ].
  9782     ].
  9783     ignoredSendingClassAndSelectors notNil ifTrue:[
  9783     ignoredSendingClassAndSelectors notNil ifTrue:[
  9784 	context withAllSendersDo:[:each |
  9784         context withAllSendersDo:[:each |
  9785 	    |m className selector cls|
  9785             |m className selector cls|
  9786 
  9786 
  9787 	    (m := each method) notNil ifTrue:[
  9787             (m := each method) notNil ifTrue:[
  9788 		cls := m mclass.
  9788                 cls := m mclass.
  9789 		cls notNil ifTrue:[
  9789                 cls notNil ifTrue:[
  9790 		    className := cls name.
  9790                     className := cls name.
  9791 		    selector := m selector.
  9791                     selector := m selector.
  9792 		    (ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]])
  9792                     (ignoredSendingClassAndSelectors contains:[:entry | entry first = className and:[entry second = selector]])
  9793 			ifTrue:[^ true].
  9793                         ifTrue:[^ true].
  9794 		].
  9794                 ].
  9795 	    ]
  9795             ]
  9796 	]
  9796         ]
  9797     ].
  9797     ].
  9798 
  9798 
  9799     ^ self isHaltIgnored  "/ unconditionally
  9799     ^ self isHaltIgnored  "/ unconditionally
  9800 ! !
  9800 ! !
  9801 
  9801