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