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