DebugView.st
author Claus Gittinger <cg@exept.de>
Tue, 22 Oct 1996 16:07:44 +0200
changeset 789 a9595b71a8fa
parent 788 26d452e40e52
child 790 6a166894d5e1
permissions -rw-r--r--
improved next-stepping in blocks
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
646
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    21
		steppedContextLineno stepForReturn actualContext inWrap
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
    22
		stackInspector steppedContext wrapperContext'
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    23
	classVariableNames:'CachedDebugger CachedExclusive OpenDebuggers MoreDebuggingDetail
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
    24
		DebuggingDebugger'
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    25
	poolDictionaries:''
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
    26
	category:'Interface-Debugger'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    27
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    28
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
    29
!DebugView class methodsFor:'documentation'!
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    30
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    31
copyright
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    32
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    33
 COPYRIGHT (c) 1989 by Claus Gittinger
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
    34
	      All Rights Reserved
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    35
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    36
 This software is furnished under a license and may be used
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    37
 only in accordance with the terms of that license and with the
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    38
 inclusion of the above copyright notice.   This software may not
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    39
 be provided or otherwise made available to, or used by, any
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    40
 other person.  No title to or ownership of the software is
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    41
 hereby transferred.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    42
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    43
!
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    44
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    45
documentation
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    46
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    47
    this class implements a graphical debugger interface.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    48
    The debugger usually sits on top of the faulting process,
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    49
    taking over its event processing. Thus only the 'stopped' process is affected;
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    50
    other processes continue to respond to events.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    51
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    52
    The one exception is when an error occurs within the dispatcher process
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    53
    or in one of the eventhandler processes - in this case, the debugger
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    54
    will sit on an exclusive display connection.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    55
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    56
    The whole debugging will be changed, once the required process primitives
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    57
    are available, which allow control of another processes execution
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    58
    (i.e. single-step, restart & return). The setup will be changed then,
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    59
    to have the debugger control the debuggee (i.e. two processes)
35
cd5cb075fd6a *** empty log message ***
claus
parents: 29
diff changeset
    60
cd5cb075fd6a *** empty log message ***
claus
parents: 29
diff changeset
    61
    See additional information in 'doc/misc/debugger.doc'.
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    62
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    63
    Notice: the DebugView class caches the last used debugger in a class
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    64
    variable. It may happen, that a malfunctioning debugger (for example,
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    65
    a halfway destoyed one) is kept there. You will notice this, if a
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    66
    debugger comes up without showing any contents. In this case, close
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    67
    (or destroy) the broken debugView, and execute
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    68
        Debugger newDebugger
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    69
    which removes the cached debugger and forces creation of a new one the
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    70
    next time. This is a temporary workaround - the debugger will be fixed to
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
    71
    avoid this problem.
508
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    72
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    73
    [author:]
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    74
        Claus Gittinger
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    75
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    76
    [see also:]
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    77
        Exception Signal
8d2ab732fca5 documentation
Claus Gittinger <cg@exept.de>
parents: 494
diff changeset
    78
        Process
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    79
"
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
    80
! !
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    81
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
    82
!DebugView class methodsFor:'initialization'!
243
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    83
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    84
reinitialize
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    85
    self newDebugger
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    86
! !
4cdc71d87dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 212
diff changeset
    87
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
    88
!DebugView class methodsFor:'instance creation'!
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    89
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    90
enter
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    91
    "another way of entering the debugger"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    92
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    93
    ^ self enter:(thisContext sender) withMessage:'Debugger'
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    94
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    95
    "Debugger enter"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    96
!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
    97
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    98
enter:aContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    99
    "enter the debugger on aContext"
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   100
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   101
    ^ self enter:aContext withMessage:'Debugger'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   102
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
   103
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   104
enter:aContext withMessage:aString
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   105
    "enter a debugger; if this is a recursive invocation, enter
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   106
     a MiniDebugger instead.
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   107
     This is the standard way of entering the debugger;
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   108
     sent from error- and halt messages."
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   109
745
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   110
    |active found c|
93
claus
parents: 92
diff changeset
   111
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   112
    StepInterruptPending := nil.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   113
62
8ee283ae48b2 *** empty log message ***
claus
parents: 61
diff changeset
   114
    thisContext isRecursive ifTrue:[
745
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   115
        "/ care for the special case, were the Debugger was autoloaded.
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   116
        "/ in this case, thisContext IS recursive, but thats no error
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   117
        "/ condition.
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   118
        found := false.
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   119
        c := thisContext sender.
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   120
        [found not
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   121
         and:[c notNil 
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   122
         and:[c selector ~~ #enter:withMessage:]]] whileTrue:[
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   123
            c selector == #noByteCode ifTrue:[
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   124
                found := true
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   125
            ].
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   126
            c := c sender
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   127
        ].
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   128
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   129
        found ifFalse:[
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   130
            ('DEBUGGER: reentered with: ', aString) errorPrintNL.
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   131
            ^ MiniDebugger enterWithMessage:'DEBUGGER: recursive error'.
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   132
        ]
62
8ee283ae48b2 *** empty log message ***
claus
parents: 61
diff changeset
   133
    ].
8ee283ae48b2 *** empty log message ***
claus
parents: 61
diff changeset
   134
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   135
    "
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   136
     well, it could be a stepping or sending debugger up there;
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   137
     in this case, return to it. This happens, when a stepping process
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   138
     runs into an error (for example, a halt). In this case, we want the
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   139
     stepping debugger to come up again instead of a new one.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   140
    "
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   141
    OpenDebuggers notNil ifTrue:[
526
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   142
        active := Processor activeProcess.
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   143
        OpenDebuggers do:[:aDebugger |
775
f741dc4afe19 changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
   144
            (aDebugger notNil and:[aDebugger ~~ 0]) ifTrue:[
526
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   145
                (aDebugger inspectedProcess == active) ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   146
"/ 'entering stepping debugger again' printNL.
526
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   147
                    aDebugger unstep.
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   148
                    aDebugger setLabelFor:aString in:active.
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   149
                    ^ aDebugger enter:aContext.
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   150
                ]
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   151
            ]
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   152
        ]
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   153
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
   154
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   155
    ^ self enterUnconditional:aContext withMessage:aString
526
8be290d825d6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 508
diff changeset
   156
745
89a242c66cda handle autoloaded debugger case
Claus Gittinger <cg@exept.de>
parents: 687
diff changeset
   157
    "Modified: 4.10.1996 / 10:21:20 / cg"
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   158
!
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   159
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   160
enterUnconditional:aContext withMessage:aString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   161
    "enter a debugger - do not check for recursive invocation"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   162
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   163
    |aDebugger|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   164
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   165
    StepInterruptPending := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   166
    aDebugger := self new.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   167
    aDebugger setLabelFor:aString in:Processor activeProcess.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   168
    aDebugger enter:aContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   169
    ^ nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   170
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   171
    "nil halt"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   172
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   173
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   174
enterWithMessage:aString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   175
    "the standard way of entering the debugger - sent from Objects
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   176
     error- and halt messages"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   177
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   178
    ^ self enter:(thisContext sender) withMessage:aString
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   179
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   180
    "Debugger enterWithMessage:'hi there'"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   181
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   182
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   183
new
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   184
    "return a new DebugView - return a cached debugger if it already
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   185
     exists"
53
2fc78a0165e7 *** empty log message ***
claus
parents: 52
diff changeset
   186
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   187
    |debugger|
14
e07eee5d93ca *** empty log message ***
claus
parents: 13
diff changeset
   188
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   189
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   190
     need a blocking debugger if no processes or 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   191
     or if its a timing/interrupt process 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   192
     (because otherwise we would not get any events here ...
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   193
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   194
    Processor activeProcessIsSystemProcess ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   195
	CachedExclusive isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   196
	    debugger := self newExclusive
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   197
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   198
	    debugger := CachedExclusive.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   199
	    CachedExclusive := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   200
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   201
    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   202
	CachedDebugger isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   203
	    debugger := super new.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   204
	    debugger label:'Debugger'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   205
	    debugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   206
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   207
	    debugger := CachedDebugger.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   208
	    CachedDebugger := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   209
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   210
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   211
    ^ debugger
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   212
!
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   213
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   214
newExclusive
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   215
    "return a debugger for exclusive display access"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   216
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   217
    |debugger|
105
claus
parents: 101
diff changeset
   218
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   219
    debugger := super new.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   220
    debugger label:'Debugger'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   221
    debugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   222
    debugger exclusive:true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   223
    ^ debugger
105
claus
parents: 101
diff changeset
   224
!
claus
parents: 101
diff changeset
   225
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   226
openOn:aProcess
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   227
    "start a  debugger on aProcess
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   228
     (actually not more than a good-looking inspector)"
15
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   229
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   230
    |aDebugger label nm|
15
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   231
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   232
    aDebugger := super new.
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   233
    aDebugger icon:(Form fromFile:'Debugger.xbm' resolution:100).
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   234
    aProcess notNil ifTrue:[
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   235
	nm := aProcess name.
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   236
	nm notNil ifTrue:[
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   237
	    nm := (nm contractTo:17) , '-' , aProcess id printString
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   238
	] ifFalse:[
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   239
	    nm := aProcess id printString
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   240
	].
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
   241
	label := 'Debugger [' , nm , ']'.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   242
    ] ifFalse:[
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
   243
	label := 'no process'
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   244
    ].
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
   245
    aDebugger label:label.
15
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   246
    aDebugger iconLabel:'Debugger'.
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   247
    aDebugger openOn:aProcess.
7fc8fcef7bc6 *** empty log message ***
claus
parents: 14
diff changeset
   248
    ^ nil
126
claus
parents: 124
diff changeset
   249
! !
claus
parents: 124
diff changeset
   250
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   251
!DebugView class methodsFor:'cleanup'!
485
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   252
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   253
lowSpaceCleanup 
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   254
    "in low memory situations, give up cached debuggers"
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   255
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   256
    CachedDebugger := nil.
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   257
    CachedExclusive := nil.
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   258
    OpenDebuggers := nil.
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   259
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   260
    "
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   261
     DebugView lowSpaceCleanup
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   262
    "
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   263
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   264
    "Modified: 18.4.1996 / 16:48:03 / cg"
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   265
!
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   266
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   267
newDebugger
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   268
    "force creation of a new debugger"
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   269
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   270
    CachedDebugger := nil.
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   271
    CachedExclusive := nil.
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   272
    OpenDebuggers := nil.
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   273
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   274
    "
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   275
     DebugView newDebugger
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   276
    "
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   277
! !
e9a0636c4fca category rename
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   278
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   279
!DebugView methodsFor:'basic'!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   280
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   281
enter
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   282
    "enter the debugger - on the sending context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   283
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   284
    |where|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   285
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   286
    busy := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   287
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   288
    where := thisContext.      "enter"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   289
    where := where sender.     "the calling context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   290
    where notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   291
	(where receiver == DebugView) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   292
	    where := where sender
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   293
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   294
	"where is now interrupted methods context"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   295
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   296
    ^ self enter:where
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   297
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   298
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   299
enter:aContext
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   300
    "enter the debugger - get and display the context, then start an
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   301
     exclusive event loop on top of eveything else"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   302
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   303
    |con selection m idx retval enteredByInterrupt sel|
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   304
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   305
    busy := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   306
    inspecting := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   307
    inspectedProcess := Processor activeProcess.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   308
    stepping := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   309
    bigStep := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   310
    nChainShown := 50.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   311
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   312
    "if debugger is entered while a box has grabbed the
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   313
     pointer, we must ungrab - otherwise X wont talk to
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   314
     us here
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   315
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   316
    (grabber := device activePointerGrab) notNil ifTrue:[
425
92f7a92f5c44 ungrab keyboard when entering debugger
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
   317
        device ungrabPointer.
92f7a92f5c44 ungrab keyboard when entering debugger
Claus Gittinger <cg@exept.de>
parents: 407
diff changeset
   318
        device ungrabKeyboard.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   319
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   320
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   321
    (inspectedProcess suspendedContext isNil 
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   322
    or:[Processor isSystemProcess:inspectedProcess]) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   323
        terminateButton disable.
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   324
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   325
        terminateButton enable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   326
        abortButton enable.
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   327
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   328
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   329
    drawableId notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   330
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   331
         not the first time - disable buttons & menus
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   332
         from previous life
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   333
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   334
        terminateButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   335
        continueButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   336
        returnButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   337
        restartButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   338
        abortButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   339
        nextButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   340
        stepButton turnOffWithoutRedraw.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   341
        sendButton turnOffWithoutRedraw.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   342
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   343
        m := contextView middleButtonMenu.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   344
        m notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   345
            m disableAll:#(showMore skip skipForoReturn inspectContext).
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   346
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   347
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   348
        self iconLabel:'Debugger'.
132
claus
parents: 127
diff changeset
   349
    ].
claus
parents: 127
diff changeset
   350
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   351
    windowGroup isNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   352
        windowGroup := WindowGroup new.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   353
        windowGroup addTopView:self.
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   354
    ].
132
claus
parents: 127
diff changeset
   355
    exclusive ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   356
        "/ create a (modal) windowGroup for myself
132
claus
parents: 127
diff changeset
   357
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   358
        windowGroup setModal:true.
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   359
    ] ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   360
        "/ 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
   361
579
d461478b2ac2 device is not needed in SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 563
diff changeset
   362
        windowGroup sensor:(SynchronousWindowSensor new).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   363
    ].
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   364
    windowGroup setProcess:Processor activeProcess.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   365
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   366
    "
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   367
     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
   368
    "
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   369
    self setContext:aContext releaseInspectors:(exitAction ~~ #step).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   370
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   371
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   372
     and find the one context to show initially
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   373
     - if we came here by a send (single step), its the top context;
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   374
     - if we came here by a step (i.e. bigStep), its the top context
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   375
       (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
   376
     - otherwise, we came here by some signal raise, and we are interested
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   377
       in the context where the raise actually occured.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   378
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   379
    exitAction == #step ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   380
        selection := 1.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   381
        steppedContext notNil ifTrue:[
374
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
             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
   384
            "
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   385
            aContext == steppedContext ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   386
                selection := 1
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   387
            ] ifFalse:[
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   388
                aContext sender == steppedContext ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   389
                    selection := 2
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   390
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   391
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   392
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   393
             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
   394
            "
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   395
            (aContext home notNil 
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   396
             and:[aContext home == steppedContext]) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   397
                selection := 1
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   398
            ] ifFalse:[
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   399
                (aContext sender home notNil 
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   400
                and:[aContext sender home == steppedContext]) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   401
                    selection := 2
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   402
                ]
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
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   405
    ] ifFalse:[
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   406
        steppedContext isNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   407
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   408
             preselect a more interesting context, (where halt/raise was ...)
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   409
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   410
            selection := self interestingContextFrom:aContext.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   411
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   412
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   413
             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
   414
            "
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   415
            aContext == steppedContext ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   416
                selection := 1
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   417
            ] ifFalse:[
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   418
                aContext sender == steppedContext ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   419
                    selection := 2
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   420
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   421
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   422
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   423
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   424
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   425
    selection notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   426
        self showSelection:selection.
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
   427
        contextView setSelection:selection.
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   428
        selection > 1 ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   429
            contextView scrollToLine:(selection - 1)
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   430
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   431
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   432
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   433
    m := contextView middleButtonMenu.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   434
    m notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   435
        canAbort := inspecting or:[Object abortSignal isHandled].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   436
        canAbort ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   437
            abortButton enable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   438
            m enable:#doAbort.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   439
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   440
            abortButton disable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   441
            m disable:#doAbort.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   442
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   443
        exclusive ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   444
            terminateButton disable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   445
            m disable:#doTerminate.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   446
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   447
            terminateButton enable.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   448
            m enable:#doTerminate.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   449
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   450
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   451
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   452
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   453
     drawableId is nil, if this is a new debugger. Then do a realize.
528
a5ba1a3d0b45 Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents: 527
diff changeset
   454
     Otherwise, its probably better to do a map, which shows the
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   455
     view at the previous position, without a need for the user to set the
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   456
     position again
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   457
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   458
    drawableId notNil ifTrue:[
545
99d0cac830ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   459
        self remap.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   460
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   461
        self realize.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   462
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   463
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   464
    exclusive ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   465
        self showError:'
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   466
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
   467
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   468
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
   469
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
   470
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
   471
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   472
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
   473
    ].
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   474
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   475
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   476
     bring us to the top
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   477
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   478
    self raise.
105
claus
parents: 101
diff changeset
   479
    device flush.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   480
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   481
    canContinue := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   482
    exitAction := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   483
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   484
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   485
     enter private event handling loop. This is left (and we come back here again)
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   486
     when any button was pressed which requires continuation of the debuggee or
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   487
     closedown of the debugger.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   488
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   489
132
claus
parents: 127
diff changeset
   490
    [self controlLoop] valueOnUnwindDo:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   491
        windowGroup notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   492
            windowGroup setProcess:nil.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   493
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   494
        self destroy
132
claus
parents: 127
diff changeset
   495
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   496
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   497
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   498
     release all context stuff.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   499
     This is required to avoid keeping references to the debuggees objects
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   500
     forever. (since the debugger is reused for faster startup next time)
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   501
    "
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   502
    contextArray := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   503
    codeView acceptAction:nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   504
    contextView contents:nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   505
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   506
    (exitAction ~~ #step) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   507
        receiverInspector release.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   508
        contextInspector release.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
   509
528
a5ba1a3d0b45 Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents: 527
diff changeset
   510
        self unmap.
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   511
        device flush.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   512
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   513
        (exitAction == #abort) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   514
            self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   515
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   516
             have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   517
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   518
            ErrorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   519
                'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   520
                ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   521
                ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   522
            ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   523
                Object abortSignal raise.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   524
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   525
            'abort failed' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   526
        ].
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   527
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   528
        (exitAction == #return) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   529
            selectedContext notNil ifTrue:[
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
                 if there is a selection in the codeView,
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   532
                 evaluate it and use the result as return value
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   533
                "
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   534
"/ disabled for now, there is almost always a selection (the current line)
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   535
"/ and that is syntactically incorrect ...
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   536
"/ ... leading to a popup warning from the codeView
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   537
"/
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   538
"/                codeView hasSelection ifTrue:[
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   539
"/                    Object errorSignal handle:[:ex |
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   540
"/                        'DEBUGGER: error - returning nil' printNL.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   541
"/                        retval := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   542
"/                        ex return
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   543
"/                    ] do:[
687
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   544
"/                        |s|
657
aa1816733b59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   545
"/
aa1816733b59 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   546
"/                        s := codeView selection asString.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   547
"/                        retval := codeView doItAction value:s.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   548
"/                    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   549
"/                ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   550
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   551
                con := selectedContext.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   552
                self cacheMyself.
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
                 have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   555
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   556
                Object errorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   557
                    'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   558
                    ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   559
                    ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   560
                ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   561
                    con unwind:retval.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   562
                ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   563
                'cannot return from selected context' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   564
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   565
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   566
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   567
        (exitAction == #restart) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   568
            selectedContext notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   569
                con := selectedContext.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   570
                self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   571
                "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   572
                 have to catch errors occuring in unwind-blocks
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
                Object errorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   575
                    'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   576
                    ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   577
                    ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   578
                ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   579
                    con unwindAndRestart.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   580
                ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   581
                'cannot restart selected context' errorPrintNL
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   582
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   583
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   584
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   585
        (exitAction == #quickTerminate) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   586
            self cacheMyself.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   587
            Processor activeProcess terminateNoSignal
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   588
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   589
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   590
        (exitAction == #terminate) ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   591
            self cacheMyself.
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
             have to catch errors occuring in unwind-blocks
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   594
            "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   595
            Object errorSignal handle:[:ex |
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   596
                'ignored error while unwinding: ' errorPrint.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   597
                ex errorString errorPrintNL.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   598
                ex proceed
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   599
            ] do:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   600
                Processor activeProcess terminate.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   601
            ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   602
            'cannot terminate process' errorPrintNL
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
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   605
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   606
    selectedContext := actualContext := nil.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   607
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   608
    grabber notNil ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   609
        device grabPointerInView:grabber.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   610
        grabber := nil.
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   611
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   612
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   613
    (exitAction == #step) ifTrue:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   614
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   615
         schedule another stepInterrupt
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   616
         - must enter myself into the collection of open debuggers,
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   617
           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
   618
           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
   619
           come up (instead of a new one)
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   620
         - must flush caches since optimized methods not always
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   621
           look for pending interrupts
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   622
        "
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   623
        OpenDebuggers isNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   624
            OpenDebuggers := WeakArray with:self
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   625
        ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   626
            (OpenDebuggers includes:self) ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   627
                idx := OpenDebuggers identityIndexOf:nil.
775
f741dc4afe19 changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
   628
                idx == 0 ifTrue:[
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   629
                    idx := OpenDebuggers identityIndexOf:0
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   630
                ].
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   631
                idx ~~ 0 ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   632
                    OpenDebuggers at:idx put:self
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   633
                ] ifFalse:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   634
                    OpenDebuggers := OpenDebuggers copyWith:self
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   635
                ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   636
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   637
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   638
        self label:'single stepping - please wait ...'.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   639
        stepping := true.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   640
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   641
        ObjectMemory stepInterruptHandler:self.
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   642
        Context singleStepInterruptRequest isHandled ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   643
            "bigStep" steppedContextLineno notNil ifTrue:[   
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   644
                Context singleStepInterruptRequest raiseWith:#next
529
57a78164dae5 allow different implementations of singleStep (JAVA support)
Claus Gittinger <cg@exept.de>
parents: 528
diff changeset
   645
            ] ifFalse:[
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   646
                Context singleStepInterruptRequest raiseWith:#step
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   647
            ]
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   648
        ] ifFalse:[
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   649
            "/ see if we came here through an interrupt-action
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   650
            "/ (i.e. aProcess interruptWith:...)
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   651
        
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   652
            enteredByInterrupt := false.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   653
            con := thisContext sender.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   654
            [enteredByInterrupt not
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   655
             and:[con notNil 
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   656
             and:[con ~~ aContext]]] whileTrue:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   657
                ((sel := con selector) == #timerInterrupt
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   658
                or:[sel == #ioInterrupt]) ifTrue:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   659
                    enteredByInterrupt := true.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   660
                ] ifFalse:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   661
                    con := con sender
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   662
                ].
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   663
            ].
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   664
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   665
            ObjectMemory flushInlineCaches.
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   666
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   667
            enteredByInterrupt ifTrue:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   668
                "/ dont want to step through all intermediate
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   669
                "/ (scheduler-) contexts; place a return-trap on the
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   670
                "/ one right below the interresting one
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   671
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   672
"/                'special unwind return' printCR.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   673
                con unwindThenDo:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   674
                                  ObjectMemory stepInterruptHandler:self.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   675
                                  InStepInterrupt := nil.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   676
                                  StepInterruptPending := 1.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   677
                                  InterruptPending := 1].
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   678
            ] ifFalse:[
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   679
"/                'normal step return' printCR.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   680
                skipLineNr ~~ #return ifTrue:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   681
                    StepInterruptPending := 1.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   682
                    InterruptPending := 1.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   683
                ] ifFalse:[
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   684
"/                    'step for return' printCR.
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
   685
                ]
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   686
            ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
   687
            InStepInterrupt := nil
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   688
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   689
    ] ifFalse:[
374
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   690
        OpenDebuggers notNil ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   691
            idx := OpenDebuggers identityIndexOf:self.
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   692
            idx ~~ 0 ifTrue:[
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   693
                OpenDebuggers at:idx put:nil
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   694
            ]
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   695
        ].
1b9bc0f019c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   696
        self cacheMyself.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   697
    ]
210
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   698
947f9a23b06a better error handling in modal debugger - use new SynchronousWindowSensor
Claus Gittinger <cg@exept.de>
parents: 193
diff changeset
   699
    "Created: 24.11.1995 / 19:52:54 / cg"
528
a5ba1a3d0b45 Rename unrealize-->unmap, rerealize-->map.
Stefan Vogel <sv@exept.de>
parents: 527
diff changeset
   700
    "Modified: 3.5.1996 / 23:58:16 / stefan"
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
   701
    "Modified: 22.10.1996 / 15:06:23 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   702
!
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   703
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   704
openOn:aProcess
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   705
    "enter the debugger on a process - 
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   706
     in this case, we are just inspecting the context chain of the process,
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   707
     not running on top of the debugged process, but as a separate
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   708
     one. (think of it as an inspector showing more detail, and offering
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   709
     some more control operations)"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   710
127
claus
parents: 126
diff changeset
   711
    |bpanel dummy|
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   712
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   713
    busy := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   714
    bigStep := false.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   715
    inspecting := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   716
    inspectedProcess := aProcess.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   717
    nChainShown := 50.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   718
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   719
    bpanel := abortButton superView.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   720
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   721
"/    stopButton := Button new.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   722
"/    stopButton label:(resources at:'stop');
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   723
"/               action:[self doStop].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   724
"/    bpanel addSubView:stopButton after:continueButton.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   725
"/
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   726
    bpanel elementsChangeSize:true.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   727
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   728
    aProcess state == #run ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   729
        device hasColors ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   730
            continueButton foregroundColor:Color red darkened.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   731
        ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   732
        continueButton label:(resources at:'stop').
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   733
        continueButton action:[self doStop].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   734
        returnButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   735
        restartButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   736
    ] ifFalse:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   737
        device hasColors ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   738
            continueButton foregroundColor:Color green darkened darkened.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   739
        ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   740
        continueButton label:(resources at:'continue').
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   741
        continueButton action:[self doContinue].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   742
        returnButton enable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   743
        restartButton enable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   744
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   745
92
claus
parents: 90
diff changeset
   746
    dummy := View extent:(10 @ 5) in:bpanel.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   747
    dummy borderWidth:0; level:0.
61
cb5e3560bd82 *** empty log message ***
claus
parents: 58
diff changeset
   748
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   749
"/    stepButton destroy.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   750
"/    sendButton destroy.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   751
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   752
    updateButton := Button
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   753
                        label:(resources at:'update')
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   754
                        action:[self updateContext]
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   755
                        in:bpanel.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   756
    monitorToggle := Toggle in:bpanel.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   757
    monitorToggle label:(resources at:'monitor').
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   758
    monitorToggle pressAction:[self autoUpdateOn].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   759
    monitorToggle releaseAction:[self autoUpdateOff].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   760
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   761
    "can only look into process - context chain is not active"
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   762
    canContinue := true.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   763
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   764
    terminateButton enable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   765
    abortButton enable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   766
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   767
    sendButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   768
    stepButton disable.
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
   769
    nextButton disable.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   770
"/    continueButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   771
"/    returnButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   772
"/    restartButton disable.
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   773
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   774
    aProcess isNil ifTrue:[
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   775
        terminateButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   776
        abortButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   777
        continueButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   778
        returnButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   779
        restartButton disable.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   780
    ] ifFalse:[
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   781
        (aProcess suspendedContext isNil 
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   782
        or:[Processor isSystemProcess:aProcess]) ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   783
            terminateButton disable.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   784
        ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   785
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   786
        self setContextSkippingInterruptContexts:aProcess suspendedContext.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   787
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   788
        catchBlock := [
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   789
            catchBlock := nil.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   790
            contextArray := nil.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   791
            selectedContext := actualContext := nil.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
   792
            steppedContext := wrapperContext := nil.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
   793
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   794
            (exitAction == #terminate) ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   795
                aProcess terminate.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   796
            ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   797
            (exitAction == #quickTerminate) ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   798
                aProcess terminateNoSignal.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   799
            ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   800
            super destroy
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   801
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   802
    ].
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   803
    self open
316
7d529dfe8a99 disable abort & terminate for system processes
Claus Gittinger <cg@exept.de>
parents: 303
diff changeset
   804
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
   805
    "Modified: 22.10.1996 / 11:58:53 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   806
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   807
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   808
!DebugView methodsFor:'help'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   809
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   810
helpTextFor:aComponent
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   811
    |s|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   812
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   813
    aComponent == abortButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   814
        s := 'HELP_ABORT'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   815
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   816
    aComponent == terminateButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   817
        s := 'HELP_TERMINATE'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   818
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   819
    aComponent == continueButton ifTrue:[
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   820
        continueButton label = (resources string:'stop') ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   821
            s := 'HELP_STOP'
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   822
        ] ifFalse:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   823
            s := 'HELP_CONTINUE'
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   824
        ]
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   825
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   826
    aComponent == stepButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   827
        s := 'HELP_STEP'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   828
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   829
    aComponent == nextButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   830
        s := 'HELP_NEXT'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   831
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   832
    aComponent == stepButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   833
        s := 'HELP_STEP'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   834
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   835
    aComponent == sendButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   836
        s := 'HELP_SEND'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   837
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   838
    aComponent == returnButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   839
        s := 'HELP_RETURN'
266
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
    aComponent == restartButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   842
        s := 'HELP_RESTART'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   843
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   844
    aComponent == contextView ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   845
        s := 'HELP_WALKBACK'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   846
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   847
    aComponent == codeView ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   848
        s := 'HELP_CODEVIEW'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   849
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   850
    aComponent == monitorToggle ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   851
        s := 'HELP_MONITOR'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   852
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   853
    aComponent == updateButton ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   854
        s := 'HELP_UPDATE'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   855
    ].
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   856
"/    aComponent == stopButton ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   857
"/        s := 'HELP_STOP'
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   858
"/    ].
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   859
    (aComponent isComponentOf:receiverInspector) ifTrue:[
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   860
        s := 'HELP_REC_INSP'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   861
    ].
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   862
    (aComponent isComponentOf:contextInspector) ifTrue:[
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   863
        s := 'HELP_CON_INSP'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   864
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   865
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   866
    s notNil ifTrue:[
612
986e371232a2 isSubViewOf: -> isComponentOf:
Claus Gittinger <cg@exept.de>
parents: 583
diff changeset
   867
        ^ resources string:s
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   868
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   869
    ^ nil
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
    "Modified: 29.8.1995 / 23:38:54 / claus"
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
   872
    "Modified: 20.10.1996 / 18:14:59 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   873
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   874
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   875
!DebugView methodsFor:'initialization'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   876
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   877
addToCurrentProject
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   878
    "ignored here"
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
    ^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   881
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   882
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   883
initialize
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   884
    |v panel hpanel bpanel separator|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   885
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   886
    super initialize.
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
    font := font on:device.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   889
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   890
    busy := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   891
    exclusive := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   892
    inspecting := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   893
    exitAction := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   894
    bigStep := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   895
    canContinue := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   896
    canAbort := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   897
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   898
    bpanel := HorizontalPanelView
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   899
"/                        origin:(0.0 @ 0.0)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   900
"/                        extent:(1.0 @ (font height * 2))
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   901
                            in:self.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   902
    bpanel horizontalLayout:#leftSpace.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   903
    bpanel verticalSpace:ViewSpacing // 2.
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
    terminateButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   906
                        label:(resources at:'terminate')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   907
                        action:[terminateButton turnOffWithoutRedraw. self doTerminate]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   908
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   909
    separator := View extent:(10 @ 5) in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   910
    separator borderWidth:0; level:0.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   911
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   912
    abortButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   913
                        label:(resources at:'abort')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   914
                        action:[abortButton turnOffWithoutRedraw. self doAbort]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   915
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   916
    returnButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   917
                        label:(resources at:'return')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   918
                        action:[returnButton turnOff. self doReturn]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   919
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   920
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   921
    restartButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   922
                        label:(resources at:'restart')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   923
                        action:[restartButton turnOff. self doRestart]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   924
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   925
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   926
    separator := View extent:(10 @ 5) in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   927
    separator borderWidth:0; level:0.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   928
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   929
    continueButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   930
                        label:(resources at:'continue')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   931
                        action:[continueButton turnOffWithoutRedraw. self doContinue]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   932
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   933
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   934
    separator := View extent:(10 @ 5) in:bpanel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   935
    separator borderWidth:0; level:0.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   936
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   937
    nextButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   938
                        label:(resources at:'next')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   939
                        action:[stepButton turnOff. self doNext]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   940
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   941
    stepButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   942
                        label:(resources at:'step')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   943
                        action:[stepButton turnOff. self doStep]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   944
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   945
    sendButton := Button
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   946
                        label:(resources at:'send')
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   947
                        action:[sendButton turnOff. self doSend]
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   948
                        in:bpanel.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   949
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   950
    bpanel origin:(0.0 @ 0.0)
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   951
           extent:(1.0 @ (bpanel preferredExtent y)).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
   952
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   953
    panel := VariableVerticalPanel
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   954
                        origin:(0.0 @ bpanel height)
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   955
                        corner:(1.0 @ 1.0)
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   956
                            in:self.
266
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
    v := ScrollableView for:SelectionInListView in:panel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   959
    v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25).
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
    contextView := v scrolledView.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   962
    contextView action:[:lineNr | self showSelection:lineNr].
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   963
    contextView doubleClickAction:[:line | self browse].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   964
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   965
    v := ScrollableView for:CodeView in:panel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   966
    v origin:(0.0 @ 0.25) corner:(1.0 @ 0.75).
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
    codeView := v scrolledView.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   969
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   970
    hpanel := VariableHorizontalPanel in:panel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   971
    hpanel origin:(0.0 @ 0.75) corner:(1.0 @ 1.0).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   972
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   973
    receiverInspector := InspectorView
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   974
                                origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   975
                                    in:hpanel.
646
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   976
    receiverInspector label:'receiver'.
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
    contextInspector := ContextInspectorView
494
0d35a48c45bc double click on a context line opens a browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   979
                                origin:(0.5 @ 0.0) corner:(1.0 @ 1.0)
646
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   980
                                    in:hpanel.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   981
    contextInspector label:'context'.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   982
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   983
    "Modified: 28.6.1996 / 15:31:31 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   984
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   985
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   986
initializeMiddleButtonMenu
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   987
    |labels selectors m|
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
   988
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   989
    exclusive ifTrue:[
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   990
        labels := resources array:#(
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   991
                                    'show more'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   992
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   993
                                    'remove breakpoint'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   994
                                    'remove all trace & breakpoints'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   995
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   996
                                    'copy walkback text'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   997
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   998
                                    'quickTerminate'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
   999
                                    '='
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1000
                                    'exit smalltalk (no confirmation)'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1001
                                  ).
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1002
        selectors := #(
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1003
                                 showMore
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1004
                                 nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1005
                                 removeBreakpoint
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1006
                                 removeAllBreakpoints
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1007
                                 nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1008
                                 copyWalkbackText
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1009
                                 nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1010
                                 quickTerminate
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1011
                                 nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1012
                                 exit
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1013
                      )
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1014
    ] ifFalse:[
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1015
        labels := resources array:#(
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1016
                                    'show more'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1017
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1018
                                    'skip'
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1019
                                    'step out'
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1020
                                    '-'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1021
"
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1022
                                    'continue'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1023
                                    'terminate'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1024
                                    'abort'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1025
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1026
                                    'step'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1027
                                    'send'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1028
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1029
                                    'return'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1030
                                    'restart'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1031
                                    '-'
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1032
"
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1033
                                    'remove breakpoint'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1034
                                    'remove all trace & breakpoints'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1035
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1036
                                    'browse'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1037
                                    'browse class'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1038
                                    'browse class hierarchy'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1039
                                    'browse full class protocol'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1040
                                    'implementors'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1041
                                    'senders'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1042
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1043
                                    'inspect context'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1044
                                    'copy walkback text'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1045
                                    '-'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1046
                                    'quickTerminate'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1047
                                    '='
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1048
                                    'exit smalltalk (no confirmation)'
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1049
                              ).
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1050
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1051
        selectors := #(
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1052
                                         showMore
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1053
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1054
                                         skip
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1055
                                         skipForReturn
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1056
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1057
"
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1058
                                         doContinue
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1059
                                         doTerminate
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1060
                                         doAbort
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1061
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1062
                                         doStep
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1063
                                         doSend
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1064
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1065
                                         doReturn
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1066
                                         doRestart
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1067
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1068
"
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1069
                                         removeBreakpoint
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1070
                                         removeAllBreakpoints
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1071
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1072
                                         browse
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1073
                                         browseClass
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1074
                                         browseClassHierarchy
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1075
                                         browseFullClassProtocol
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1076
                                         implementors
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1077
                                         senders
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1078
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1079
                                         inspectContext
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1080
                                         copyWalkbackText
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1081
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1082
                                         quickTerminate
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1083
                                         nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1084
                                         exit
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1085
        ).
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1086
    ].
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1087
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1088
    m := PopUpMenu 
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1089
                labels:labels
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1090
             selectors:selectors
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1091
              receiver:self
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1092
                   for:contextView.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1093
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1094
    contextView middleButtonMenu:m. 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1095
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1096
    inspecting ifTrue:[
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1097
        m notNil ifTrue:[
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1098
            m disableAll:#(doTraceStep removeBreakpoint browse browseClass
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1099
                           browseClassHierarchy browseFullClassProtocol
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1100
                           implementors senders inspectContext skip doStepOut).
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  1101
        ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1102
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1103
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1104
    "Modified: 14.10.1996 / 13:21:26 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1105
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1106
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1107
realize
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1108
    super realize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1109
"/    exclusive ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1110
"/        windowGroup := nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1111
"/    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1112
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1113
    inspecting ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1114
	inspectedProcess notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1115
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1116
	     set prio somewhat higher (by 2, to allow walkBack-update process
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1117
	     to run between mine and the debugged processes prio)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1118
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1119
	    Processor activeProcess 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1120
		priority:(inspectedProcess priority + 2 min:16).
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
  1121
	]
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1122
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1123
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1124
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1125
setLabelFor:aMessage in:aProcess
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1126
    |l nm|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1127
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1128
    l := aMessage , ' ('.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1129
    nm := aProcess name.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1130
    nm notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1131
	l := l , (nm contractTo:17) , ''.
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
  1132
    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1133
    l := l , '[' , aProcess id printString , '])'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1134
    self label:l.
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1135
! !
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1136
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1137
!DebugView methodsFor:'interrupt handling'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1138
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1139
contextInterrupt
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1140
    DebuggingDebugger == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1141
        'contextIRQ' printCR.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1142
    ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1143
    ^ self stepOrNext
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1144
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1145
    "Modified: 14.10.1996 / 13:30:47 / cg"
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1146
!
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1147
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1148
stepInterrupt
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1149
    DebuggingDebugger == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1150
        'stepIRQ' printCR.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1151
    ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1152
    ^ self stepOrNext
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1153
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1154
    "Modified: 14.10.1996 / 13:30:56 / cg"
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1155
!
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1156
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1157
stepOrNext
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1158
    |where here s isWrap method lastWrappedConAddr wrappedMethod 
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1159
     inBlock left ignore contextBelow lastWrappedContext
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1160
     leftWrap enteredWrap|
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1161
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1162
    "/ DebuggingDebugger := true
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1163
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1164
    skipLineNr == #return ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1165
        name := Processor activeProcess nameOrId.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1166
        self label:('context returned ' , ' (process: ' , name , ')').
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1167
        here := thisContext sender sender.
755
94705dbabfe0 stepOut enhanced / fixed
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  1168
        here setLineNumber:nil.
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1169
        here := nil.
755
94705dbabfe0 stepOut enhanced / fixed
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  1170
        self enter:thisContext sender sender sender.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1171
        ^ self
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1172
    ].
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  1173
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1174
"/    "/
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1175
"/    "/ should no longer happen
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1176
"/    "/
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1177
"/    stepForReturn == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1178
"/"/'stepForreturn' printCR.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1179
"/        self enter:thisContext sender.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1180
"/        ^ self
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1181
"/    ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1182
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
  1183
    Processor activeProcess ~~ inspectedProcess ifTrue:[
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1184
        'stray step interrupt' errorPrintNL.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1185
        ^ self
52
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
  1186
    ].
7b48409ae088 *** empty log message ***
claus
parents: 48
diff changeset
  1187
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1188
    here := thisContext.        "stepInterrupt"
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1189
    here := here sender.        "the caller; step- or contextIRQ"  
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1190
    here := here sender.        "the interrupted context"  
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1191
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1192
    DebuggingDebugger == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1193
        '*******' printNL.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1194
        'here in ' print.
786
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1195
        inWrap ifTrue:['(wrap) ' print.].
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1196
        ((ObjectMemory addressOf:here) printStringRadix:16) print. ' ' print.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1197
        here selector printNL.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1198
    ].
10
46e0d4f2079f *** empty log message ***
claus
parents: 7
diff changeset
  1199
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1200
    "
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1201
     kludge to hide breakpoint wrappers in the context list: 
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1202
         check if we are in a wrapper methods hidden setup-sequence
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1203
         if so, ignore the interrupt and continue single sending
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1204
    "
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1205
    isWrap := false.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1206
    left := false.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1207
    leftWrap := enteredWrap := false.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1208
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1209
    where := here.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1210
    inWrap ifTrue:[
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1211
        wrappedMethod := nil.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1212
        5 timesRepeat:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1213
            (where notNil and:[where isBlockContext not]) ifTrue:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1214
                method := where method.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1215
                (method notNil and:[method isWrapped]) ifTrue:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1216
                    "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1217
                     in a wrapper method
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1218
                    "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1219
                    wrappedMethod ~~ method ifTrue:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1220
                        wrappedMethod := method.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1221
                        lastWrappedContext := where.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1222
                        where sender receiver == method originalMethod ifFalse:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1223
                            isWrap := true.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1224
                        ]
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1225
                    ] ifFalse:[
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1226
                        where == steppedContext ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1227
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1228
                            DebuggingDebugger == true ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1229
                                'change stepCon from: ' print.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1230
                                steppedContext print.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1231
                                ' to lastWrapped: ' print.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1232
                                lastWrappedContext printNL.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1233
                            ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1234
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1235
                            inWrap := false.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1236
                            leftWrap := true.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1237
                            wrapperContext := steppedContext.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1238
                            steppedContext := lastWrappedContext
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1239
                        ]
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1240
                    ]
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1241
                ].
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1242
                where := where sender
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1243
            ]
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1244
        ].
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1245
    ].
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1246
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1247
    isWrap ifTrue:[
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1248
        DebuggingDebugger == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1249
            'ignore wrap' printNL.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1250
        ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1251
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1252
        "/
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1253
        "/ ignore, while in wrappers hidden setup
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1254
        "/
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1255
        where := nil. here := nil.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1256
        ObjectMemory flushInlineCaches.
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1257
        
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1258
        skipLineNr == #return ifTrue:[
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1259
            DebuggingDebugger == true ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1260
                'skipRet in wrap' printCR.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1261
            ]
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1262
        ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1263
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1264
        StepInterruptPending := 1.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1265
        InterruptPending := 1.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1266
        InStepInterrupt := nil.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1267
        ^ nil
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1268
    ].
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1269
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1270
    inBlock := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1271
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1272
    "/
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1273
    "/ is this for a send or a step/next ?
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1274
    "/
787
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1275
    (bigStep 
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1276
    and:[steppedContext notNil]) ifTrue:[
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1277
        "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1278
         a step or next - ignore all contexts below the interesting one
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1279
        "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1280
        where := here.      "the interrupted context"
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1281
        contextBelow := nil.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1282
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1283
        where home notNil ifTrue:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1284
            "/
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1285
            "/ in a block called by 'our' context ?
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1286
            "/
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1287
            where home == steppedContext ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1288
"/ '*block*' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1289
                inBlock := true
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1290
            ]
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1291
        ].
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1292
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1293
        where == steppedContext ifFalse:[
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1294
            where := where sender.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1295
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1296
            where notNil ifTrue:[
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1297
                where home == steppedContext ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1298
"/ '*block*' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1299
                    inBlock := true.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1300
                ]
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1301
            ].
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1302
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1303
"/ 'looking for ' print.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1304
"/  (steppedContextAddress printStringRadix:16)print. '' printNL.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1305
786
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1306
"/where print. ' ' print. ((ObjectMemory addressOf:where)printStringRadix:16) printCR.
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1307
"/steppedContext print. ' ' print. ((ObjectMemory addressOf:steppedContext)printStringRadix:16) printCR.
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1308
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1309
            where == steppedContext ifFalse:[
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1310
                "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1311
                 check if we are in a context below steppedContext
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1312
                 (i.e. if steppedContext can be reached from
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1313
                  interrupted context. Not using context-ref but its
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1314
                  address to avoid creation of many useless contexts.)
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1315
                "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1316
                inBlock ifFalse:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1317
                    [where notNil] whileTrue:[
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1318
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1319
                        DebuggingDebugger == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1320
                            ((ObjectMemory addressOf:where) printStringRadix:16)print. ' ' print.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1321
                            where selector printNL.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1322
                        ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1323
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1324
                        where == steppedContext ifTrue:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1325
"/ 'found it - below; ignore' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1326
                            "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1327
                             found the interesting context somwehere up in the
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1328
                             chain. We seem to be still below the interesting one ...
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1329
                            "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1330
                            tracing == true ifTrue:[
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1331
                                here printString printCR
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1332
                            ].
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1333
                            "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1334
                              yes, a context below
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1335
                              - continue and schedule another stepInterrupt.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1336
                              Must flush caches since optimized methods not always
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1337
                              look for pending interrupts
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1338
                            "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1339
                            ObjectMemory flushInlineCaches.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1340
                            (contextBelow notNil 
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1341
                            and:[inBlock not]) ifTrue:[
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1342
"/ 'prepare for unwind-catch' printNL.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1343
"/ 'con= ' print. contextBelow printCR.
787
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1344
                                contextBelow selector notNil ifTrue:[
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1345
                                    self label:'single stepping - please wait ...(' , contextBelow selector , ')'.
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1346
                                ].
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1347
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1348
                                DebuggingDebugger == true ifTrue:[
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1349
                                    'below stepCon; continue until unwind of: ' print.
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1350
                                    contextBelow printCR.
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1351
                                ].
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1352
                                Processor activeProcess forceInterruptOnReturnOf:contextBelow.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1353
                                StepInterruptPending := nil.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1354
                            ] ifFalse:[
787
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1355
                                here selector notNil ifTrue:[
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1356
                                    self label:'single stepping - please wait ...(' , here selector , ')'.
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1357
                                ].
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1358
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1359
                                DebuggingDebugger == true ifTrue:[
787
dab2fdc4a811 care for degenerated stepInterrupt
Claus Gittinger <cg@exept.de>
parents: 786
diff changeset
  1360
                                    'in stepCon; continue single stepping' printCR.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1361
                                ].
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1362
                                StepInterruptPending := 1.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1363
                                InterruptPending := 1.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1364
                            ].
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1365
                            where := nil. here := nil.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1366
                            InStepInterrupt := nil.
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1367
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1368
                            ^ nil
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1369
                        ].
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1370
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1371
                        where home == steppedContext ifTrue:[
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1372
                            inBlock := true.
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1373
                        ].
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1374
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1375
                        contextBelow := where.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1376
                        where := where sender
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1377
                    ].
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1378
                    s := 'left stepped context'.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1379
                    left := true.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1380
                ].
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1381
            ] ifTrue:[
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1382
"/ 'found it right in sender' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1383
                s := 'after step'
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1384
            ].
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1385
        ] ifTrue:[
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1386
"/ 'found it right away' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1387
            s := 'after step'
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1388
        ].
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1389
    ] ifFalse:[
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1390
"/ ' send' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1391
        "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1392
         a send
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1393
        "
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1394
        DebuggingDebugger == true ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1395
            'clear steppedContext' printCR.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1396
        ].
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1397
        steppedContext := nil.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1398
        s := 'after send'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1399
    ].
7
92b82578c88c *** empty log message ***
claus
parents: 4
diff changeset
  1400
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1401
    ignore := false.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1402
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1403
    "
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1404
     kludge to hide breakpoint wrappers in the context list: 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1405
         check if we are in a wrapper methods hidden exit-sequence
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1406
         if so, ignore the interrupt and continue single sending
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1407
    "
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1408
    (where isNil 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1409
    and:[wrapperContext notNil])
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1410
    ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1411
        "/ did not find our steppedContext along the chain;
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1412
        "/ could be in a wrappedMethods exitBlock ...
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1413
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1414
        leftWrap ifFalse:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1415
            where := here.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1416
            wrappedMethod := nil.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1417
            5 timesRepeat:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1418
                where notNil ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1419
                    where isBlockContext ifFalse:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1420
                        method := where method.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1421
                        (method notNil and:[method isWrapped]) ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1422
                            where == wrapperContext ifTrue:[
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1423
                                DebuggingDebugger == true ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1424
                                    'change stepCon fromWrapped: ' print.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1425
                                    steppedContext print.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1426
                                    ' to: ' print.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1427
                                    wrapperContext printNL.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1428
                                ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1429
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1430
                                inWrap := true.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1431
                                enteredWrap := true.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1432
                                steppedContext := wrapperContext.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1433
                                wrapperContext := nil.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1434
                            ]
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1435
                        ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1436
                    ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1437
                    where := where sender
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1438
                ]
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1439
            ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1440
        ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1441
        enteredWrap ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1442
            ignore := true
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1443
        ]
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1444
    ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1445
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1446
    "/
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1447
786
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1448
    left ifTrue:[
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1449
        "/ special care for stepInterrupt in send,
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1450
        "/ when created a dummy context (lineNr == 1)
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1451
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1452
        steppedContext lineNumber isNil ifTrue:[
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1453
            steppedContext selector == here sender selector ifTrue:[
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1454
                left := false.
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1455
                s := 'after step'.
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1456
                steppedContext := here sender.
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1457
            ].
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1458
        ]
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1459
    ].
429c3146c03d better stepping over stepped send (dummy context in send.c)
Claus Gittinger <cg@exept.de>
parents: 781
diff changeset
  1460
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1461
    inBlock ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1462
"/ 'inBlock' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1463
        s := 'in block'.
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1464
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1465
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1466
    DebuggingDebugger == true ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1467
        where notNil ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1468
            '(' print. steppedContextLineno print. ') ' print.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1469
            where print.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1470
            '[' print. where lineNumber print. ']' printNL.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1471
        ].
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  1472
    ].
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1473
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1474
    ignore ifFalse:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1475
        (bigStep 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1476
        and:[steppedContextLineno notNil 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1477
        and:[where notNil 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1478
        and:[where lineNumber == steppedContextLineno]]]) ifTrue:[
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1479
            (here isBlockContext 
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1480
            and:[(here methodHome == steppedContext)
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1481
                 or:[here home == steppedContext]]) ifTrue:[
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1482
                DebuggingDebugger == true ifTrue:[
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1483
                    'same line but in block' printNL.
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1484
                ].
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1485
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1486
                steppedContext := actualContext := here.
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1487
                steppedContextLineno := here lineNumber.
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1488
            ] ifFalse:[    
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1489
                DebuggingDebugger == true ifTrue:[
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1490
                    'same line - ignored' printNL.
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1491
                ].
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1492
                ignore := true
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1493
            ].
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1494
        ].
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1495
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1496
        (left not 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1497
        and:[skipLineNr notNil 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1498
        and:[where notNil
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1499
        and:[where lineNumber < skipLineNr]]]) ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1500
            DebuggingDebugger == true ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1501
                'skip (' print. skipLineNr print. ' unreached - ignored' printNL.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1502
            ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1503
            ignore := true
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1504
        ].
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1505
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1506
        (steppedContextLineno isNil 
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1507
        and:[skipLineNr isNil
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1508
        and:[thisContext sender selector == #contextInterrupt]]) ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1509
            DebuggingDebugger == true ifTrue:[
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1510
                'same line2 (after conIRQ) - ignored' printNL.
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1511
            ].
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1512
            ignore := true
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1513
        ].
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1514
    ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1515
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1516
    ignore ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1517
"/' ' printNL.
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1518
        where := nil. here := nil.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1519
        "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1520
         yes, a context below
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1521
          - continue and schedule another stepInterrupt.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1522
          Must flush caches since optimized methods not always
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1523
          look for pending interrupts
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1524
        "
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1525
        ObjectMemory flushInlineCaches.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1526
        StepInterruptPending := 1.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1527
        InterruptPending := 1.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1528
        InStepInterrupt := nil.
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  1529
        ^ nil
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1530
    ].
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1531
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1532
"/ ' ' printNL.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1533
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  1534
    name := Processor activeProcess nameOrId.
7
92b82578c88c *** empty log message ***
claus
parents: 4
diff changeset
  1535
    self label:(s , ' (process: ' , name , ')').
92b82578c88c *** empty log message ***
claus
parents: 4
diff changeset
  1536
57
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1537
    tracing := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1538
    bigStep := false.
36e13831b62d *** empty log message ***
claus
parents: 56
diff changeset
  1539
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1540
    "release refs to context"
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1541
    where := nil. here := nil.
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1542
"/'enter' printCR.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1543
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1544
    self enter:thisContext sender sender
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1545
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1546
    "Created: 14.10.1996 / 12:53:39 / cg"
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1547
    "Modified: 22.10.1996 / 15:06:59 / cg"
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1548
! !
571fd5eee315 Initial revision
claus
parents:
diff changeset
  1549
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1550
!DebugView methodsFor:'menu / button actions'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1551
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1552
autoUpdateOff
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1553
    "stop the update process"
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
    updateProcess notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1556
	monitorToggle lampColor:(Color yellow).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1557
	updateProcess terminate.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1558
	updateProcess := nil
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
!
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
autoUpdateOn
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1563
    "fork a subprocess which updates the contextList in regular intervals"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1564
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1565
    updateProcess isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1566
	updateProcess := 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1567
	    [
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1568
		[true] whileTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1569
		    monitorToggle showLamp ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1570
			monitorToggle lampColor:(Color yellow).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1571
		    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1572
			monitorToggle activeForegroundColor:Color black.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1573
		    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1574
		    (Delay forSeconds:0.25) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1575
		    self updateContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1576
		    monitorToggle showLamp ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1577
			monitorToggle lampColor:(Color red).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1578
		    ] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1579
			monitorToggle activeForegroundColor:Color red.
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
		    (Delay forSeconds:0.25) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1582
		    self updateContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1583
		]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1584
	    ] forkAt:(Processor activePriority - 1)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1585
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1586
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1587
!
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
browse
651
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1590
    |mthd w sel cls|
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1591
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1592
    mthd := selectedContext method.
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1593
    mthd notNil ifTrue:[
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1594
        w := selectedContext method who.
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1595
        w notNil ifTrue:[
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1596
            cls := w at:1.
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1597
            sel := w at:2.
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1598
        ]
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1599
    ].
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1600
    cls isNil ifTrue:[
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1601
        "/ class not found - try receiver
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1602
        cls := selectedContext receiver class
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1603
    ].
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1604
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1605
    cls browserClass openInClass:cls selector:sel.
266
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
    "Created: 22.11.1995 / 21:27:01 / cg"
651
b8a14e281c24 fixed browse, if there is nothing to browse
Claus Gittinger <cg@exept.de>
parents: 646
diff changeset
  1608
    "Modified: 28.6.1996 / 17:33:50 / cg"
266
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
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1611
browseClass
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1612
    |w cls|
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1613
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1614
    w := selectedContext method who.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1615
    cls := w at:1.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1616
    cls browserClass browseClass:cls
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1617
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1618
    "Modified: 3.5.1996 / 12:37:59 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1619
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1620
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1621
browseClassHierarchy
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1622
    |w cls|
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1623
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1624
    w := selectedContext method who.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1625
    cls := w at:1.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1626
    cls browserClass browseClassHierarchy:cls.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1627
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1628
    "Modified: 3.5.1996 / 12:38:17 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1629
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1630
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1631
browseFullClassProtocol
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1632
    |w cls|
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1633
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1634
    w := selectedContext method who.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1635
    cls := w at:1.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1636
    cls browserClass browseFullClassProtocol:cls.
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1637
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
  1638
    "Modified: 3.5.1996 / 12:38:30 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1639
!
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
copyWalkbackText
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1642
    "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
  1643
     This allows pasting it into some other view for printing ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1644
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1645
    self setTextSelection:(contextArray collect:[:con | con fullPrintString]) asStringCollection
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1646
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1647
    "Modified: 28.8.1995 / 15:31:59 / claus"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1648
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1649
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1650
doAbort
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1651
    "abort - send Object>>abortSignal, which is usually cought
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1652
     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
  1653
     from whatever the process is doing, but does not terminate it."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1654
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1655
    inspecting ifTrue:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1656
        inspectedProcess isDead ifTrue:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1657
            self showTerminated.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1658
            ^ self
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1659
        ].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1660
        (Object abortSignal isHandledIn:inspectedProcess suspendedContext) ifFalse:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1661
            self showError:'** the process does not handle the abort signal **'
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1662
        ] ifTrue:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1663
            self interruptProcessWith:[Object abortSignal raise].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1664
        ].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1665
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1666
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1667
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1668
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1669
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1670
    exitAction := #abort.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1671
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1672
    "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1673
    catchBlock notNil ifTrue:[
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1674
        abortButton turnOff.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1675
        catchBlock value.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1676
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1677
        "/ not reached
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1678
        'DEBUGGER: oops, abort failed' errorPrintNL.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1679
    ].
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1680
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1681
    ^ self.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1682
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1683
    "Modified: 22.10.1996 / 11:59:21 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1684
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1685
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1686
doContinue
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1687
    "continue from menu"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1688
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1689
    inspecting ifTrue:[
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1690
        device hasColors ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1691
            continueButton foregroundColor:Color red darkened.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1692
        ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1693
        continueButton label:(resources string:'stop').
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1694
        continueButton action:[self doStop].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1695
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1696
        self processPerform:#resume.
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1697
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1698
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1699
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1700
    canContinue ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1701
        steppedContext := wrapperContext := nil.
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1702
        tracing := false.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1703
        haveControl := false.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1704
        exitAction := #continue.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1705
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1706
        "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1707
        catchBlock notNil ifTrue:[catchBlock value].
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1708
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1709
        "/ not reached.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1710
        'DEBUGGER: oops, continue failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1711
        continueButton turnOff.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1712
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1713
    ] ifFalse:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1714
        inspecting ifFalse:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1715
            'resuming top context' errorPrintNL.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1716
            self showSelection:1.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1717
            self doReturn
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1718
        ]
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1719
    ]
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1720
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1721
    "Modified: 22.10.1996 / 11:59:24 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1722
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1723
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1724
doNext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1725
    "skip for next source-code line"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1726
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1727
    self doStep:nil
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1728
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1729
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1730
doNoTrace
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1731
    traceView notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1732
	traceView topView destroy.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1733
	traceView := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1734
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1735
    tracing := false
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
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1738
doRestart
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1739
    "restart - the selected context will be restarted"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1740
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1741
    inspecting ifTrue:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1742
        selectedContext isNil ifTrue:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1743
            ^ self showError:'** select a context first **'
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1744
        ].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1745
        self interruptProcessWith:[selectedContext unwindAndRestart].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1746
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1747
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1748
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1749
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1750
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1751
    exitAction := #restart.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1752
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1753
    "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1754
    catchBlock notNil ifTrue:[catchBlock value].
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1755
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1756
    "/ not reached
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1757
    'DEBUGGER: oops, restart failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1758
    restartButton turnOff.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1759
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1760
    "Modified: 22.10.1996 / 11:59:28 / cg"
266
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
doReturn
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1764
    "return - the selected context will do a ^nil"
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
    inspecting ifTrue:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1767
        selectedContext isNil ifTrue:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1768
            ^ self showError:'** select a context first **'
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1769
        ].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1770
        self interruptProcessWith:[selectedContext unwind].
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1771
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1772
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1773
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1774
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1775
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1776
    exitAction := #return.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1777
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1778
    "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1779
    catchBlock notNil ifTrue:[catchBlock value].
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1780
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1781
    "/ not reached
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1782
    'DEBUGGER: oops, return failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1783
    returnButton turnOff.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1784
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1785
    "Modified: 22.10.1996 / 11:59:31 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1786
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1787
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1788
doSend
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1789
    "single send; reenter with next message send"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1790
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1791
    inspecting ifTrue:[^ self].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1792
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1793
    canContinue ifTrue:[
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1794
        steppedContext := wrapperContext := nil.
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1795
        haveControl := false.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1796
        exitAction := #step.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1797
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1798
        "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1799
        catchBlock notNil ifTrue:[catchBlock value].
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1800
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1801
        "/ not reached
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1802
        'DEBUGGER: oops, send failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1803
        sendButton turnOff.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1804
    ]
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1805
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1806
    "Modified: 22.10.1996 / 11:59:33 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1807
!
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
doStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1810
    "skip for next send in selected method"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1811
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1812
    self doStep:-1 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1813
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1814
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1815
doStep:lineNr
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1816
    "common helper for step, skip & next.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1817
     Arrange for single-steppping until we pass lineNr (if nonNil) 
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1818
     or to next line (if nil) or to next send (if -1)"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1819
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1820
    |con method|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1821
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1822
    inspecting ifTrue:[^ self].
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
    canContinue ifTrue:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1825
        selectedContext notNil ifTrue:[
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1826
            con := actualContext. "/ selectedContext.
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1827
            steppedContextLineno := actualContext lineNumber.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1828
        ] ifFalse:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1829
            con := contextArray at:2.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1830
            steppedContextLineno := con lineNumber.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1831
        ].
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1832
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1833
        skipLineNr := lineNr.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1834
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1835
        lineNr == -1 ifTrue:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1836
            steppedContextLineno := skipLineNr := nil.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1837
        ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1838
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  1839
        steppedContext := con.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1840
        wrapperContext := nil.
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1841
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1842
"/ ' step con:' print. (ObjectMemory addressOf:steppedContext) printHex. ' ' print. steppedContext printCR.
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1843
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1844
        "
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1845
         if we step in a wrapped method,
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1846
         prepare to skip the prolog ...
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1847
        "
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1848
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1849
        inWrap := false.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1850
        method := con method.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1851
        (method notNil and:[method isWrapped]) ifTrue:[
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1852
            inWrap := true
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1853
        ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1854
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1855
        lineNr == #return ifTrue:[
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1856
            Processor activeProcess forceInterruptOnReturnOf:con.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1857
        ].
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  1858
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1859
        con := nil.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1860
        bigStep := true.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1861
        haveControl := false.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1862
        exitAction := #step.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1863
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1864
        "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1865
        catchBlock notNil ifTrue:[catchBlock value].
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1866
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1867
        "/ not reached
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1868
        'DEBUGGER: oops, step failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1869
        stepButton turnOff.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1870
        nextButton turnOff.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1871
        sendButton turnOff.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1872
    ]
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1873
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  1874
    "Modified: 22.10.1996 / 14:52:04 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1875
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1876
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1877
doStop
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1878
    "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
  1879
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1880
    inspecting ifTrue:[
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1881
        device hasColors ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1882
            continueButton foregroundColor:Color green darkened darkened.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1883
        ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1884
        continueButton label:(resources string:'continue').
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1885
        continueButton action:[self doContinue].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1886
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1887
        self processPerform:#stop.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1888
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1889
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1890
    ].
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1891
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  1892
    "Modified: 20.10.1996 / 18:30:48 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1893
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1894
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1895
doTerminate
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1896
    "terminate - the process has a chance for cleanup"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1897
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1898
    inspecting ifTrue:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1899
        self processPerform:#terminate.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1900
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1901
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1902
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1903
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1904
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1905
    exitAction := #terminate. 
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1906
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1907
    "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1908
    catchBlock notNil ifTrue:[catchBlock value].
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1909
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1910
    "/ not reached (normally)
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1911
    inspecting ifFalse:[
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1912
        'DEBUGGER: oops, terminate failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1913
        self warn:'terminate failed'.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1914
    ].
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1915
    terminateButton turnOff.
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1916
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1917
    "Modified: 22.10.1996 / 11:59:45 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1918
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1919
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1920
doTrace
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1921
    "tracing - not really implemented ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1922
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1923
    self warn:'this function is not yet implemented'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1924
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1925
"/    |v b|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1926
"/
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1927
"/    traceView isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1928
"/        v := StandardSystemView on:Display.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1929
"/        v label:'Debugger-Trace'.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1930
"/        v icon:icon.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1931
"/
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1932
"/        b := Button label:'untrace' in:v.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1933
"/        b origin:(0 @ 0) extent:(1.0 @ (b height)).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1934
"/        b action:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1935
"/            StepInterruptPending := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1936
"/            tracing := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1937
"/            v unrealize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1938
"/            traceView := nil
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
"/        traceView := ScrollableView for:TextCollector in:v.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1941
"/        traceView origin:(0 @ (b height))
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1942
"/                  extent:[v width @ (v height - b height)]
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
"/    v realize.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1945
"/
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1946
"/    tracing := true.
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
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1949
doTraceStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1950
    "tracestep - not implemented yet"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1951
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1952
    canContinue ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1953
	tracing := true.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1954
	self doStep
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1955
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1956
!
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
exit
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1959
    "exit from menu: immediate exit from smalltalk"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1960
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1961
    OperatingSystem exit
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
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1964
implementors
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1965
    "open a browser on the implementors"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1966
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1967
    selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1968
	^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1969
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1970
    SystemBrowser browseImplementorsOf:selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1971
!
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
inspectContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1974
    "launch an inspector on the currently selected context"
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
    contextView selection notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1977
	(contextView selectionValue startsWith:'**') ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1978
	    (contextArray at:(contextView selection)) inspect.
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
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1981
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1982
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1983
quickTerminate
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1984
    "quick terminate - the process will get no chance for cleanup actions"
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
    inspecting ifTrue:[
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1987
        self processPerform:#terminateNoSignal.
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  1988
        ^ self
266
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
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  1991
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1992
    haveControl := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  1993
    exitAction := #quickTerminate.
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1994
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1995
    "exit private event-loop"
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1996
    catchBlock notNil ifTrue:[catchBlock value].
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1997
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1998
    "/ not reached (normally)
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  1999
    inspecting ifFalse:[
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  2000
        'DEBUGGER: oops, terminate failed' errorPrintNL.
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  2001
        self warn:'terminate failed'.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2002
    ].
581
d1a1ae9d49e4 removed old non-thread support
Claus Gittinger <cg@exept.de>
parents: 579
diff changeset
  2003
    terminateButton turnOff.
477
6351acd20dfb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 448
diff changeset
  2004
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2005
    "Modified: 22.10.1996 / 11:59:49 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2006
!
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
removeAllBreakpoints
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2009
    "remove all trace & breakpoints - if any"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2010
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2011
    MessageTracer unwrapAllMethods
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2012
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2013
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2014
removeBreakpoint
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2015
    "remove breakpoint on the selected contexts method - if any"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2016
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2017
    |implementorClass method|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2018
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2019
    selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2020
	^ self showError:'** select a context first **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2021
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2022
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2023
    implementorClass := selectedContext methodClass. 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2024
    implementorClass notNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2025
	method := implementorClass compiledMethodAt:selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2026
	(method notNil and:[method isWrapped]) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2027
	    MessageTracer unwrapMethod:method
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2028
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2029
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2030
    contextView middleButtonMenu disable:#removeBreakpoint.
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
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2033
senders
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2034
    "open a browser on the senders"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2035
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2036
    selectedContext isNil ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2037
	^ self showError:'** select a context first **'
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
    SystemBrowser browseAllCallsOn:selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2040
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2041
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2042
showMore
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2043
    "double number of contexts shown"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2044
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2045
    |oldSelection con|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2046
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2047
    contextArray notNil ifTrue:[
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2048
        oldSelection := contextView selection.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2049
        nChainShown := nChainShown * 2.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2050
        con := contextArray at:1.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2051
        contextArray at:1 put:nil.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2052
        self setContext:con.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2053
        contextView setSelection:oldSelection.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2054
    ]
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2055
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2056
    "Modified: 25.5.1996 / 12:26:55 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2057
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2058
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2059
skip
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2060
    "skip for cursor line in selected method"
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
    self doStep:codeView cursorLine.
754
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2063
!
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2064
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2065
skipForReturn
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2066
    "skip until context is left."
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2067
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2068
    self doStep:#return.
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2069
1848d4e89bc4 much better next & step (no longer single-steps through all sends)
Claus Gittinger <cg@exept.de>
parents: 745
diff changeset
  2070
    "Modified: 14.10.1996 / 13:22:46 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2071
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2072
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2073
!DebugView methodsFor:'private'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2074
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2075
busy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2076
    ^ busy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2077
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2078
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2079
cacheMyself
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2080
    "remember myself for next debug session"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2081
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2082
    "caching the last debugger will make the next debugger appear
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2083
     faster, since no resources have to be allocated in the display.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2084
     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
  2085
     Otherwise, the GC will not be able to release it"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2086
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2087
    windowGroup notNil ifTrue:[
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  2088
        windowGroup setProcess:nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2089
    ].
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
    busy := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2092
    codeView acceptAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2093
    codeView doItAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2094
    codeView contents:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2095
    receiverInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2096
    contextInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2097
    inspectedProcess := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2098
    exitAction := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2099
    contextArray := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2100
    selectedContext := actualContext := nil.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2101
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2102
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2103
    grabber := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2104
    self autoUpdateOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2105
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2106
    exclusive ifTrue:[CachedExclusive := self] ifFalse:[CachedDebugger := self].
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  2107
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2108
    "Modified: 22.10.1996 / 11:59:53 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2109
!
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
exclusive:aBoolean
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2112
    exclusive := aBoolean
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2113
!
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
inspectedProcess 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2116
    ^ inspectedProcess 
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
303
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
  2119
interestingContextFrom:aContext
1d94813f1977 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 301
diff changeset
  2120
    "return an interesting contexts offset, or nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2121
     This is the context initially shown in the walkback.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2122
     We move up the calling chain, skipping all intermediate Signal
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2123
     and Exception contexts, to present the context in which the error
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2124
     actually occured.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2125
     Just for your convenience :-)"
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
    |c found offset sel prev ex|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2128
687
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2129
    aContext isBlockContext ifTrue:[^ 1].
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2130
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2131
    "somewhere, at the bottom, there must be a raise ..."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2132
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2133
    c := aContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2134
    1 to:5 do:[:i |
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2135
        c isNil ifTrue:[^ 1 "^ nil"].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2136
        sel := c selector.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2137
        (sel == #raise) ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2138
            (c receiver isKindOf:Exception) ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2139
                ex := c receiver.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2140
                offset := i.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2141
                found := c
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2142
            ] ifFalse:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2143
                (c receiver isSignal) ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2144
                    offset := i.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2145
                    found := c
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2146
                ]
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2147
            ]
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2148
        ].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2149
        c := c sender.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2150
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2151
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2152
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2153
     if this is a noHandler exception, skip forward
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2154
     to the erronous context
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2155
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2156
    ex notNil ifTrue:[
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2157
        ex signal == Signal noHandlerSignal ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2158
            c := ex suspendedContext
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2159
        ]
266
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
687
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2162
    (c := found) isNil ifTrue:[
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2163
        "/ this is a kludge, but convenient.
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2164
        "/ show the place where the divisionByZero happend,
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2165
        "/ not where the signal was raised.
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2166
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2167
        sel := aContext selector.
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2168
        (sel == #//      
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2169
        or:[sel == #/
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2170
        or:[sel == #\\]]) ifTrue:[
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2171
            ^ 2
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2172
        ].
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2173
        
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2174
        ^ 1
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2175
    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2176
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2177
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2178
     got it; move up, skipping all intermediate Signal and
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2179
     Exception contexts
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2180
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2181
    prev := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2182
    [   
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2183
        ((c receiver isSignal)
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2184
        or:[(c receiver isKindOf:Exception)])
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2185
    ] whileTrue:[
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2186
        prev := c.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2187
        (c := c sender) isNil ifTrue:[^ offset].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2188
        offset := offset + 1.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2189
    ].
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
    "
687
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2192
     now, we are one above the raising context
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2193
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2194
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2195
    "
269
6a0af2256d0b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
  2196
     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
  2197
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2198
    ( #( halt halt: 
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2199
         error error: 
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2200
         doesNotUnderstand: 
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2201
         subclassResponsibility 
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2202
         primitiveFailed) includes:c selector) 
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2203
    ifTrue:[
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2204
        c selector == #doesNotUnderstand: ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2205
            "
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2206
             one more up, to get to the originating context
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2207
            "
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2208
            (c := c sender) isNil ifTrue:[^ offset].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2209
            offset := offset + 1.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2210
        ].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2211
        (c := c sender) isNil ifTrue:[^ offset].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2212
        offset := offset + 1.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2213
    ] ifFalse:[
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2214
        "
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2215
         ok, got the raise - if its a BreakPoint, look for the sender
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2216
        "
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2217
        (MessageTracer notNil and:[prev receiver == MessageTracer breakpointSignal]) ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2218
            offset := offset + 1
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2219
        ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2220
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2221
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2222
    ^ offset
269
6a0af2256d0b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
  2223
6a0af2256d0b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 266
diff changeset
  2224
    "Created: 10.12.1995 / 13:55:21 / cg"
687
a70b72319d51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2225
    "Modified: 26.7.1996 / 16:34:58 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2226
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2227
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2228
interruptProcessWith:aBlock
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2229
    "let inspected process do something, then update the context list"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2230
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2231
    inspectedProcess isDead ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2232
	self showTerminated.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2233
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2234
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2235
    inspectedProcess interruptWith:aBlock.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2236
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2237
     give the process a chance to run, then update
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2238
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2239
    (Delay forSeconds:0.2) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2240
    self setContext:(inspectedProcess suspendedContext).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2241
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2242
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2243
processPerform:aMessage
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2244
    "do something, then update the context list"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2245
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2246
    inspectedProcess isDead ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2247
	self showTerminated.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2248
	^ self
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2249
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2250
    inspectedProcess perform:aMessage.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2251
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2252
     give the process a chance to run, then update
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2253
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2254
    (Delay forSeconds:0.2) wait.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2255
    self setContext:(inspectedProcess suspendedContext).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2256
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2257
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2258
setContext:aContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2259
    "show calling chain from aContext in the walk-back listview"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2260
641
e02a521493ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
  2261
    ^ self setContext:aContext releaseInspectors:true
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2262
641
e02a521493ba checkin from browser
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
  2263
    "Modified: 27.6.1996 / 17:21:59 / cg"
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2264
!
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2265
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2266
setContext:aContext releaseInspectors:releaseInspectors
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2267
    "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
  2268
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2269
    |con text method caller caller2 m count|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2270
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2271
    (contextArray notNil and:[aContext == (contextArray at:1)]) ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2272
	"no change"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2273
	^ false
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2274
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2275
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2276
    m := contextView middleButtonMenu.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2277
    m notNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2278
	m disable:#showMore.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2279
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2280
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2281
    aContext isNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2282
	text := Array with:'** no context **'.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2283
	contextArray := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2284
    ] ifFalse:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2285
	text := OrderedCollection new:nChainShown.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2286
	contextArray := OrderedCollection new:nChainShown.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2287
	con := aContext.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2288
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2289
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2290
	 get them all
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2291
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2292
	count := 0.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2293
	[con notNil and:[count <= nChainShown]] whileTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2294
	    contextArray add:con. count := count + 1.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2295
	    (MoreDebuggingDetail == true) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2296
		text add:(((ObjectMemory addressOf:con) printStringRadix:16) , ' ' , con printString).
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2297
	    ] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2298
		text add:con printString.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2299
	    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2300
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2301
	    method := con method.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2302
	    (method notNil and:[method isWrapped]) ifTrue:[
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
		 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
  2305
		"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2306
		caller := con sender.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2307
		(caller notNil and:[caller receiver == method originalMethod]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2308
		    caller2 := caller sender.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2309
		    (caller2 notNil and:[caller2 method == method]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2310
			con := caller2
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2311
		    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2312
		].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2313
		caller := caller2 := nil
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
	    con := con sender
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2316
	].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2317
328
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
	 did we reach the end ?
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2320
	"
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2321
	(con isNil or:[con sender isNil]) ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2322
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2323
	     the very last one is the startup context
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2324
	     (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
  2325
	    "
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2326
	    contextArray last selector isNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2327
		contextArray removeLast.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2328
		text removeLast
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2329
	    ]
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2330
	] ifFalse:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2331
	    m notNil ifTrue:[
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2332
		m enable:#showMore.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2333
		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
  2334
	    ].
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2335
	].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2336
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2337
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2338
    contextView setList:text.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2339
    releaseInspectors ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2340
	receiverInspector release.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2341
	contextInspector release.
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2342
    ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2343
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2344
    m notNil ifTrue:[
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2345
	m disable:#removeBreakpoint.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2346
	m disable:#implementors.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2347
	m disable:#senders.
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2348
	m disable:#browseClass.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2349
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2350
    ^ true
300
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2351
027ffcadd12d keep context in lower-right inspector when single stepping
Claus Gittinger <cg@exept.de>
parents: 299
diff changeset
  2352
    "Created: 14.12.1995 / 19:10:31 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2353
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2354
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2355
setContextSkippingInterruptContexts:aContext
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2356
    "show calling chain from aContext in the walk-back listview.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2357
     Ignore any non-interresting interrupt-context."
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2358
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2359
    |con|
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2360
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2361
    con := aContext.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2362
    (con notNil and:[con selector == #threadSwitch:]) ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2363
        con := con sender.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2364
        (con notNil and:[con selector == #timerInterrupt]) ifTrue:[
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2365
            con := con sender.
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2366
        ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2367
    ].
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2368
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2369
    ^ self setContext:con releaseInspectors:true
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2370
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2371
    "Modified: 27.6.1996 / 17:21:59 / cg"
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2372
    "Created: 20.10.1996 / 18:10:21 / cg"
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2373
!
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2374
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2375
showError:message
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2376
    codeView contents:(resources string:message).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2377
    shown ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2378
	exclusive ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2379
	    "/ consider this a kludge:
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2380
	    "/ if exclusive, cannot use flash, since it suspends
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2381
	    "/ (but we cannot suspend here ...)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2382
	    codeView redrawInverted. device flush.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2383
	    OperatingSystem millisecondDelay:200.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2384
	    codeView redraw
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2385
	] ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2386
	    codeView flash
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2387
	]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2388
    ]
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2389
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2390
    "Modified: 24.11.1995 / 22:07:30 / cg"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2391
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2392
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2393
showTerminated
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2394
    self showError:'** the process has terminated **'
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2395
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2396
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2397
stepping 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2398
    ^ stepping 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2399
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2400
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2401
unstep 
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2402
    stepping := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2403
    bigStep := false.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2404
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2405
    exitAction := nil
781
33e4d40fddbe better stepping (stepping in methods blockContext)
Claus Gittinger <cg@exept.de>
parents: 779
diff changeset
  2406
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2407
    "Modified: 22.10.1996 / 11:59:57 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2408
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2409
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2410
updateContext
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2411
    |oldContext idx|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2412
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2413
    inspectedProcess state == #dead ifTrue:[
642
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2414
        self showTerminated.
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2415
        ^ self
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2416
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2417
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2418
    oldContext := selectedContext.
642
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2419
    [
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2420
        (self setContextSkippingInterruptContexts:inspectedProcess suspendedContext) ifTrue:[
642
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2421
            oldContext notNil ifTrue:[
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2422
                contextArray notNil ifTrue:[
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2423
                    idx := contextArray identityIndexOf:oldContext.
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2424
                    idx ~~ 0 ifTrue:[
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2425
                        self showSelection:idx
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2426
                    ] ifFalse:[
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2427
                        codeView contents:('** context returned **')
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2428
                    ]
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2429
                ]
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2430
            ]
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2431
        ].
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2432
    ] valueUninterruptably.
77e7e39f503a update context uninterruptably
Claus Gittinger <cg@exept.de>
parents: 641
diff changeset
  2433
779
0486301b79a1 use a single button for stop/continue;
Claus Gittinger <cg@exept.de>
parents: 778
diff changeset
  2434
    "Modified: 20.10.1996 / 18:11:24 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2435
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2436
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2437
!DebugView methodsFor:'private control loop'!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2438
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2439
controlLoop
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2440
    "this is a kludge:
664
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2441
        start a dispatchloop which exits when
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2442
        either continue, return or step is pressed
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2443
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2444
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2445
    haveControl := true.
664
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2446
    [
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2447
        [haveControl] whileTrue:[
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2448
            self controlLoopCatchingErrors
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2449
        ].
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2450
    ] valueNowOrOnUnwindDo:[
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2451
        catchBlock := nil.
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2452
        haveControl := false
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2453
    ].
664
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2454
f5e2b3767ea8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  2455
    "Modified: 9.7.1996 / 18:29:09 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2456
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2457
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2458
controlLoopCatchingErrors
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2459
    "this is the debuggers own private event handling loop;
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2460
     errors are cought, to prevent recursive debugger-invocations."
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2461
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2462
    "setup a self removing catch-block"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2463
    catchBlock := [catchBlock := nil. ^ nil].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2464
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2465
    (exclusive or:[windowGroup isNil]) ifTrue:[
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2466
        "if we do not have multiple processes or its a system process
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2467
         we start another dispatch loop, which exits when
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2468
         either continue, return or step is pressed
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2469
         or (via the catchBlock) if an error occurs.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2470
         Since our display is an extra exclusive one, 
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2471
         all processing for normal views stops here ...
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2472
        "
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2473
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2474
        WindowGroup setActiveGroup:windowGroup.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2475
        SignalSet anySignal handle:[:ex |
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2476
            |signal|
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2477
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2478
            signal := ex signal.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2479
            self showError:'*** Error in modal debugger:
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2480
334
00d06ac75a99 handle notifications without err'ing
ah
parents: 333
diff changeset
  2481
>>>> Signal:  ' , signal printString , '
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2482
>>>> In:      ' , ex suspendedContext printString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2483
>>>> Message: ' , ex errorString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2484
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2485
cought & ignored.'.
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2486
            ex return.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2487
        ] do:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2488
            Object userNotificationSignal handle:[:ex |
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2489
                (ex signal == ActivityNotificationSignal) ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2490
                    ex proceed
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2491
                ].
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2492
                self showError:ex errorString
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2493
            ] do:[
530
6170545e4518 show debug-state
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  2494
                device dispatchModalWhile:[Processor activeProcess state:#debug.
6170545e4518 show debug-state
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  2495
                                           haveControl].
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2496
            ]
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2497
        ].
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2498
        WindowGroup setActiveGroup:nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2499
    ] ifFalse:[
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2500
        "we do have multiple processes -
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2501
         simply enter the DebugViews-Windowgroup event loop.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2502
         effectively suspending event processing for the currently 
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2503
         active group.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2504
        "
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2505
        SignalSet anySignal handle:[:ex |
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2506
            |answer signal|
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2507
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2508
            signal := ex signal.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2509
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2510
            "/
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2511
            "/ ignore recursive breakpoints
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2512
            "/
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2513
            signal == MessageTracer breakpointSignal ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2514
                'breakpoint in debugger ignored' errorPrintNL.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2515
                ex proceed
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2516
            ].
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2517
            (signal == ActivityNotificationSignal) ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2518
                ex proceed
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2519
            ].
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2520
            signal == Exception recursiveExceptionSignal ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2521
                ex parameter signal == MessageTracer breakpointSignal ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2522
                    'recursive breakpoint in debugger ignored' errorPrintNL.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2523
                    ex proceed.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2524
                ].
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2525
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2526
                self showError:'*** Recursive error in debugger:
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2527
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2528
>>>> Signal:  ' , ex signal printString , '
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2529
>>>>          ' , ex parameter signal printString , '
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2530
>>>> In:      ' , ex suspendedContext printString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2531
>>>> Message: ' , ex errorString , '
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2532
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2533
cought & ignored.'.
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2534
                ex return
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2535
            ].
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2536
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2537
            self topView raiseDeiconified.    
328
bdfe5bbd376d ignore recursive BreakPoint invocations
Claus Gittinger <cg@exept.de>
parents: 317
diff changeset
  2538
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2539
            answer := Dialog 
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2540
                        choose:('error in debugger: ' , ex errorString , '\\debug again ?') withCRs
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2541
                        labels:#('debug' 'proceed' 'cancel' ) 
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2542
                        values:#(#debug #proceed #cancel) 
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2543
                        default:#cancel.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2544
            answer == #debug ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2545
                Debugger enterUnconditional:(ex suspendedContext) withMessage:'error in debugger: ' , ex errorString.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2546
                ex proceed.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2547
            ].
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2548
            answer == #proceed ifTrue:[
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2549
                ex proceed.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2550
            ].
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2551
            ex return.
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2552
        ] do:[
530
6170545e4518 show debug-state
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  2553
            windowGroup eventLoopWhile:[Processor activeProcess state:#debug.
6170545e4518 show debug-state
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  2554
                                        true] onLeave:[]
448
e50e23ae7dc3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
  2555
        ].
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2556
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2557
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2558
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2559
    "Created: 24.11.1995 / 20:33:45 / cg"
530
6170545e4518 show debug-state
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  2560
    "Modified: 7.5.1996 / 10:04:41 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2561
! !
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2562
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2563
!DebugView methodsFor:'user interaction'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2564
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2565
codeAccept:someCode
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2566
    "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
  2567
     and including selected method cannot be continued."
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2568
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2569
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2570
     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
  2571
     executed correctly - however, the code shown in the debugger is no
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2572
     longer in sync (showing the new code) with the executed code.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2573
     Therefore, we hide those contexts to avoid confusion ....
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2574
     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
  2575
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2576
    "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
  2577
     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
  2578
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2579
    |con top sel implementorClass method newMethod|
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2580
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2581
    codeView cursor:Cursor execute.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2582
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2583
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2584
     find the method-home context for this one
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2585
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2586
    con := selectedContext.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2587
    top := con.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2588
    [con notNil] whileTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2589
	(con methodHome == selectedContext) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2590
	    top := con
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2591
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2592
	con := con sender
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2593
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2594
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2595
     use class&selector to find the method for the compilation
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2596
     and compile.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2597
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2598
    sel := selectedContext selector.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2599
    implementorClass := selectedContext methodClass.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2600
    method := implementorClass compiledMethodAt:sel.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2601
    newMethod := implementorClass compilerClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2602
			 compile:someCode
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2603
			 forClass:implementorClass
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2604
			 inCategory:(method category)
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2605
			 notifying:codeView.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2606
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2607
    inspecting ifFalse:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2608
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2609
	 if it worked, remove everything up to and including top
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2610
	 from context chain
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2611
	"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2612
	(newMethod notNil and:[newMethod ~~ #Error]) ifTrue:[
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2613
	    self setContext:(top sender).
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2614
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2615
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2616
	     continue/step is no longer possible
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2617
	    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2618
	    canContinue := false.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2619
	    self showSelection:1.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2620
	    exitAction := #return
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2621
	].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2622
    ].
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2623
    codeView cursor:Cursor normal
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2624
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2625
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2626
destroy
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2627
    "closing the debugger implies an abort or continue"
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2628
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2629
    contextView middleButtonMenu hide.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2630
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2631
    inspecting ifFalse:[
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2632
        CachedExclusive == self ifTrue:[
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2633
            CachedExclusive := nil.
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2634
        ].
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2635
        CachedDebugger == self ifTrue:[
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2636
            CachedDebugger := nil
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2637
        ].
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2638
669
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2639
        "/
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2640
        "/ catch invalid return;
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2641
        "/ this happens, when my process has somehow died (quickterminate)
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2642
        "/ and I am a leftOver view, which gets terminated via the launchers
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2643
        "/ #destroy-window function.
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2644
        "/
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2645
        Context invalidReturnSignal handle:[:ex |
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2646
            'DEBUGGER: OOPS - non regular debugView closing' infoPrintCR.
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2647
            DebugView newDebugger.
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2648
            ex return.
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2649
        ] do:[
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2650
            inspecting ifFalse:[
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2651
                canAbort ifTrue:[
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2652
                    self doAbort.
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2653
                ] ifFalse:[
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2654
                    self doContinue
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2655
                ]
4ac860cdf673 care for quickterminated processes in destroy
Claus Gittinger <cg@exept.de>
parents: 664
diff changeset
  2656
            ].
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2657
        ].
554
0f8303e1fdfd printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 545
diff changeset
  2658
        'DEBUGGER: OOPS - non regular debugView closing' infoPrintCR.
430
45d1b89689a0 when destroyed (via Launchers menu) dont halt - output a debugMessage
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  2659
        DebugView newDebugger.
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2660
    ].
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2661
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2662
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2663
     we manually release all private data, since the Debugger
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2664
     is cached for reuse - thus the memory would not be collectable
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2665
     otherwise.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2666
    "
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2667
    codeView acceptAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2668
    codeView doItAction:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2669
    codeView contents:nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2670
    catchBlock := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2671
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2672
    receiverInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2673
    contextInspector release.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2674
    inspectedProcess := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2675
    exitAction := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2676
    contextArray := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2677
    selectedContext := actualContext := nil.
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2678
    steppedContext := wrapperContext := nil.
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2679
    grabber := nil.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2680
    self autoUpdateOff.
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2681
407
cf196c7cd2e6 oops - simply closing debugger lead to corrupted leftovers
Claus Gittinger <cg@exept.de>
parents: 384
diff changeset
  2682
    super destroy    "/ 1.12.94
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2683
788
26d452e40e52 care for wrappedMethods exit-blocks, when singleStepping
Claus Gittinger <cg@exept.de>
parents: 787
diff changeset
  2684
    "Modified: 22.10.1996 / 12:00:00 / cg"
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2685
!
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2686
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2687
showSelection:lineNr
301
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2688
    "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
  2689
     Also sent to autoselect an interesting context on entry."
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2690
56
d0cb937cbcaa *** empty log message ***
claus
parents: 55
diff changeset
  2691
    |con homeContext sel method code canAccept
105
claus
parents: 101
diff changeset
  2692
     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
  2693
     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
  2694
     mthd cls w|
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2695
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2696
    contextArray notNil ifTrue:[
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2697
        lineNr <= contextArray size ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2698
            con := contextArray at:lineNr.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2699
        ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2700
        "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2701
         clicking on the '** ...'-line shows more ...
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2702
        "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2703
        con isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2704
            line := contextView list at:lineNr.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2705
            (line startsWith:'**') ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2706
                self showMore.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2707
                contextView setSelection:lineNr.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2708
                con := contextArray at:lineNr
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2709
            ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2710
            con isNil ifTrue:[^ self].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2711
        ].
105
claus
parents: 101
diff changeset
  2712
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2713
        self withWaitCursorDo:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2714
            "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2715
             give it to the (lower right) inspector
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2716
            "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2717
            contextInspector inspect:con.
105
claus
parents: 101
diff changeset
  2718
646
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2719
            con hasStackToShow ifTrue:[
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2720
                stackInspector isNil ifTrue:[
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2721
                    receiverInspector origin:(0.0 @ 0.0) corner:0.3 @ 1.0.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2722
                    contextInspector origin:(0.3 @ 0.0) corner:(0.6 @ 1.0).
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2723
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2724
                    stackInspector := InspectorView
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2725
                                        origin:(0.6 @ 0.0) corner:(1.0 @ 1.0)
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2726
                                        in:contextInspector superView.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2727
                    stackInspector realize.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2728
                    stackInspector label:'stack'.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2729
                    stackInspector hideReceiver:true.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2730
                ].
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2731
                stackInspector inspect:(con stackFrame asArray).
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2732
                stackInspector showLast.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2733
            ] ifFalse:[
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2734
                stackInspector notNil ifTrue:[
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2735
                    stackInspector destroy.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2736
                    stackInspector := nil.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2737
                    receiverInspector origin:(0.0 @ 0.0) corner:0.5 @ 1.0.
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2738
                    contextInspector origin:(0.5 @ 0.0) corner:(1.0 @ 1.0).
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2739
                ]
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2740
            ].
04dafb2560bf added labels 'receiver' & 'context';
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
  2741
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2742
            "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2743
             get the home context
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2744
            "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2745
            con isBlockContext ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2746
                homeContext := con methodHome
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2747
            ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2748
                homeContext := con
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2749
            ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2750
            con canReturn ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2751
                returnButton enable. restartButton enable.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2752
            ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2753
                returnButton disable. restartButton disable.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2754
            ].
105
claus
parents: 101
diff changeset
  2755
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2756
            lineNrInMethod := con lineNumber.
105
claus
parents: 101
diff changeset
  2757
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2758
            canAccept := false.
105
claus
parents: 101
diff changeset
  2759
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2760
            homeContext isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2761
                "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2762
                 mhmh - an optimized block
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2763
                 should get the block here, and get the method from
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2764
                 that one ...
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2765
                 But in 2.10.x, there is no easy way to get to the block
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2766
                 since that one is not in the context.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2767
                 Starting with 2.11, the new block calling scheme will fix this.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2768
                "
105
claus
parents: 101
diff changeset
  2769
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2770
                "temporary kludge - peek into the sender context.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2771
                 If its a do-like method and there is a single block variable 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2772
                 in the args or temporaries, that must be the one.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2773
                 This helps in some cases.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2774
                "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2775
                (sender := con sender) notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2776
                    tryVars := false.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2777
                    (selSender := sender selector) notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2778
                        (selSender endsWith:'do:') ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2779
                            tryVars := true.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2780
                        ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2781
                            (selSender endsWith:'Do:') ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2782
                                tryVars := true.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2783
                            ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2784
                        ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2785
                    ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2786
                    tryVars ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2787
                        possibleBlocks := sender argsAndVars select:[:v | v isBlock].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2788
                        possibleBlocks := possibleBlocks select:[:b | b home isNil].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2789
                        possibleBlocks size == 1 ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2790
                            method := possibleBlocks first method.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2791
                        ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2792
                    ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2793
                ].
105
claus
parents: 101
diff changeset
  2794
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2795
            ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2796
                "fetch rec here - so we wont need context in doItAction"
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2797
                rec := homeContext receiver.
105
claus
parents: 101
diff changeset
  2798
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2799
                sel := homeContext selector.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2800
                sel notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2801
                    canAccept := true.
56
d0cb937cbcaa *** empty log message ***
claus
parents: 55
diff changeset
  2802
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2803
                    implementorClass := homeContext methodClass.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2804
                    implementorClass isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2805
                        "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2806
                         special: look if this context was created by
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2807
                         valueWithReceiver kind of method invocation;
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2808
                         if so, grab the method from the sender and show it
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2809
                        "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2810
                        ((sender := con sender) notNil
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2811
                        and:[(sender selector startsWith:'valueWithReceiver:')
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2812
                        and:[sender receiver isMethod]]) ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2813
                            method := sender receiver.
655
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2814
                            self sensor shiftDown ifTrue:[
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2815
                                code := method decompiledSource
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2816
                            ] ifFalse:[
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2817
                                code := method source.
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2818
                            ].
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2819
                            canAccept := false.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2820
                        ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2821
                            (method := con method) notNil ifTrue:[
655
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2822
                                self sensor shiftDown ifTrue:[
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2823
                                    code := method decompiledSource
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2824
                                ] ifFalse:[
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2825
                                    code := method source.
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2826
                                ].
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2827
                                canAccept := false.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2828
                            ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2829
                        ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2830
                    ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2831
                        method := implementorClass compiledMethodAt:sel.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2832
                    ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2833
                ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2834
            ].
105
claus
parents: 101
diff changeset
  2835
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2836
            code isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2837
                errMsg := nil.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2838
                method notNil ifTrue:[
655
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2839
                    self sensor shiftDown ifTrue:[
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2840
                        code := method decompiledSource
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2841
                    ] ifFalse:[
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2842
                        code := method source.
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2843
                    ].
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2844
                    code isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2845
                        method sourceFilename notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2846
                            codeView contents:(resources 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2847
                                                       string:'** no sourcefile: %1 **'
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2848
                                                       with:method sourceFilename).
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2849
                            codeView flash
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2850
                        ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2851
                            errMsg := '** no source **'
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2852
                        ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2853
                    ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2854
                ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2855
                    homeContext isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2856
                        errMsg := '** sorry; cannot show code of all optimized blocks (yet) **'.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2857
                    ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2858
                        errMsg := '** no method - no source **'
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2859
                    ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2860
                ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2861
                errMsg notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2862
                   self showError:errMsg
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2863
                ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2864
            ].
105
claus
parents: 101
diff changeset
  2865
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2866
            code isNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2867
                canAccept := false.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2868
            ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2869
                codeView contents:code.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2870
                (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
  2871
"/                    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
  2872
"/                        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
  2873
"/                    ].
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2874
"/                    codeView selectLine:lineNrInMethod.
cd15cb77e4b6 show wait cursor while accessing sources (may take long with CVS)
Claus Gittinger <cg@exept.de>
parents: 300
diff changeset
  2875
"/                    codeView makeSelectionVisible
132
claus
parents: 127
diff changeset
  2876
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2877
                    lineNrInMethod <= codeView list size ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2878
                        (lineNrInMethod == 255 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2879
                        and:[method notNil
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2880
                        and:[method code isNil]]) ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2881
                            "/ means: do not really know in interpreted methods
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2882
                            codeView selectFromLine:255 col:1 toLine:codeView list size + 1 col:0.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2883
                        ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2884
                            codeView selectLine:lineNrInMethod.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2885
                        ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2886
                        codeView makeSelectionVisible
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2887
                    ]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2888
                ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2889
            ].
105
claus
parents: 101
diff changeset
  2890
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2891
            canAccept ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2892
                codeView acceptAction:[:code | self codeAccept:code asString]
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2893
            ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2894
                codeView acceptAction:nil.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2895
            ].
105
claus
parents: 101
diff changeset
  2896
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2897
            receiverInspector inspect:rec.
105
claus
parents: 101
diff changeset
  2898
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2899
            "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2900
             the one below is wrong: currently, the
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2901
             evaluator cannot handle passed contexts.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2902
             Once it does, pass con as in:-arg
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2903
            "
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2904
            codeView doItAction:[:theCode |
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2905
                             rec class evaluatorClass 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2906
                                 evaluate:theCode 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2907
                                 in:nil            "/ *** con
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2908
                                 receiver:rec 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2909
                                 notifying:codeView 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2910
                                 logged:true 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2911
                                 ifFail:nil 
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2912
            ].
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2913
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2914
            selectedContext := homeContext.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2915
            actualContext := con
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2916
        ].
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2917
    ].
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2918
654
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2919
    con isContext ifFalse:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2920
        sendButton disable.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2921
    ] ifTrue:[
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2922
        sendButton enable.
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2923
    ].
dac2634ce5ec better support for alien context single stepping
Claus Gittinger <cg@exept.de>
parents: 651
diff changeset
  2924
105
claus
parents: 101
diff changeset
  2925
    "clear out locals to prevent keeping around unneeded contexts 
claus
parents: 101
diff changeset
  2926
     (due to the block held in codeView).
claus
parents: 101
diff changeset
  2927
     (not really needed, since stuff gets collected away sooner or later ...
claus
parents: 101
diff changeset
  2928
      ... but this makes it a bit sooner)
claus
parents: 101
diff changeset
  2929
    "
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2930
    con := nil.
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2931
    homeContext := nil.
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2932
105
claus
parents: 101
diff changeset
  2933
    "
claus
parents: 101
diff changeset
  2934
     enable/disable some menu items
claus
parents: 101
diff changeset
  2935
    "
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
  2936
    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
  2937
    (m notNil and:[selectedContext notNil]) ifTrue:[
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2938
        m enableAll:#(implementors senders inspectContext skip skipForReturn).
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2939
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2940
        (method notNil and:[method isWrapped]) ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2941
            m enable:#removeBreakpoint.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2942
        ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2943
            m disable:#removeBreakpoint.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2944
        ].
193
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2945
563
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2946
        mthd := selectedContext method.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2947
        mthd notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2948
            w := mthd who.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2949
        ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2950
        m enable:#browseClass.
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2951
        w notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2952
            cls := w at:1
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2953
        ].
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2954
        cls notNil ifTrue:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2955
            m enableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol).
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2956
        ] ifFalse:[
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2957
            m disableAll:#(browse browseClass browseClassHierarchy browseFullClassProtocol).
93633e3ff304 selection: / setSelection:
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2958
        ].
29
8a72e10043f6 *** empty log message ***
claus
parents: 22
diff changeset
  2959
    ]
193
8d0b4658249c added browse-menu function; disable inappropriate menu items; fixed walkback-copy
Claus Gittinger <cg@exept.de>
parents: 189
diff changeset
  2960
655
c9a1de4e627a secret feature: if shift is pressed while selecting a context,
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
  2961
    "Modified: 3.7.1996 / 10:09:00 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
  2962
! !
e332d9c71624 *** empty log message ***
claus
parents: 69
diff changeset
  2963
778
e0f6238c9dd5 better stepping of an interrupted context.
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  2964
!DebugView class methodsFor:'documentation'!
78
037323660c45 *** empty log message ***
claus
parents: 75
diff changeset
  2965
266
8645fbd8fdb7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
  2966
version
789
a9595b71a8fa improved next-stepping in blocks
Claus Gittinger <cg@exept.de>
parents: 788
diff changeset
  2967
    ^ '$Header: /cvs/stx/stx/libtool/DebugView.st,v 1.110 1996-10-22 14:07:44 cg Exp $'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
  2968
! !