DebugView.st
author Claus Gittinger <cg@exept.de>
Tue, 20 Feb 1996 21:42:45 +0100
changeset 374 1b9bc0f019c9
parent 334 00d06ac75a99
child 384 ce51312029ff
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
     1
"
4
77d8e96499b2 *** empty log message ***
claus
parents: 2
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
     3
	      All Rights Reserved
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
     4
571fd5eee315 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
571fd5eee315 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
571fd5eee315 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
571fd5eee315 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
571fd5eee315 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
571fd5eee315 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
571fd5eee315 Initial revision
claus
parents:
diff changeset
    11
"
571fd5eee315 Initial revision
claus
parents:
diff changeset
    12
571fd5eee315 Initial revision
claus
parents:
diff changeset
    13
StandardSystemView subclass:#DebugView
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    14
	instanceVariableNames:'busy haveControl exitAction canContinue contextView codeView
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    15
		receiverInspector contextInspector contextArray selectedContext
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    16
		catchBlock grabber traceView tracing bigStep skipLineNr
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    17
		steppedContextAddress canAbort abortButton terminateButton
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    18
		continueButton stepButton nextButton sendButton returnButton
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    19
		restartButton exclusive inspecting nChainShown inspectedProcess
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    20
		updateProcess stopButton updateButton monitorToggle stepping
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    21
		steppedContextLineno stepForReturn actualContext inWrap'
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    22
	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail'
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    23
	poolDictionaries:''
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    24
	category:'Interface-Debugger'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    25
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    26
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    27
!DebugView class methodsFor:'documentation'!
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    28
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    29
copyright
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    30
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    31
 COPYRIGHT (c) 1989 by Claus Gittinger
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
    32
	      All Rights Reserved
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    33
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    34
 This software is furnished under a license and may be used
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    35
 only in accordance with the terms of that license and with the
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    36
 inclusion of the above copyright notice.   This software may not
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    37
 be provided or otherwise made available to, or used by, any
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    38
 other person.  No title to or ownership of the software is
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    39
 hereby transferred.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    40
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    41
!
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    42
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    43
documentation
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    44
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    45
    this class implements a graphical debugger interface.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    46
    The debugger usually sits on top of the faulting process,
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    47
    taking over its event processing. Thus only the 'stopped' process is affected;
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    48
    other processes continue to respond to events.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    49
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    50
    The one exception is when an error occurs within the dispatcher process
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    51
    or in one of the eventhandler processes - in this case, the debugger
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    52
    will sit on an exclusive display connection.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    53
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    54
    The whole debugging will be changed, once the required process primitives
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    55
    are available, which allow control of another processes execution
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    56
    (i.e. single-step, restart & return). The setup will be changed then,
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    57
    to have the debugger control the debuggee (i.e. two processes)
35
cd5cb075fd6a *** empty log message ***
claus
parents: 29
diff changeset
    58
cd5cb075fd6a *** empty log message ***
claus
parents: 29
diff changeset
    59
    See additional information in 'doc/misc/debugger.doc'.
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    60
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    61
    Notice: the DebugView class caches the last used debugger in a class
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    62
    variable. It may happen, that a malfunctioning debugger (for example,
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    63
    a halfway destoyed one) is kept there. You will notice this, if a
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    64
    debugger comes up without showing any contents. In this case, close
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    65
    (or destroy) the broken debugView, and execute
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    66
	Debugger newDebugger
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    67
    which removes the cached debugger and forces creation of a new one the
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    68
    next time. This is a temporary workaround - the debugger will be fixed to
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    69
    avoid this problem.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    70
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    71
! !
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    72
243
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    73
!DebugView class methodsFor:'initialization'!
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    74
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    75
reinitialize
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    76
    self newDebugger
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    77
! !
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    78
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    79
!DebugView class methodsFor:'instance creation'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    80
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    81
enter
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    82
    "another way of entering the debugger"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    83
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    84
    ^ self enter:(thisContext sender) withMessage:'Debugger'
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    85
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    86
    "Debugger enter"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    87
!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    88
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    89
enter:aContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    90
    "enter the debugger on aContext"
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    91
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    92
    ^ self enter:aContext withMessage:'Debugger'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    93
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    94
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    95
enter:aContext withMessage:aString
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    96
    "enter a debugger; if this is a recursive invocation, enter
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    97
     a MiniDebugger instead.
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    98
     This is the standard way of entering the debugger;
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    99
     sent from error- and halt messages."
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   100
93
claus
parents: 92
diff changeset
   101
    |active|
claus
parents: 92
diff changeset
   102
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   103
    StepInterruptPending := nil.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   104
62
8ee283ae48b2 *** empty log message ***
claus
parents: 61
diff changeset
   105
    thisContext isRecursive ifTrue:[
93
claus
parents: 92
diff changeset
   106
	^ MiniDebugger enterWithMessage:'recursive error in debugger'.
62
8ee283ae48b2 *** empty log message ***
claus
parents: 61
diff changeset
   107
    ].
8ee283ae48b2 *** empty log message ***
claus
parents: 61
diff changeset
   108
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   109
    "
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   110
     well, it could be a stepping or sending debugger up there;
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   111
     in this case, return to it. This happens, when a stepping process
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   112
     runs into an error (for example, a halt). In this case, we want the
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   113
     stepping debugger to come up again instead of a new one.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   114
    "
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   115
    OpenDebuggers notNil ifTrue:[
93
claus
parents: 92
diff changeset
   116
	active := Processor activeProcess.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   117
	OpenDebuggers do:[:aDebugger |
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   118
	    aDebugger notNil ifTrue:[
93
claus
parents: 92
diff changeset
   119
		(aDebugger inspectedProcess == active) ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   120
"/ 'entering stepping debugger again' printNL.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   121
		    aDebugger unstep.
93
claus
parents: 92
diff changeset
   122
		    aDebugger setLabelFor:aString in:active.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   123
		    ^ aDebugger enter:aContext.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   124
		]
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   125
	    ]
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   126
	]
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   127
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   128
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   129
    ^ self enterUnconditional:aContext withMessage:aString
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   130
!
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   131
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   132
enterUnconditional:aContext withMessage:aString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   133
    "enter a debugger - do not check for recursive invocation"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   134
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   135
    |aDebugger|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   136
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   137
    StepInterruptPending := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   138
    aDebugger := self new.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   139
    aDebugger setLabelFor:aString in:Processor activeProcess.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   140
    aDebugger enter:aContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   141
    ^ nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   142
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   143
    "nil halt"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   144
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   145
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   146
enterWithMessage:aString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   147
    "the standard way of entering the debugger - sent from Objects
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   148
     error- and halt messages"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   149
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   150
    ^ self enter:(thisContext sender) withMessage:aString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   151
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   152
    "Debugger enterWithMessage:'hi there'"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   153
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   154
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   155
lowSpaceCleanup 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   156
    "in low memory situations, give up cached debuggers"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   157
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   158
    self newDebugger
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   159
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   160
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   161
new
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   162
    "return a new DebugView - return a cached debugger if it already
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   163
     exists"
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   164
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   165
    |debugger|
14
e07eee5d93ca *** empty log message ***
claus
parents: 13
diff changeset
   166
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   167
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   168
     need a blocking debugger if no processes or 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   169
     or if its a timing/interrupt process 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   170
     (because otherwise we would not get any events here ...
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   171
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   172
    Processor activeProcessIsSystemProcess ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   173
	CachedExclusive isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   174
	    debugger := self newExclusive
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   175
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   176
	    debugger := CachedExclusive.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   177
	    CachedExclusive := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   178
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   179
    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   180
	CachedDebugger isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   181
	    debugger := super new.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   182
	    debugger label:'Debugger'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   183
	    debugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   184
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   185
	    debugger := CachedDebugger.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   186
	    CachedDebugger := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   187
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   188
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   189
    ^ debugger
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   190
!
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   191
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   192
newDebugger
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   193
    "force creation of a new debugger"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   194
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   195
    CachedDebugger := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   196
    CachedExclusive := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   197
    OpenDebuggers := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   198
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   199
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   200
     DebugView newDebugger
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   201
    "
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   202
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
   203
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   204
newExclusive
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   205
    "return a debugger for exclusive display access"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   206
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   207
    |debugger|
105
claus
parents: 101
diff changeset
   208
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   209
    debugger := super new.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   210
    debugger label:'Debugger'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   211
    debugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   212
    debugger exclusive:true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   213
    ^ debugger
105
claus
parents: 101
diff changeset
   214
!
claus
parents: 101
diff changeset
   215
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   216
openOn:aProcess
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   217
    "start a  debugger on aProcess
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   218
     (actually not more than a good-looking inspector)"
15
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   219
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   220
    |aDebugger label nm|
15
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   221
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   222
    aDebugger := super new.
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   223
    aDebugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   224
    aProcess notNil ifTrue:[
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   225
	nm := aProcess name.
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   226
	nm notNil ifTrue:[
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   227
	    nm := (nm contractTo:17) , '-' , aProcess id printString
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   228
	] ifFalse:[
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   229
	    nm := aProcess id printString
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   230
	].
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   231
	label := 'Debugger [' , nm , ']'.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   232
    ] ifFalse:[
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
   233
	label := 'no process'
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   234
    ].
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   235
    aDebugger label:label.
15
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   236
    aDebugger iconLabel:'Debugger'.
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   237
    aDebugger openOn:aProcess.
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   238
    ^ nil
126
claus
parents: 124
diff changeset
   239
! !
claus
parents: 124
diff changeset
   240
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   241
!DebugView methodsFor:'basic'!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   242
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   243
enter
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   244
    "enter the debugger - on the sending context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   245
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   246
    |where|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   247
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   248
    busy := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   249
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   250
    where := thisContext.      "enter"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   251
    where := where sender.     "the calling context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   252
    where notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   253
	(where receiver == DebugView) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   254
	    where := where sender
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   255
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   256
	"where is now interrupted methods context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   257
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   258
    ^ self enter:where
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   259
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   260
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   261
enter:aContext
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   262
    "enter the debugger - get and display the context, then start an
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   263
     exclusive event loop on top of eveything else"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   264
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   265
    |con selection m idx retval s|
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   266
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   267
    busy := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   268
    inspecting := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   269
    inspectedProcess := Processor activeProcess.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   270
    stepping := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   271
    bigStep := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   272
    nChainShown := 50.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   273
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   274
    "if debugger is entered while a box has grabbed the
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   275
     pointer, we must ungrab - otherwise X wont talk to
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   276
     us here
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   277
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   278
    (grabber := device activePointerGrab) notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   279
        device ungrabPointer
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   280
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   281
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   282
    (inspectedProcess suspendedContext isNil 
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   283
    or:[Processor isSystemProcess:inspectedProcess]) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   284
        terminateButton disable.
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   285
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   286
        terminateButton enable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   287
        abortButton enable.
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   288
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   289
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   290
    drawableId notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   291
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   292
         not the first time - disable buttons & menus
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   293
         from previous life
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   294
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   295
        terminateButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   296
        continueButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   297
        returnButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   298
        restartButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   299
        abortButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   300
        nextButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   301
        stepButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   302
        sendButton turnOffWithoutRedraw.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   303
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   304
        m := contextView middleButtonMenu.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   305
        m notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   306
            m disableAll:#(showMore skip skipForoReturn inspectContext).
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   307
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   308
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   309
        self iconLabel:'Debugger'.
132
claus
parents: 127
diff changeset
   310
    ].
claus
parents: 127
diff changeset
   311
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   312
    windowGroup isNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   313
        windowGroup := WindowGroup new.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   314
        windowGroup addTopView:self.
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   315
    ].
132
claus
parents: 127
diff changeset
   316
    exclusive ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   317
        "/ create a (modal) windowGroup for myself
132
claus
parents: 127
diff changeset
   318
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   319
        windowGroup setModal:true.
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   320
    ] ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   321
        "/ create a windowGroup with a synchronous sensor for me
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   322
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   323
        windowGroup sensor:(SynchronousWindowSensor new device:device).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   324
    ].
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   325
    windowGroup setProcess:Processor activeProcess.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   326
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   327
    "
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   328
     get the walkback list; clear inspectors if we did not come here by single stepping)
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   329
    "
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   330
    self setContext:aContext releaseInspectors:(exitAction ~~ #step).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   331
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   332
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   333
     and find the one context to show initially
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   334
     - if we came here by a send (single step), its the top context;
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   335
     - if we came here by a step (i.e. bigStep), its the top context
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   336
       (for ifs and whiles) or the sender (for regular sends).
303
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
   337
     - otherwise, we came here by some signal raise, and we are interested
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   338
       in the context where the raise actually occured.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   339
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   340
    exitAction == #step ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   341
        selection := 1.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   342
        steppedContextAddress notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   343
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   344
             if we came here by a big-step, show the method where we are
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   345
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   346
            (ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   347
                selection := 1
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   348
            ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   349
                (ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   350
                    selection := 2
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   351
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   352
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   353
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   354
             for bigStep, we could also be in a block below the actual method ...
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   355
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   356
            (aContext home notNil and:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   357
            (ObjectMemory addressOf:aContext home) == steppedContextAddress]) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   358
                selection := 1
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   359
            ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   360
                (aContext sender home notNil and:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   361
                (ObjectMemory addressOf:aContext sender home) == steppedContextAddress]) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   362
                    selection := 2
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   363
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   364
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   365
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   366
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   367
        steppedContextAddress isNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   368
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   369
             preselect a more interesting context, (where halt/raise was ...)
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   370
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   371
            selection := self interestingContextFrom:aContext.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   372
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   373
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   374
             if we came here by a big-step, show the method where we are
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   375
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   376
            (ObjectMemory addressOf:aContext) == steppedContextAddress ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   377
                selection := 1
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   378
            ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   379
                (ObjectMemory addressOf:aContext sender) == steppedContextAddress ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   380
                    selection := 2
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   381
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   382
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   383
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   384
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   385
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   386
    selection notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   387
        self showSelection:selection.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   388
        contextView selection:selection.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   389
        selection > 1 ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   390
            contextView scrollToLine:(selection - 1)
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   391
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   392
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   393
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   394
    m := contextView middleButtonMenu.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   395
    m notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   396
        canAbort := inspecting or:[Object abortSignal isHandled].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   397
        canAbort ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   398
            abortButton enable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   399
            m enable:#doAbort.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   400
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   401
            abortButton disable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   402
            m disable:#doAbort.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   403
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   404
        exclusive ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   405
            terminateButton disable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   406
            m disable:#doTerminate.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   407
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   408
            terminateButton enable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   409
            m enable:#doTerminate.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   410
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   411
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   412
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   413
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   414
     drawableId is nil, if this is a new debugger. Then do a realize.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   415
     Otherwise, its probably better to do a rerealize, which shows the
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   416
     view at the previous position, without a need for the user to set the
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   417
     position again
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   418
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   419
    drawableId notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   420
        self rerealize
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   421
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   422
        self realize.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   423
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   424
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   425
    exclusive ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   426
        self showError:'
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   427
Debugging system process `' , (inspectedProcess nameOrId) printString , '''.
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   428
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   429
This is a modal debugger - all event processing is stopped..
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   430
Therefore, you cannot interact with other views or 
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   431
open any other tools while this debugger is active.
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   432
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   433
Also, there is no event processing (redraw) for other views.'
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   434
    ].
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   435
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   436
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   437
     bring us to the top
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   438
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   439
    self raise.
105
claus
parents: 101
diff changeset
   440
    device flush.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   441
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   442
    canContinue := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   443
    exitAction := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   444
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   445
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   446
     enter private event handling loop. This is left (and we come back here again)
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   447
     when any button was pressed which requires continuation of the debuggee or
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   448
     closedown of the debugger.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   449
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   450
132
claus
parents: 127
diff changeset
   451
    [self controlLoop] valueOnUnwindDo:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   452
        windowGroup notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   453
            windowGroup setProcess:nil.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   454
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   455
        self destroy
132
claus
parents: 127
diff changeset
   456
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   457
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   458
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   459
     release all context stuff.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   460
     This is required to avoid keeping references to the debuggees objects
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   461
     forever. (since the debugger is reused for faster startup next time)
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   462
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   463
    contextArray := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   464
    codeView acceptAction:nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   465
    contextView contents:nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   466
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   467
    (exitAction ~~ #step) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   468
        receiverInspector release.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   469
        contextInspector release.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   470
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   471
        self unrealize.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   472
        device flush.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   473
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   474
        (exitAction == #abort) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   475
            self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   476
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   477
             have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   478
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   479
            ErrorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   480
                'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   481
                ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   482
                ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   483
            ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   484
                Object abortSignal raise.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   485
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   486
            'abort failed' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   487
        ].
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   488
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   489
        (exitAction == #return) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   490
            selectedContext notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   491
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   492
                 if there is a selection in the codeView,
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   493
                 evaluate it and use the result as return value
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   494
                "
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   495
"/ disabled for now, there is almost always a selection (the current line)
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   496
"/ and that is syntactically incorrect ...
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   497
"/ ... leading to a popup warning from the codeView
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   498
"/
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   499
"/                codeView hasSelection ifTrue:[
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   500
"/                    s := codeView selection asString.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   501
"/                    Object errorSignal handle:[:ex |
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   502
"/                        'DEBUGGER: error - returning nil' printNL.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   503
"/                        retval := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   504
"/                        ex return
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   505
"/                    ] do:[
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   506
"/                        retval := codeView doItAction value:s.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   507
"/                    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   508
"/                ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   509
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   510
                con := selectedContext.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   511
                self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   512
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   513
                 have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   514
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   515
                Object errorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   516
                    'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   517
                    ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   518
                    ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   519
                ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   520
                    con unwind:retval.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   521
                ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   522
                'cannot return from selected context' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   523
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   524
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   525
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   526
        (exitAction == #restart) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   527
            selectedContext notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   528
                con := selectedContext.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   529
                self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   530
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   531
                 have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   532
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   533
                Object errorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   534
                    'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   535
                    ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   536
                    ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   537
                ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   538
                    con unwindAndRestart.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   539
                ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   540
                'cannot restart selected context' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   541
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   542
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   543
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   544
        (exitAction == #quickTerminate) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   545
            self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   546
            Processor activeProcess terminateNoSignal
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   547
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   548
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   549
        (exitAction == #terminate) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   550
            self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   551
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   552
             have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   553
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   554
            Object errorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   555
                'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   556
                ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   557
                ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   558
            ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   559
                Processor activeProcess terminate.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   560
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   561
            'cannot terminate process' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   562
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   563
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   564
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   565
    selectedContext := actualContext := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   566
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   567
    grabber notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   568
        device grabPointerInView:grabber.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   569
        grabber := nil.
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   570
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   571
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   572
    (exitAction == #step) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   573
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   574
         schedule another stepInterrupt
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   575
         - must enter myself into the collection of open debuggers,
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   576
           in case the stepping process comes back again via a halt or signal
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   577
           before the step is finished. In this case, the stepping debugger should
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   578
           come up (instead of a new one)
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   579
         - must flush caches since optimized methods not always
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   580
           look for pending interrupts
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   581
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   582
        OpenDebuggers isNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   583
            OpenDebuggers := WeakArray with:self
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   584
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   585
            (OpenDebuggers includes:self) ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   586
                idx := OpenDebuggers identityIndexOf:nil.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   587
                idx ~~ 0 ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   588
                    OpenDebuggers at:idx put:self
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   589
                ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   590
                    OpenDebuggers := OpenDebuggers copyWith:self
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   591
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   592
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   593
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   594
        self label:'single stepping - please wait ...'.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   595
        stepping := true.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   596
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   597
        ObjectMemory stepInterruptHandler:self.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   598
        stepForReturn == true ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   599
            ObjectMemory flushInlineCaches.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   600
            StepInterruptPending := 1.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   601
            InterruptPending := 1.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   602
            InStepInterrupt := nil
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   603
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   604
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   605
        OpenDebuggers notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   606
            idx := OpenDebuggers identityIndexOf:self.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   607
            idx ~~ 0 ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   608
                OpenDebuggers at:idx put:nil
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   609
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   610
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   611
        self cacheMyself.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   612
    ]
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   613
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   614
    "Created: 24.11.1995 / 19:52:54 / cg"
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   615
    "Modified: 20.2.1996 / 20:12:22 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   616
!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   617
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   618
openOn:aProcess
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   619
    "enter the debugger on a process - 
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   620
     in this case, we are just inspecting the context chain of the process,
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   621
     not running on top of the debugged process, but as a separate
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   622
     one. (think of it as an inspector showing more detail, and offering
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   623
     some more control operations)"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   624
127
claus
parents: 126
diff changeset
   625
    |bpanel dummy|
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   626
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   627
    busy := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   628
    bigStep := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   629
    inspecting := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   630
    inspectedProcess := aProcess.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   631
    nChainShown := 50.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   632
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   633
    bpanel := abortButton superView.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   634
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   635
    stopButton := Button new.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   636
    stopButton label:(resources at:'stop');
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   637
	       action:[self doStop].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   638
    bpanel addSubView:stopButton after:continueButton.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   639
92
claus
parents: 90
diff changeset
   640
    dummy := View extent:(10 @ 5) in:bpanel.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   641
    dummy borderWidth:0; level:0.
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   642
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   643
"/    stepButton destroy.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   644
"/    sendButton destroy.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   645
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   646
    updateButton := Button
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   647
			label:(resources at:'update')
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   648
			action:[self updateContext]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   649
			in:bpanel.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   650
    monitorToggle := Toggle in:bpanel.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   651
    monitorToggle label:(resources at:'monitor').
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   652
    monitorToggle pressAction:[self autoUpdateOn].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   653
    monitorToggle releaseAction:[self autoUpdateOff].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   654
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   655
    "can only look into process - context chain is not active"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   656
    canContinue := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   657
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   658
    terminateButton enable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   659
    abortButton enable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   660
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   661
    sendButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   662
    stepButton disable.
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
   663
    nextButton disable.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   664
"/    continueButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   665
"/    returnButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   666
"/    restartButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   667
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   668
    aProcess isNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   669
	terminateButton disable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   670
	abortButton disable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   671
	continueButton disable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   672
	returnButton disable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   673
	restartButton disable.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   674
    ] ifFalse:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   675
	(aProcess suspendedContext isNil 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   676
	or:[Processor isSystemProcess:aProcess]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   677
	    terminateButton disable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   678
	].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   679
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   680
	self setContext:aProcess suspendedContext.
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   681
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   682
	catchBlock := [
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   683
	    catchBlock := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   684
	    contextArray := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   685
	    selectedContext := actualContext := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   686
	    (exitAction == #terminate) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   687
		aProcess terminate.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   688
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   689
	    (exitAction == #quickTerminate) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   690
		aProcess terminateNoSignal.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   691
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   692
	    super destroy
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
   693
	].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   694
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   695
    self open
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   696
317
c6772be0b62f only disable terminateButton (abort is handled and sometimes useful)
Claus Gittinger <cg@exept.de>
parents: 316
diff changeset
   697
    "Modified: 22.12.1995 / 23:30:37 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   698
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   699
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   700
!DebugView methodsFor:'help'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   701
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   702
helpTextFor:aComponent
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   703
    |s|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   704
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   705
    aComponent == abortButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   706
	s := 'HELP_ABORT'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   707
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   708
    aComponent == terminateButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   709
	s := 'HELP_TERMINATE'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   710
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   711
    aComponent == continueButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   712
	s := 'HELP_CONTINUE'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   713
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   714
    aComponent == stepButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   715
	s := 'HELP_STEP'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   716
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   717
    aComponent == nextButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   718
	s := 'HELP_NEXT'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   719
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   720
    aComponent == stepButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   721
	s := 'HELP_STEP'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   722
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   723
    aComponent == sendButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   724
	s := 'HELP_SEND'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   725
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   726
    aComponent == returnButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   727
	s := 'HELP_RETURN'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   728
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   729
    aComponent == restartButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   730
	s := 'HELP_RESTART'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   731
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   732
    aComponent == contextView ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   733
	s := 'HELP_WALKBACK'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   734
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   735
    aComponent == codeView ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   736
	s := 'HELP_CODEVIEW'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   737
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   738
    aComponent == monitorToggle ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   739
	s := 'HELP_MONITOR'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   740
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   741
    aComponent == updateButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   742
	s := 'HELP_UPDATE'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   743
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   744
    aComponent == stopButton ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   745
	s := 'HELP_STOP'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   746
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   747
    (aComponent isSubViewOf:receiverInspector) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   748
	s := 'HELP_REC_INSP'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   749
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   750
    (aComponent isSubViewOf:contextInspector) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   751
	s := 'HELP_CON_INSP'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   752
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   753
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   754
    s notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   755
	^ resources string:s
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   756
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   757
    ^ nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   758
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   759
    "Modified: 29.8.1995 / 23:38:54 / claus"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   760
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   761
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   762
!DebugView methodsFor:'initialization'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   763
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   764
addToCurrentProject
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   765
    "ignored here"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   766
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   767
    ^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   768
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   769
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   770
createOnTop
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   771
    ^ false "true"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   772
!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   773
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   774
initialize
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   775
    |v panel hpanel bpanel separator|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   776
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   777
    super initialize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   778
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   779
    font := font on:device.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   780
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   781
    busy := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   782
    exclusive := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   783
    inspecting := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   784
    exitAction := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   785
    bigStep := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   786
    canContinue := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   787
    canAbort := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   788
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   789
    bpanel := HorizontalPanelView
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   790
"/                        origin:(0.0 @ 0.0)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   791
"/                        extent:(1.0 @ (font height * 2))
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   792
			    in:self.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   793
    bpanel horizontalLayout:#leftSpace.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   794
    bpanel verticalSpace:ViewSpacing // 2.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   795
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   796
    terminateButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   797
			label:(resources at:'terminate')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   798
			action:[terminateButton turnOffWithoutRedraw. self doTerminate]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   799
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   800
    separator := View extent:(10 @ 5) in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   801
    separator borderWidth:0; level:0.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   802
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   803
    abortButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   804
			label:(resources at:'abort')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   805
			action:[abortButton turnOffWithoutRedraw. self doAbort]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   806
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   807
    returnButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   808
			label:(resources at:'return')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   809
			action:[returnButton turnOff. self doReturn]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   810
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   811
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   812
    restartButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   813
			label:(resources at:'restart')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   814
			action:[restartButton turnOff. self doRestart]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   815
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   816
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   817
    separator := View extent:(10 @ 5) in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   818
    separator borderWidth:0; level:0.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   819
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   820
    continueButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   821
			label:(resources at:'continue')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   822
			action:[continueButton turnOffWithoutRedraw. self doContinue]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   823
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   824
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   825
    separator := View extent:(10 @ 5) in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   826
    separator borderWidth:0; level:0.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   827
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   828
    nextButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   829
			label:(resources at:'next')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   830
			action:[stepButton turnOff. self doNext]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   831
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   832
    stepButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   833
			label:(resources at:'step')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   834
			action:[stepButton turnOff. self doStep]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   835
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   836
    sendButton := Button
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   837
			label:(resources at:'send')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   838
			action:[sendButton turnOff. self doSend]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   839
			in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   840
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   841
    bpanel origin:(0.0 @ 0.0)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   842
	   extent:(1.0 @ (bpanel preferredExtent y)).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   843
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   844
    panel := VariableVerticalPanel
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   845
			origin:(0.0 @ bpanel height)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   846
			corner:(1.0 @ 1.0)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   847
			    in:self.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   848
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   849
    v := ScrollableView for:SelectionInListView in:panel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   850
    v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   851
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   852
    contextView := v scrolledView.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   853
    contextView action:[:lineNr | self showSelection:lineNr].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   854
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   855
    v := ScrollableView for:CodeView in:panel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   856
    v origin:(0.0 @ 0.25) corner:(1.0 @ 0.75).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   857
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   858
    codeView := v scrolledView.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   859
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   860
    hpanel := VariableHorizontalPanel in:panel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   861
    hpanel origin:(0.0 @ 0.75) corner:(1.0 @ 1.0).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   862
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   863
    receiverInspector := InspectorView
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   864
				origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   865
				    in:hpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   866
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   867
    contextInspector := ContextInspectorView
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   868
				origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   869
				    in:hpanel
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   870
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   871
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   872
initializeMiddleButtonMenu
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   873
    |labels m|
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   874
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   875
    labels := resources array:#(
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   876
				'show more'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   877
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   878
				'skip'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   879
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   880
"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   881
				'continue'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   882
				'terminate'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   883
				'abort'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   884
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   885
				'step'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   886
				'send'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   887
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   888
				'return'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   889
				'restart'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   890
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   891
"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   892
				'remove breakpoint'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   893
				'remove all trace & breakpoints'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   894
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   895
				'browse'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   896
				'browse class'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   897
				'browse class hierarchy'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   898
				'browse full class protocol'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   899
				'implementors'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   900
				'senders'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   901
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   902
				'inspect context'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   903
				'copy walkback text'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   904
				'-'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   905
				'quickTerminate'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   906
				'='
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   907
				'exit smalltalk (no confirmation)'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   908
			      ).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   909
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   910
    m := (PopUpMenu 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   911
				labels:labels
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   912
			     selectors:#(
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   913
					 showMore
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   914
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   915
					 skip
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   916
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   917
"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   918
					 doContinue
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   919
					 doTerminate
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   920
					 doAbort
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   921
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   922
					 doStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   923
					 doSend
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   924
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   925
					 doReturn
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   926
					 doRestart
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   927
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   928
"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   929
					 removeBreakpoint
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   930
					 removeAllBreakpoints
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   931
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   932
					 browse
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   933
					 browseClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   934
					 browseClassHierarchy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   935
					 browseFullClassProtocol
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   936
					 implementors
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   937
					 senders
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   938
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   939
					 inspectContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   940
					 copyWalkbackText
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   941
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   942
					 quickTerminate
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   943
					 nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   944
					 exit
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   945
					)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   946
				  receiver:self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   947
				       for:contextView).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   948
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   949
    contextView middleButtonMenu:m. 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   950
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   951
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   952
	m notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   953
	    m disableAll:#(doTraceStep removeBreakpoint browse browseClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   954
			   browseClassHierarchy browseFullClassProtocol
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   955
			   implementors senders inspectContext skip).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   956
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   957
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   958
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   959
    "Modified: 22.11.1995 / 21:40:33 / cg"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   960
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   961
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   962
realize
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   963
    super realize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   964
"/    exclusive ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   965
"/        windowGroup := nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   966
"/    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   967
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   968
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   969
	inspectedProcess notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   970
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   971
	     set prio somewhat higher (by 2, to allow walkBack-update process
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   972
	     to run between mine and the debugged processes prio)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   973
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   974
	    Processor activeProcess 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   975
		priority:(inspectedProcess priority + 2 min:16).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   976
	]
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   977
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   978
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   979
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   980
setLabelFor:aMessage in:aProcess
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   981
    |l nm|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   982
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   983
    l := aMessage , ' ('.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   984
    nm := aProcess name.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   985
    nm notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   986
	l := l , (nm contractTo:17) , ''.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   987
    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   988
    l := l , '[' , aProcess id printString , '])'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   989
    self label:l.
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   990
! !
571fd5eee315 Initial revision
claus
parents:
diff changeset
   991
571fd5eee315 Initial revision
claus
parents:
diff changeset
   992
!DebugView methodsFor:'interrupt handling'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
   993
571fd5eee315 Initial revision
claus
parents:
diff changeset
   994
stepInterrupt
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   995
    |where here s isWrap method lastWrappedConAddr wrappedMethod inBlock left ignore|
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   996
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   997
    "/
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   998
    "/ should no longer happen
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   999
    "/
333
245f0a972fc9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
  1000
    stepForReturn == true ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1001
	self enter:thisContext sender.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1002
	^ self
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1003
    ].
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1004
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
  1005
    Processor activeProcess ~~ inspectedProcess ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1006
	'stray step interrupt' errorPrintNL.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1007
	^ self
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
  1008
    ].
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
  1009
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1010
    "
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1011
     kludge to hide breakpoint wrappers in the context list: 
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1012
	 check if we are in a wrapper methods hidden setup-sequence
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1013
	 if so, ignore the interrupt and continue single sending
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1014
    "
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1015
    here := thisContext.        "stepInterrupt"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1016
    here := here sender.        "the interrupted context"  
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1017
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1018
"/ '*******' printNL.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1019
"/ 'here in ' print.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1020
"/  ((ObjectMemory addressOf:here) printStringRadix:16)print. '' printNL.
10
46e0d4f2079f *** empty log message ***
claus
parents: 7
diff changeset
  1021
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1022
    where := here.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1023
    isWrap := false.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1024
    left := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1025
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1026
    inWrap ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1027
	wrappedMethod := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1028
	5 timesRepeat:[
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1029
"/ where selector printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1030
	    (where notNil and:[where isBlockContext not]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1031
		method := where method.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1032
		(method notNil and:[method isWrapped]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1033
		    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1034
		     in a wrapper method
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1035
		    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1036
		    wrappedMethod ~~ method ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1037
			wrappedMethod := method.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1038
			lastWrappedConAddr := ObjectMemory addressOf:where.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1039
			where sender receiver == method originalMethod ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1040
			    isWrap := true.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1041
			]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1042
		    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1043
			(ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1044
"/ 'change stepCon from: ' print.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1045
"/ (steppedContextAddress printStringRadix:16)print.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1046
"/ ' to: ' print.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1047
"/ (lastWrappedConAddr printStringRadix:16)printNL.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1048
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1049
			    inWrap := false.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1050
			    steppedContextAddress := lastWrappedConAddr
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1051
			]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1052
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1053
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1054
		where := where sender
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1055
	    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1056
	].
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1057
    ].
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1058
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1059
    isWrap ifTrue:[
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1060
"/ 'ignore wrap' printNL.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1061
"/ ' ' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1062
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1063
	  ignore, while in wrappers hidden setup
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1064
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1065
	where := nil. here := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1066
	ObjectMemory flushInlineCaches.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1067
	StepInterruptPending := 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1068
	InterruptPending := 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1069
	InStepInterrupt := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1070
	^ nil
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1071
    ].
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1072
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1073
    inBlock := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1074
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1075
    "
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1076
     is this for a send or a step/next ?
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1077
    "
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1078
    bigStep ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1079
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1080
	 a step or next - ignore all contexts below the interesting one
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1081
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1082
	where := here.      "the interrupted context"
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1083
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1084
	where home notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1085
	    "/
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1086
	    "/ in a block called by 'our' context ?
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1087
	    "/
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1088
	    (ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1089
"/ '*block*' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1090
		inBlock := true
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1091
	    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1092
	].
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1093
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1094
	(ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1095
	    where := where sender.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1096
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1097
	    where home notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1098
		(ObjectMemory addressOf:where home) == steppedContextAddress ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1099
"/ '*block*' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1100
		    inBlock := true.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1101
		]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1102
	    ].
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1103
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1104
"/ 'looking for ' print.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1105
"/  (steppedContextAddress printStringRadix:16)print. '' printNL.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1106
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1107
	    (ObjectMemory addressOf:where) == steppedContextAddress ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1108
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1109
		 check if we are in a context below steppedContext
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1110
		 (i.e. if steppedContext can be reached from
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1111
		  interrupted context. Not using context-ref but its
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1112
		  address to avoid creation of many useless contexts.)
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1113
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1114
		inBlock ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1115
		    [where notNil] whileTrue:[
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1116
"/  ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1117
"/  where selector printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1118
			(ObjectMemory addressOf:where) == steppedContextAddress ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1119
"/ 'found it - below; ignore' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1120
			    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1121
			     found the interesting context somwehere up in the
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1122
			     chain. We seem to be still below the interesting one ...
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1123
			    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1124
			    tracing == true ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1125
				here printString printNewline
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1126
			    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1127
			    where := nil. here := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1128
			    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1129
			      yes, a context below
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1130
			      - continue and schedule another stepInterrupt.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1131
			      Must flush caches since optimized methods not always
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1132
			      look for pending interrupts
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1133
			    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1134
			    ObjectMemory flushInlineCaches.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1135
			    StepInterruptPending := 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1136
			    InterruptPending := 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1137
			    InStepInterrupt := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1138
			    ^ nil
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1139
			].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1140
			where := where sender
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1141
		    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1142
		    s := 'left stepped method'.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1143
		    left := true.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1144
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1145
	    ] ifTrue:[
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1146
"/ 'found it right in sender' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1147
		s := 'after step'
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1148
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1149
	] ifTrue:[
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1150
"/ 'found it right away' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1151
	    s := 'after step'
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1152
	].
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1153
    ] ifFalse:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1154
"/ ' send' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1155
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1156
	 a send
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1157
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1158
	steppedContextAddress := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1159
	s := 'after send'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1160
    ].
7
92b82578c88c *** empty log message ***
claus
parents: 4
diff changeset
  1161
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1162
    inBlock ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1163
"/ 'inBlock' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1164
	s := 'in block'.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1165
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1166
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1167
"/    where notNil ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1168
"/        '(' print. steppedContextLineno print. ') ' print.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1169
"/        where print.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1170
"/        '[' print. where lineNumber print. ']' printNL.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1171
"/    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1172
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1173
    ignore := false.
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
  1174
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1175
    (bigStep 
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
  1176
    and:[steppedContextLineno notNil 
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1177
    and:[where notNil 
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
  1178
    and:[where lineNumber == steppedContextLineno]]]) ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1179
"/ 'same line - ignored' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1180
	ignore := true
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1181
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1182
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1183
    (left not 
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1184
    and:[skipLineNr notNil 
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1185
    and:[where lineNumber ~~ skipLineNr]]) ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1186
"/ 'skip (' print. skipLineNr print. ' unreached - ignored' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1187
	ignore := true
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1188
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1189
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1190
    ignore ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1191
"/' ' printNL.
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1192
	where := nil. here := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1193
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1194
	 yes, a context below
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1195
	  - continue and schedule another stepInterrupt.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1196
	  Must flush caches since optimized methods not always
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1197
	  look for pending interrupts
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1198
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1199
	ObjectMemory flushInlineCaches.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1200
	StepInterruptPending := 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1201
	InterruptPending := 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1202
	InStepInterrupt := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1203
	^ nil
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1204
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1205
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1206
"/ ' ' printNL.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1207
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1208
    name := Processor activeProcess nameOrId.
7
92b82578c88c *** empty log message ***
claus
parents: 4
diff changeset
  1209
    self label:(s , ' (process: ' , name , ')').
92b82578c88c *** empty log message ***
claus
parents: 4
diff changeset
  1210
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1211
    tracing := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1212
    bigStep := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1213
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1214
    "release refs to context"
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1215
    where := nil. here := nil.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1216
    self enter:thisContext sender
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1217
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1218
    "Modified: 14.12.1995 / 21:46:20 / cg"
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1219
! !
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1220
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1221
!DebugView methodsFor:'menu / button actions'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1222
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1223
autoUpdateOff
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1224
    "stop the update process"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1225
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1226
    updateProcess notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1227
	monitorToggle lampColor:(Color yellow).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1228
	updateProcess terminate.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1229
	updateProcess := nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1230
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1231
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1232
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1233
autoUpdateOn
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1234
    "fork a subprocess which updates the contextList in regular intervals"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1235
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1236
    updateProcess isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1237
	updateProcess := 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1238
	    [
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1239
		[true] whileTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1240
		    monitorToggle showLamp ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1241
			monitorToggle lampColor:(Color yellow).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1242
		    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1243
			monitorToggle activeForegroundColor:Color black.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1244
		    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1245
		    (Delay forSeconds:0.25) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1246
		    self updateContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1247
		    monitorToggle showLamp ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1248
			monitorToggle lampColor:(Color red).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1249
		    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1250
			monitorToggle activeForegroundColor:Color red.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1251
		    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1252
		    (Delay forSeconds:0.25) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1253
		    self updateContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1254
		]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1255
	    ] forkAt:(Processor activePriority - 1)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1256
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1257
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1258
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1259
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1260
browse
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1261
    |w|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1262
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1263
    w := selectedContext method who.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1264
    SystemBrowser openInClass:(w at:1) selector:(w at:2).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1265
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1266
    "Created: 22.11.1995 / 21:27:01 / cg"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1267
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1268
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1269
browseClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1270
    SystemBrowser browseClass:(selectedContext method who at:1).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1271
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1272
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1273
browseClassHierarchy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1274
    SystemBrowser browseClassHierarchy:(selectedContext method who at:1).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1275
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1276
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1277
browseFullClassProtocol
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1278
    SystemBrowser browseFullClassProtocol:(selectedContext method who at:1).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1279
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1280
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1281
copyWalkbackText
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1282
    "place the contents of the walkback view into the copy-paste buffer.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1283
     This allows pasting it into some other view for printing ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1284
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1285
    self setTextSelection:(contextArray collect:[:con | con fullPrintString]) asStringCollection
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1286
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1287
    "Modified: 28.8.1995 / 15:31:59 / claus"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1288
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1289
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1290
doAbort
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1291
    "abort - send Object>>abortSignal, which is usually cought
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1292
     at save places (for example: in the event loop) and returns back
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1293
     from whatever the process is doing, but does not terminate it."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1294
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1295
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1296
	inspectedProcess isDead ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1297
	    self showTerminated.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1298
	    ^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1299
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1300
	(Object abortSignal isHandledIn:inspectedProcess suspendedContext) ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1301
	    self showError:'** the process does not handle the abort signal **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1302
	] ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1303
	    self interruptProcessWith:[Object abortSignal raise].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1304
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1305
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1306
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1307
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1308
    steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1309
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1310
    exitAction := #abort.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1311
    ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1312
	"exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1313
	catchBlock notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1314
	    abortButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1315
	    catchBlock value.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1316
	    'DEBUGGER: oops, abort failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1317
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1318
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1319
    ^ self.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1320
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1321
"obsolete ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1322
"/    Processor activeProcess id == 0 ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1323
"/        "dont allow termination of main-thread"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1324
"/        exitAction := #abort
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1325
"/    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1326
"/        exitAction := #terminate 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1327
"/    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1328
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1329
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1330
doContinue
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1331
    "continue from menu"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1332
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1333
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1334
	self processPerform:#resume.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1335
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1336
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1337
    canContinue ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1338
	steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1339
	tracing := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1340
	haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1341
	exitAction := #continue.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1342
	ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1343
	    "exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1344
	    catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1345
	    'DEBUGGER: oops, continue failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1346
	    continueButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1347
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1348
    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1349
	inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1350
	    'resuming top context' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1351
	    self showSelection:1.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1352
	    self doReturn
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1353
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1354
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1355
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1356
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1357
doNext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1358
    "skip for next source-code line"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1359
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1360
    self doStep:nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1361
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1362
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1363
doNoTrace
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1364
    traceView notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1365
	traceView topView destroy.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1366
	traceView := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1367
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1368
    tracing := false
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1369
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1370
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1371
doRestart
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1372
    "restart - the selected context will be restarted"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1373
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1374
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1375
	selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1376
	    ^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1377
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1378
	self interruptProcessWith:[selectedContext unwindAndRestart].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1379
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1380
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1381
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1382
    steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1383
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1384
    exitAction := #restart.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1385
    ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1386
	"exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1387
	catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1388
	'DEBUGGER: oops, restart failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1389
	restartButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1390
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1391
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1392
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1393
doReturn
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1394
    "return - the selected context will do a ^nil"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1395
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1396
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1397
	selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1398
	    ^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1399
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1400
	self interruptProcessWith:[selectedContext unwind].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1401
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1402
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1403
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1404
    steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1405
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1406
    exitAction := #return.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1407
    ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1408
	"exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1409
	catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1410
	'DEBUGGER: oops, return failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1411
	returnButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1412
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1413
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1414
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1415
doSend
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1416
    "single send; reenter with next message send"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1417
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1418
    inspecting ifTrue:[^ self].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1419
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1420
    canContinue ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1421
	steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1422
	haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1423
	exitAction := #step.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1424
	ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1425
	    "exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1426
	    catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1427
	    'DEBUGGER: oops, send failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1428
	    sendButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1429
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1430
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1431
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1432
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1433
doStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1434
    "skip for next send in selected method"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1435
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1436
    self doStep:-1 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1437
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1438
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1439
doStep:lineNr
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1440
    "step until we pass lineNr (if nonNil) or to next line (if nil)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1441
     or to next send (if -1)"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1442
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1443
    |con method|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1444
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1445
    inspecting ifTrue:[^ self].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1446
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1447
    canContinue ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1448
	selectedContext notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1449
	    con := selectedContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1450
	    steppedContextLineno := actualContext lineNumber.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1451
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1452
	    con := contextArray at:2.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1453
	    steppedContextLineno := con lineNumber.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1454
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1455
	skipLineNr := lineNr.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1456
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1457
	lineNr == -1 ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1458
	    steppedContextLineno := skipLineNr := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1459
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1460
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1461
	steppedContextAddress := ObjectMemory addressOf:con.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1462
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1463
	 if we step in a wrapped method,
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1464
	 prepare to skip the prolog ...
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1465
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1466
"/ ' step con:' print. steppedContextAddress printHex. ' ' printNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1467
	inWrap := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1468
	method := con method.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1469
	(method notNil and:[method isWrapped]) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1470
	    inWrap := true
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1471
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1472
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1473
	con := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1474
	bigStep := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1475
	haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1476
	exitAction := #step.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1477
	ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1478
	    "exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1479
	    catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1480
	    'DEBUGGER: oops, step failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1481
	    stepButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1482
	    nextButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1483
	    sendButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1484
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1485
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1486
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1487
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1488
doStop
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1489
    "stop the process (if its running, otherwise this is a no-op)"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1490
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1491
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1492
	self processPerform:#stop.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1493
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1494
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1495
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1496
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1497
doTerminate
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1498
    "terminate - the process has a chance for cleanup"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1499
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1500
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1501
	self processPerform:#terminate.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1502
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1503
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1504
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1505
    steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1506
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1507
    exitAction := #terminate. 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1508
    ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1509
	"exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1510
	catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1511
	inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1512
	    'DEBUGGER: oops, terminate failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1513
	    self warn:'terminate failed'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1514
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1515
	terminateButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1516
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1517
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1518
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1519
doTrace
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1520
    "tracing - not really implemented ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1521
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1522
    self warn:'this function is not yet implemented'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1523
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1524
"/    |v b|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1525
"/
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1526
"/    traceView isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1527
"/        v := StandardSystemView on:Display.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1528
"/        v label:'Debugger-Trace'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1529
"/        v icon:icon.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1530
"/
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1531
"/        b := Button label:'untrace' in:v.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1532
"/        b origin:(0 @ 0) extent:(1.0 @ (b height)).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1533
"/        b action:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1534
"/            StepInterruptPending := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1535
"/            tracing := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1536
"/            v unrealize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1537
"/            traceView := nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1538
"/        ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1539
"/        traceView := ScrollableView for:TextCollector in:v.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1540
"/        traceView origin:(0 @ (b height))
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1541
"/                  extent:[v width @ (v height - b height)]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1542
"/    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1543
"/    v realize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1544
"/
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1545
"/    tracing := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1546
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1547
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1548
doTraceStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1549
    "tracestep - not implemented yet"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1550
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1551
    canContinue ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1552
	tracing := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1553
	self doStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1554
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1555
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1556
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1557
exit
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1558
    "exit from menu: immediate exit from smalltalk"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1559
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1560
    OperatingSystem exit
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1561
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1562
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1563
implementors
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1564
    "open a browser on the implementors"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1565
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1566
    selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1567
	^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1568
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1569
    SystemBrowser browseImplementorsOf:selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1570
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1571
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1572
inspectContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1573
    "launch an inspector on the currently selected context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1574
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1575
    contextView selection notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1576
	(contextView selectionValue startsWith:'**') ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1577
	    (contextArray at:(contextView selection)) inspect.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1578
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1579
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1580
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1581
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1582
quickTerminate
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1583
    "quick terminate - the process will get no chance for cleanup actions"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1584
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1585
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1586
	self processPerform:#terminateNoSignal.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1587
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1588
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1589
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1590
    steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1591
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1592
    exitAction := #quickTerminate.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1593
    ProcessorScheduler isPureEventDriven ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1594
	"exit private event-loop"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1595
	catchBlock notNil ifTrue:[catchBlock value].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1596
	inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1597
	    'DEBUGGER: oops, terminate failed' errorPrintNL.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1598
	    self warn:'terminate failed'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1599
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1600
	terminateButton turnOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1601
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1602
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1603
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1604
removeAllBreakpoints
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1605
    "remove all trace & breakpoints - if any"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1606
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1607
    MessageTracer unwrapAllMethods
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1608
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1609
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1610
removeBreakpoint
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1611
    "remove breakpoint on the selected contexts method - if any"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1612
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1613
    |implementorClass method|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1614
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1615
    selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1616
	^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1617
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1618
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1619
    implementorClass := selectedContext methodClass. 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1620
    implementorClass notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1621
	method := implementorClass compiledMethodAt:selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1622
	(method notNil and:[method isWrapped]) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1623
	    MessageTracer unwrapMethod:method
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1624
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1625
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1626
    contextView middleButtonMenu disable:#removeBreakpoint.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1627
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1628
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1629
senders
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1630
    "open a browser on the senders"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1631
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1632
    selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1633
	^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1634
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1635
    SystemBrowser browseAllCallsOn:selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1636
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1637
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1638
showMore
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1639
    "double number of contexts shown"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1640
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1641
    |oldSelection con|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1642
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1643
    contextArray notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1644
	oldSelection := contextView selection.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1645
	nChainShown := nChainShown * 2.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1646
	con := contextArray at:1.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1647
	contextArray at:1 put:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1648
	self setContext:con.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1649
	contextView selection:oldSelection.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1650
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1651
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1652
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1653
skip
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1654
    "skip for cursor line in selected method"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1655
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1656
    self doStep:codeView cursorLine.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1657
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1658
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1659
!DebugView methodsFor:'private'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1660
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1661
busy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1662
    ^ busy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1663
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1664
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1665
cacheMyself
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1666
    "remember myself for next debug session"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1667
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1668
    "caching the last debugger will make the next debugger appear
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1669
     faster, since no resources have to be allocated in the display.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1670
     We have to be careful to release all refs to the debuggee, though.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1671
     Otherwise, the GC will not be able to release it"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1672
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1673
    windowGroup notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1674
	windowGroup setProcess:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1675
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1676
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1677
    busy := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1678
    codeView acceptAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1679
    codeView doItAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1680
    codeView contents:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1681
    receiverInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1682
    contextInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1683
    inspectedProcess := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1684
    exitAction := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1685
    contextArray := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1686
    selectedContext := actualContext := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1687
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1688
    grabber := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1689
    self autoUpdateOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1690
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1691
    exclusive ifTrue:[CachedExclusive := self] ifFalse:[CachedDebugger := self].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1692
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1693
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1694
exclusive:aBoolean
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1695
    exclusive := aBoolean
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1696
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1697
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1698
inspectedProcess 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1699
    ^ inspectedProcess 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1700
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1701
303
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
  1702
interestingContextFrom:aContext
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
  1703
    "return an interesting contexts offset, or nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1704
     This is the context initially shown in the walkback.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1705
     We move up the calling chain, skipping all intermediate Signal
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1706
     and Exception contexts, to present the context in which the error
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1707
     actually occured.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1708
     Just for your convenience :-)"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1709
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1710
    |c found offset sel prev ex|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1711
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1712
    "somewhere, at the bottom, there must be a raise ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1713
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1714
    c := aContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1715
    1 to:5 do:[:i |
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1716
	c isNil ifTrue:[^ 1 "^ nil"].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1717
	sel := c selector.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1718
	(sel == #raise) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1719
	    (c receiver isKindOf:Exception) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1720
		ex := c receiver.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1721
		offset := i.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1722
		found := c
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1723
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1724
		(c receiver isKindOf:Signal) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1725
		    offset := i.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1726
		    found := c
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1727
		]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1728
	    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1729
	].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1730
	c := c sender.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1731
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1732
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1733
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1734
     if this is a noHandler exception, skip forward
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1735
     to the erronous context
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1736
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1737
    ex notNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1738
	ex signal == Signal noHandlerSignal ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1739
	    c := ex suspendedContext
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1740
	]
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1741
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1742
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1743
    (c := found) isNil ifTrue:[^ 1].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1744
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1745
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1746
     got it; move up, skipping all intermediate Signal and
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1747
     Exception contexts
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1748
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1749
    prev := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1750
    [   
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1751
	((c receiver isSignal)
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1752
	or:[(c receiver isKindOf:Exception)])
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1753
    ] whileTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1754
	prev := c.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1755
	(c := c sender) isNil ifTrue:[^ offset].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1756
	offset := offset + 1.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1757
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1758
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1759
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1760
     now, we are one above the raise
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1761
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1762
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1763
    "
269
6a0af2256d0b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
  1764
     if the sender-method of the raise is one of objects error methods ...
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1765
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1766
    ( #( halt halt: 
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1767
	 error error: 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1768
	 doesNotUnderstand: 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1769
	 subclassResponsibility 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1770
	 primitiveFailed) includes:c selector) 
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1771
    ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1772
	c selector == #doesNotUnderstand: ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1773
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1774
	     one more up, to get to the originating context
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1775
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1776
	    (c := c sender) isNil ifTrue:[^ offset].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1777
	    offset := offset + 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1778
	].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1779
	(c := c sender) isNil ifTrue:[^ offset].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1780
	offset := offset + 1.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1781
    ] ifFalse:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1782
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1783
	 ok, got the raise - if its a BreakPoint, look for the sender
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1784
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1785
	(MessageTracer notNil and:[prev receiver == MessageTracer breakpointSignal]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1786
	    offset := offset + 1
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1787
	].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1788
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1789
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1790
    ^ offset
269
6a0af2256d0b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
  1791
6a0af2256d0b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
  1792
    "Created: 10.12.1995 / 13:55:21 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1793
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1794
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1795
interruptProcessWith:aBlock
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1796
    "let inspected process do something, then update the context list"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1797
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1798
    inspectedProcess isDead ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1799
	self showTerminated.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1800
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1801
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1802
    inspectedProcess interruptWith:aBlock.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1803
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1804
     give the process a chance to run, then update
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1805
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1806
    (Delay forSeconds:0.2) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1807
    self setContext:(inspectedProcess suspendedContext).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1808
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1809
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1810
processPerform:aMessage
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1811
    "do something, then update the context list"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1812
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1813
    inspectedProcess isDead ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1814
	self showTerminated.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1815
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1816
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1817
    inspectedProcess perform:aMessage.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1818
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1819
     give the process a chance to run, then update
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1820
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1821
    (Delay forSeconds:0.2) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1822
    self setContext:(inspectedProcess suspendedContext).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1823
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1824
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1825
setContext:aContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1826
    "show calling chain from aContext in the walk-back listview"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1827
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1828
    self setContext:aContext releaseInspectors:true
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1829
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1830
    "Modified: 14.12.1995 / 19:10:51 / cg"
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1831
!
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1832
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1833
setContext:aContext releaseInspectors:releaseInspectors
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1834
    "show calling chain from aContext in the walk-back listview"
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1835
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1836
    |con text method caller caller2 m count|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1837
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1838
    (contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1839
	"no change"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1840
	^ false
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1841
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1842
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1843
    m := contextView middleButtonMenu.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1844
    m notNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1845
	m disable:#showMore.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1846
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1847
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1848
    aContext isNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1849
	text := Array with:'** no context **'.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1850
	contextArray := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1851
    ] ifFalse:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1852
	text := OrderedCollection new:nChainShown.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1853
	contextArray := OrderedCollection new:nChainShown.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1854
	con := aContext.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1855
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1856
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1857
	 get them all
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1858
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1859
	count := 0.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1860
	[con notNil and:[count <= nChainShown]] whileTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1861
	    contextArray add:con. count := count + 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1862
	    (MoreDebuggingDetail == true) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1863
		text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString).
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1864
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1865
		text add:con printString.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1866
	    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1867
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1868
	    method := con method.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1869
	    (method notNil and:[method isWrapped]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1870
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1871
		 kludge: if its a wrapped method, then hide the wrap-call
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1872
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1873
		caller := con sender.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1874
		(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1875
		    caller2 := caller sender.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1876
		    (caller2 notNil and:[caller2 method == method]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1877
			con := caller2
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1878
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1879
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1880
		caller := caller2 := nil
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1881
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1882
	    con := con sender
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1883
	].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1884
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1885
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1886
	 did we reach the end ?
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1887
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1888
	(con isNil or:[con sender isNil]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1889
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1890
	     the very last one is the startup context
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1891
	     (in main) - it has nil as receiver and nil as selector
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1892
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1893
	    contextArray last selector isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1894
		contextArray removeLast.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1895
		text removeLast
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1896
	    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1897
	] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1898
	    m notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1899
		m enable:#showMore.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1900
		text add:(resources string:'*** more walkback follows - click here to see them ***')
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1901
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1902
	].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1903
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1904
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1905
    contextView setList:text.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1906
    releaseInspectors ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1907
	receiverInspector release.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1908
	contextInspector release.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1909
    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1910
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1911
    m notNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1912
	m disable:#removeBreakpoint.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1913
	m disable:#implementors.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1914
	m disable:#senders.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1915
	m disable:#browseClass.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1916
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1917
    ^ true
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1918
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1919
    "Created: 14.12.1995 / 19:10:31 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1920
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1921
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1922
showError:message
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1923
    codeView contents:(resources string:message).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1924
    shown ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1925
	exclusive ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1926
	    "/ consider this a kludge:
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1927
	    "/ if exclusive, cannot use flash, since it suspends
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1928
	    "/ (but we cannot suspend here ...)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1929
	    codeView redrawInverted. device flush.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1930
	    OperatingSystem millisecondDelay:200.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1931
	    codeView redraw
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1932
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1933
	    codeView flash
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1934
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1935
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1936
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1937
    "Modified: 24.11.1995 / 22:07:30 / cg"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1938
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1939
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1940
showTerminated
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1941
    self showError:'** the process has terminated **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1942
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1943
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1944
stepping 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1945
    ^ stepping 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1946
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1947
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1948
unstep 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1949
    stepping := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1950
    bigStep := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1951
    steppedContextAddress := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1952
    exitAction := nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1953
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1954
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1955
updateContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1956
    |oldContext idx|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1957
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1958
    inspectedProcess state == #dead ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1959
	self showTerminated.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1960
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1961
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1962
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1963
    oldContext := selectedContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1964
    (self setContext:(inspectedProcess suspendedContext)) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1965
	oldContext notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1966
	    contextArray notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1967
		idx := contextArray identityIndexOf:oldContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1968
		idx ~~ 0 ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1969
		    self showSelection:idx
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1970
		] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1971
		    codeView contents:('** context returned **')
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1972
		]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1973
	    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1974
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1975
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1976
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1977
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1978
!DebugView methodsFor:'private control loop'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1979
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1980
controlLoop
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1981
    "this is a kludge:
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1982
	start a dispatchloop which exits when
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1983
	either continue, return or step is pressed
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1984
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1985
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1986
    haveControl := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1987
    [haveControl] whileTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1988
	self controlLoopCatchingErrors
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1989
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1990
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1991
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1992
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1993
controlLoopCatchingErrors
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1994
    "this is the debuggers own private event handling loop;
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1995
     errors are cought, to prevent recursive debugger-invocations."
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  1996
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1997
    "setup a self removing catch-block"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1998
    catchBlock := [catchBlock := nil. ^ nil].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1999
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2000
    (exclusive or:[windowGroup isNil]) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2001
	"if we do not have multiple processes or its a system process
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2002
	 we start another dispatch loop, which exits when
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2003
	 either continue, return or step is pressed
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2004
	 or (via the catchBlock) if an error occurs.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2005
	 Since our display is an extra exclusive one, 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2006
	 all processing for normal views stops here ...
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2007
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2008
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2009
	WindowGroup setActiveGroup:windowGroup.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2010
	SignalSet anySignal handle:[:ex |
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2011
	    |signal|
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2012
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2013
	    signal := ex signal.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2014
	    self showError:'*** Error in modal debugger:
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2015
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2016
>>>> Signal:  ' , signal printString , '
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2017
>>>> In:      ' , ex suspendedContext printString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2018
>>>> Message: ' , ex errorString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2019
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2020
cought & ignored.'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2021
	    ex return.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2022
	] do:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2023
	    Object userNotificationSignal handle:[:ex |
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2024
		(ex signal == ActivityNotificationSignal) ifTrue:[
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2025
		    ex proceed
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2026
		].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2027
		self showError:ex errorString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2028
	    ] do:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2029
		device dispatchModalWhile:[haveControl].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2030
	    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2031
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2032
	WindowGroup setActiveGroup:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2033
    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2034
	"we do have multiple processes -
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2035
	 simply enter the DebugViews-Windowgroup event loop.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2036
	 effectively suspending event processing for the currently 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2037
	 active group.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2038
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2039
	SignalSet anySignal handle:[:ex |
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2040
	    |answer signal|
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2041
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2042
	    signal := ex signal.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2043
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2044
	    "/
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2045
	    "/ ignore recursive breakpoints
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2046
	    "/
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2047
	    signal == MessageTracer breakpointSignal ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2048
		'breakpoint in debugger ignored' errorPrintNL.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2049
		ex proceed
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2050
	    ].
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2051
	    (signal == ActivityNotificationSignal) ifTrue:[
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2052
		ex proceed
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2053
	    ].
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2054
	    signal == Exception recursiveExceptionSignal ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2055
		ex parameter signal == MessageTracer breakpointSignal ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2056
		    'recursive breakpoint in debugger ignored' errorPrintNL.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2057
		    ex proceed.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2058
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2059
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2060
		self showError:'*** Recursive error in debugger:
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2061
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2062
>>>> Signal:  ' , ex signal printString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2063
>>>> In:      ' , ex suspendedContext printString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2064
>>>> Message: ' , ex errorString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2065
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2066
cought & ignored.'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2067
		ex return
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2068
	    ].
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2069
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2070
	    self topView raiseDeiconified.    
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2071
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2072
	    answer := Dialog 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2073
			choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2074
			labels:#('debug' 'proceed' 'cancel' ) 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2075
			values:#(#debug #proceed #cancel) 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2076
			default:#cancel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2077
	    answer == #debug ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2078
		Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2079
		ex proceed.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2080
	    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2081
	    answer == #proceed ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2082
		ex proceed.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2083
	    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2084
	    ex return.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2085
	] do:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2086
	    windowGroup eventLoopWhile:[true] onLeave:[]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2087
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2088
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2089
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2090
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2091
    "Created: 24.11.1995 / 20:33:45 / cg"
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2092
    "Modified: 23.1.1996 / 17:27:59 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2093
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2094
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2095
!DebugView methodsFor:'user interaction'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2096
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2097
codeAccept:someCode
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2098
    "user wants some code to be recompiled - must unwind stack since everything above
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2099
     and including selected method cannot be continued."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2100
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2101
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2102
     actually, this is not true, since the active methods will still be
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2103
     executed correctly - however, the code shown in the debugger is no
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2104
     longer in sync (showing the new code) with the executed code.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2105
     Therefore, we hide those contexts to avoid confusion ....
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2106
     If you dont like this behavior, remove the 'inspecting ifFalse:' check below"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2107
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2108
    "walk up context chain and find highest context which is either the selected context,
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2109
     or - if its a block-context - whose home is the selected context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2110
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2111
    |con top sel implementorClass method newMethod|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2112
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2113
    codeView cursor:Cursor execute.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2114
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2115
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2116
     find the method-home context for this one
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2117
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2118
    con := selectedContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2119
    top := con.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2120
    [con notNil] whileTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2121
	(con methodHome == selectedContext) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2122
	    top := con
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2123
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2124
	con := con sender
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2125
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2126
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2127
     use class&selector to find the method for the compilation
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2128
     and compile.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2129
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2130
    sel := selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2131
    implementorClass := selectedContext methodClass.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2132
    method := implementorClass compiledMethodAt:sel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2133
    newMethod := implementorClass compilerClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2134
			 compile:someCode
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2135
			 forClass:implementorClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2136
			 inCategory:(method category)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2137
			 notifying:codeView.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2138
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2139
    inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2140
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2141
	 if it worked, remove everything up to and including top
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2142
	 from context chain
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2143
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2144
	(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2145
	    self setContext:(top sender).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2146
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2147
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2148
	     continue/step is no longer possible
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2149
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2150
	    canContinue := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2151
	    self showSelection:1.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2152
	    exitAction := #return
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2153
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2154
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2155
    codeView cursor:Cursor normal
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2156
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2157
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2158
destroy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2159
    "closing the debugger implies an abort or continue"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2160
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2161
    contextView middleButtonMenu hide.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2162
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2163
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2164
     we manually release all private data, since the Debugger
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2165
     is cached for reuse - thus the memory would not be collectable
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2166
     otherwise.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2167
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2168
    codeView acceptAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2169
    codeView doItAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2170
    codeView contents:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2171
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2172
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2173
    receiverInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2174
    contextInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2175
    inspectedProcess := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2176
    exitAction := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2177
    contextArray := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2178
    selectedContext := actualContext := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2179
    grabber := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2180
    self autoUpdateOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2181
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2182
    inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2183
	exclusive ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2184
	    CachedExclusive == self ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2185
		CachedExclusive := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2186
	    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2187
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2188
	    CachedDebugger == self ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2189
		CachedDebugger := nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2190
	    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2191
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2192
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2193
	inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2194
	    canAbort ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2195
		self doAbort.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2196
	    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2197
		self doContinue
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2198
	    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2199
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2200
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2201
    super destroy    "/ 1.12.94
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2202
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2203
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2204
showSelection:lineNr
301
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2205
    "user clicked on a header line - show selected code in textView.
303
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
  2206
     Also sent to autoselect an interesting context on entry."
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2207
56
d0cb937cbcaa *** empty log message ***
claus
parents: 55
diff changeset
  2208
    |con homeContext sel method code canAccept
105
claus
parents: 101
diff changeset
  2209
     implementorClass lineNrInMethod rec m line
193
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2210
     sender selSender tryVars possibleBlocks errMsg 
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2211
     mthd cls w|
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2212
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2213
    contextArray notNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2214
	lineNr <= contextArray size ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2215
	    con := contextArray at:lineNr.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2216
	].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2217
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2218
	 clicking on the '** ...'-line shows more ...
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2219
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2220
	con isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2221
	    line := contextView list at:lineNr.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2222
	    (line startsWith:'**') ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2223
		self showMore.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2224
		contextView selection:lineNr.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2225
		con := contextArray at:lineNr
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2226
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2227
	    con isNil ifTrue:[^ self].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2228
	].
105
claus
parents: 101
diff changeset
  2229
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2230
	self withWaitCursorDo:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2231
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2232
	     give it to the (lower right) inspector
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2233
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2234
	    contextInspector inspect:con.
105
claus
parents: 101
diff changeset
  2235
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2236
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2237
	     get the home context
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2238
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2239
	    con isBlockContext ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2240
		homeContext := con methodHome
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2241
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2242
		homeContext := con
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2243
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2244
	    con canReturn ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2245
		returnButton enable. restartButton enable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2246
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2247
		returnButton disable. restartButton disable.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2248
	    ].
105
claus
parents: 101
diff changeset
  2249
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2250
	    lineNrInMethod := con lineNumber.
105
claus
parents: 101
diff changeset
  2251
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2252
	    canAccept := false.
105
claus
parents: 101
diff changeset
  2253
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2254
	    homeContext isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2255
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2256
		 mhmh - an optimized block
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2257
		 should get the block here, and get the method from
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2258
		 that one ...
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2259
		 But in 2.10.x, there is no easy way to get to the block
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2260
		 since that one is not in the context.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2261
		 Starting with 2.11, the new block calling scheme will fix this.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2262
		"
105
claus
parents: 101
diff changeset
  2263
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2264
		"temporary kludge - peek into the sender context.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2265
		 If its a do-like method and there is a single block variable 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2266
		 in the args or temporaries, that must be the one.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2267
		 This helps in some cases.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2268
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2269
		(sender := con sender) notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2270
		    tryVars := false.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2271
		    (selSender := sender selector) notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2272
			(selSender endsWith:'do:') ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2273
			    tryVars := true.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2274
			] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2275
			    (selSender endsWith:'Do:') ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2276
				tryVars := true.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2277
			    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2278
			]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2279
		    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2280
		    tryVars ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2281
			possibleBlocks := sender argsAndVars select:[:v | v isBlock].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2282
			possibleBlocks := possibleBlocks select:[:b | b home isNil].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2283
			possibleBlocks size == 1 ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2284
			    method := possibleBlocks first method.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2285
			].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2286
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2287
		].
105
claus
parents: 101
diff changeset
  2288
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2289
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2290
		"fetch rec here - so we wont need context in doItAction"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2291
		rec := homeContext receiver.
105
claus
parents: 101
diff changeset
  2292
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2293
		sel := homeContext selector.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2294
		sel notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2295
		    canAccept := true.
56
d0cb937cbcaa *** empty log message ***
claus
parents: 55
diff changeset
  2296
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2297
		    implementorClass := homeContext methodClass.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2298
		    implementorClass isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2299
			"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2300
			 special: look if this context was created by
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2301
			 valueWithReceiver kind of method invocation;
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2302
			 if so, grab the method from the sender and show it
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2303
			"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2304
			((sender := con sender) notNil
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2305
			and:[(sender selector startsWith:'valueWithReceiver:')
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2306
			and:[sender receiver isMethod]]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2307
			    method := sender receiver.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2308
			    code := method source.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2309
			    canAccept := false.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2310
			] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2311
			    (method := con method) notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2312
				code := method source.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2313
				canAccept := false.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2314
			    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2315
			]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2316
		    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2317
			method := implementorClass compiledMethodAt:sel.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2318
		    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2319
		]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2320
	    ].
105
claus
parents: 101
diff changeset
  2321
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2322
	    code isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2323
		errMsg := nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2324
		method notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2325
		    code := method source.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2326
		    code isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2327
			method sourceFilename notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2328
			    codeView contents:(resources 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2329
						       string:'** no sourcefile: %1 **'
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2330
						       with:method sourceFilename).
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2331
			    codeView flash
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2332
			] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2333
			    errMsg := '** no source **'
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2334
			]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2335
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2336
		] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2337
		    homeContext isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2338
			errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2339
		    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2340
			errMsg := '** no method - no source **'
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2341
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2342
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2343
		errMsg notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2344
		   self showError:errMsg
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2345
		]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2346
	    ].
105
claus
parents: 101
diff changeset
  2347
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2348
	    code isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2349
		canAccept := false.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2350
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2351
		codeView contents:code.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2352
		(lineNrInMethod notNil and:[lineNrInMethod ~~ 0]) ifTrue:[
301
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2353
"/                    lineNrInMethod > codeView list size ifTrue:[
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2354
"/                        lineNrInMethod := codeView list size + 1
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2355
"/                    ].
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2356
"/                    codeView selectLine:lineNrInMethod.
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2357
"/                    codeView makeSelectionVisible
132
claus
parents: 127
diff changeset
  2358
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2359
		    lineNrInMethod <= codeView list size ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2360
			(lineNrInMethod == 255 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2361
			and:[method notNil
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2362
			and:[method code isNil]]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2363
			    "/ means: do not really know in interpreted methods
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2364
			    codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2365
			] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2366
			    codeView selectLine:lineNrInMethod.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2367
			].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2368
			codeView makeSelectionVisible
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2369
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2370
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2371
	    ].
105
claus
parents: 101
diff changeset
  2372
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2373
	    canAccept ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2374
		codeView acceptAction:[:code | self codeAccept:code asString]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2375
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2376
		codeView acceptAction:nil.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2377
	    ].
105
claus
parents: 101
diff changeset
  2378
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2379
	    receiverInspector inspect:rec.
105
claus
parents: 101
diff changeset
  2380
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2381
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2382
	     the one below is wrong: currently, the
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2383
	     evaluator cannot handle passed contexts.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2384
	     Once it does, pass con as in:-arg
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2385
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2386
	    codeView doItAction:[:theCode |
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2387
			     rec class evaluatorClass 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2388
				 evaluate:theCode 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2389
				 in:nil            "/ *** con
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2390
				 receiver:rec 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2391
				 notifying:codeView 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2392
				 logged:true 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2393
				 ifFail:nil 
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2394
	    ].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2395
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2396
	    selectedContext := homeContext.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2397
	    actualContext := con
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2398
	].
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2399
    ].
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2400
105
claus
parents: 101
diff changeset
  2401
    "clear out locals to prevent keeping around unneeded contexts 
claus
parents: 101
diff changeset
  2402
     (due to the block held in codeView).
claus
parents: 101
diff changeset
  2403
     (not really needed, since stuff gets collected away sooner or later ...
claus
parents: 101
diff changeset
  2404
      ... but this makes it a bit sooner)
claus
parents: 101
diff changeset
  2405
    "
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2406
    con := nil.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2407
    homeContext := nil.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2408
105
claus
parents: 101
diff changeset
  2409
    "
claus
parents: 101
diff changeset
  2410
     enable/disable some menu items
claus
parents: 101
diff changeset
  2411
    "
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2412
    m := contextView middleButtonMenu.
193
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2413
    (m notNil and:[selectedContext notNil]) ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2414
	m enableAll:#(implementors senders inspectContext skip skipForReturn).
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2415
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2416
	(method notNil and:[method isWrapped]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2417
	    m enable:#removeBreakpoint.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2418
	] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2419
	    m disable:#removeBreakpoint.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2420
	].
193
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2421
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2422
	mthd := selectedContext method.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2423
	mthd notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2424
	    w := mthd who.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2425
	].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2426
	m enable:#browseClass.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2427
	w notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2428
	    cls := w at:1
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2429
	].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2430
	cls notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2431
	    m enableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol).
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2432
	] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2433
	    m disableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol).
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2434
	].
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2435
    ]
193
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2436
301
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2437
    "Modified: 14.12.1995 / 21:26:02 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
  2438
! !
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
  2439
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2440
!DebugView class methodsFor:'documentation'!
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
  2441
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2442
version
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
  2443
    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.67 1996-02-20 20:42:45 cg Exp $'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2444
! !