MiniDebugger.st
author Claus Gittinger <cg@exept.de>
Sat, 01 Oct 2016 17:07:17 +0200
changeset 20499 92e0c1d2ecc8
parent 20498 55a474a03da9
child 20500 4767585b42c5
permissions -rw-r--r--
#REFACTORING by cg class: MiniDebugger changed: #printAllBacktraces #printContext:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 93
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
    12
"{ Package: 'stx:libbasic' }"
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
    13
19144
2f3d50c4e256 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 18681
diff changeset
    14
"{ NameSpace: Smalltalk }"
2f3d50c4e256 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 18681
diff changeset
    15
720
f31e0e5ab6e0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 716
diff changeset
    16
Object subclass:#MiniDebugger
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
    17
	instanceVariableNames:'tracing stepping traceBlock command commandArg commandCount
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    18
		enteringContext dot nesting inputStream'
16626
bbf6b95f092f class: MiniDebugger
Stefan Vogel <sv@exept.de>
parents: 16557
diff changeset
    19
	classVariableNames:'NotFirstTimeEntered'
976
d27628f54b71 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
    20
	poolDictionaries:''
d27628f54b71 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
    21
	category:'System-Debugging-Support'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    22
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    23
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    24
!MiniDebugger class methodsFor:'documentation'!
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    25
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    26
copyright
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    27
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    28
 COPYRIGHT (c) 1988 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 93
diff changeset
    29
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    30
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    31
 This software is furnished under a license and may be used
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    32
 only in accordance with the terms of that license and with the
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    34
 be provided or otherwise made available to, or used by, any
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    35
 other person.  No title to or ownership of the software is
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    36
 hereby transferred.
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    37
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    38
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    39
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    40
documentation
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    41
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    42
    a primitive (non graphical) debugger for use on systems without
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    43
    graphics or when the real debugger dies (i.e. an error occurs in
15927
65b8082c8e68 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15861
diff changeset
    44
    the graphical debugger or the UI/event handler is broken).
65b8082c8e68 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15861
diff changeset
    45
    Also, if an interrupt occurs within the debuger, this one is called for.
65b8082c8e68 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15861
diff changeset
    46
    Needs a console.
1297
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
    47
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
    48
    MiniDebugger enter
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
    49
1297
073d4d41ba0f documentation
Claus Gittinger <cg@exept.de>
parents: 976
diff changeset
    50
    [author:]
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
    51
	Claus Gittinger
89
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    52
"
7be0b86ef80f *** empty log message ***
claus
parents: 74
diff changeset
    53
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    54
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    55
!MiniDebugger class methodsFor:'instance creation'!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    56
11534
feb71ed68875 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11235
diff changeset
    57
enter
feb71ed68875 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11235
diff changeset
    58
    "enter a miniDebugger"
feb71ed68875 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11235
diff changeset
    59
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
    60
    ^ self
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    61
        enter:thisContext sender
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    62
        withMessage:'MiniDebugger'
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    63
        mayProceed:true
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    64
        input:nil
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    65
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    66
    "
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    67
     MiniDebugger enter
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    68
    "
11534
feb71ed68875 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11235
diff changeset
    69
!
feb71ed68875 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11235
diff changeset
    70
4572
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
    71
enter:aContext withMessage:aString mayProceed:mayProceed
3814
1227e4690753 allow aborting other threads
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
    72
    "enter a miniDebugger"
1227e4690753 allow aborting other threads
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
    73
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    74
    ^ self 
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    75
        enter:aContext 
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    76
        withMessage:aString 
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    77
        mayProceed:mayProceed 
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    78
        input:nil
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    79
!
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    80
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    81
enter:aContext withMessage:aString mayProceed:mayProceed input:inputStreamOrNil
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    82
    "enter a miniDebugger"
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    83
7839
d6d9fac8b4db skip recursive contexts when shwing backtrace
Claus Gittinger <cg@exept.de>
parents: 7706
diff changeset
    84
    |active con sender|
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    85
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    86
    StepInterruptPending := nil.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    87
7093
60bad14d38fc Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 6938
diff changeset
    88
    Error handle:[:ex |
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    89
        ex return
2661
fea131f9f062 care for recursive errors in MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 2118
diff changeset
    90
    ] do:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    91
        thisContext isRecursive ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    92
            "/ 'recursive lowLevelError in debugger ignored' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    93
            ^ self
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    94
        ].
14798
a31ff766419e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14797
diff changeset
    95
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    96
        aString lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    97
        Processor notNil ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
    98
            active := Processor activeProcess.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
    99
            'process: id=' lowLevelErrorPrint. active id lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   100
            ' name=' lowLevelErrorPrint. active name lowLevelErrorPrintCR.
4960
a047d70c18f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 4572
diff changeset
   101
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   102
            'context: ' lowLevelErrorPrint. aContext printString lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   103
            (con := aContext) notNil ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   104
                con := con sender.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   105
                ' ......: ' lowLevelErrorPrint. con printString lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   106
                [con notNil] whileTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   107
                    sender := con sender.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   108
                    (sender notNil and:[sender selector == con selector]) ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   109
                        ' ......: ' lowLevelErrorPrint. sender printString lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   110
                        ' ......:  [** intermediate recursive contexts skipped **]' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   111
                        [sender notNil
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   112
                         and:[sender selector == con selector
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   113
                         and:[sender method == con method]]] whileTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   114
                            con := sender.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   115
                            sender := con sender.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   116
                        ].
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   117
                    ].
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   118
                    con := sender.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   119
                    ' ......: ' lowLevelErrorPrint. con printString lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   120
                ]
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   121
            ]
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   122
        ].
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   123
        NotFirstTimeEntered ~~ true ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   124
            NotFirstTimeEntered := true.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   125
            'Type "c" to proceed, "?" for help' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   126
        ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   127
    ].
4209
7c1b4df9e555 care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents: 4003
diff changeset
   128
7c1b4df9e555 care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents: 4003
diff changeset
   129
    OperatingSystem hasConsole ifFalse:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   130
        Error handle:[:ex |
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   131
            ex return
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   132
        ] do:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   133
            self warn:('Unexpected lowLevelError:\' , aString , '\\No MiniDebugger functionality available') withCRs .
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   134
        ].
4209
7c1b4df9e555 care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents: 4003
diff changeset
   135
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   136
        Error handle:[:ex |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   137
            'cannot raise Abort - exiting ...' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   138
            OperatingSystem exit:10.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   139
        ] do:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   140
            AbortOperationRequest raise.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   141
        ]
4209
7c1b4df9e555 care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents: 4003
diff changeset
   142
    ] ifTrue:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   143
        self new 
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   144
            inputStream:inputStreamOrNil;
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   145
            enter:aContext mayProceed:mayProceed.
4209
7c1b4df9e555 care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents: 4003
diff changeset
   146
    ].
4961
5419c9a32316 abort after unproceedable error
Stefan Vogel <sv@exept.de>
parents: 4960
diff changeset
   147
    mayProceed ifFalse:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   148
        AbortOperationRequest raise
4961
5419c9a32316 abort after unproceedable error
Stefan Vogel <sv@exept.de>
parents: 4960
diff changeset
   149
    ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   150
    ^ nil
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   151
4209
7c1b4df9e555 care for noConsole present (WIN32 only)
Claus Gittinger <cg@exept.de>
parents: 4003
diff changeset
   152
    "Modified: / 19.5.1999 / 18:14:33 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   153
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   154
11235
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   155
enterException:ex
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   156
    "enter a debugger; if this is a recursive invocation, enter
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   157
     a MiniDebugger instead.
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   158
     This is the standard way of entering the debugger;
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   159
     sent from error- and halt messages."
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   160
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   161
    ^ self
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   162
        enter:ex returnableSuspendedContext
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   163
        withMessage:(ex creator name,': ',ex descriptionForDebugger)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   164
        mayProceed:(ex mayProceed)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   165
        input:nil
11235
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   166
!
48c4b0d76bad +enterException
Claus Gittinger <cg@exept.de>
parents: 11060
diff changeset
   167
4572
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   168
enterWithMessage:aString mayProceed:mayProceed
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   169
    "enter a miniDebugger"
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   170
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   171
    ^ self
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   172
        enter:thisContext sender
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   173
        withMessage:aString
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   174
        mayProceed:mayProceed
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   175
        input:nil
4572
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   176
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   177
    "Modified: / 19.5.1999 / 18:14:33 / cg"
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   178
!
79f02c7c9b75 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4535
diff changeset
   179
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   180
new
3814
1227e4690753 allow aborting other threads
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
   181
    "redefined to make certain that there is only one miniDebugger
1227e4690753 allow aborting other threads
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
   182
     in the system"
1227e4690753 allow aborting other threads
Claus Gittinger <cg@exept.de>
parents: 3769
diff changeset
   183
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   184
    ^ self basicNew initialize.
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   185
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   186
"/    TheOneAndOnlyDebugger isNil ifTrue:[
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   187
"/        TheOneAndOnlyDebugger := self basicNew initialize
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   188
"/    ].
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   189
"/    ^ TheOneAndOnlyDebugger
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   190
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   191
    "
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   192
     TheOneAndOnlyDebugger := nil
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   193
    "
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   194
3701
0842b63bac1d renamed p command to l.
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   195
    "Modified: / 31.7.1998 / 17:08:07 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   196
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   197
4966
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   198
openOn:aProcess
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   199
    "enter a miniDebugger"
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   200
8840
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   201
    ^ self
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   202
        enter:thisContext sender
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   203
        withMessage:'MiniDebugger [info]: Attention - process debugging not possible.'
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   204
        mayProceed:true
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   205
        input:nil
4966
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   206
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   207
    "Modified: / 19.5.1999 / 18:14:33 / cg"
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   208
!
1dd6c30ad297 Implement #openOn:
Stefan Vogel <sv@exept.de>
parents: 4961
diff changeset
   209
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   210
singleStep:aBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   211
    |aDebugger|
a27a279701f8 Initial revision
claus
parents:
diff changeset
   212
a27a279701f8 Initial revision
claus
parents:
diff changeset
   213
    aDebugger := self new stepping.
241
6f30be88e314 *** empty log message ***
claus
parents: 216
diff changeset
   214
    ObjectMemory stepInterruptHandler:aDebugger.
2
claus
parents: 1
diff changeset
   215
    ObjectMemory flushInlineCaches.
241
6f30be88e314 *** empty log message ***
claus
parents: 216
diff changeset
   216
    StepInterruptPending := 1.
6f30be88e314 *** empty log message ***
claus
parents: 216
diff changeset
   217
    InterruptPending := 1.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   218
    aBlock value.
2
claus
parents: 1
diff changeset
   219
    StepInterruptPending := nil.
claus
parents: 1
diff changeset
   220
    ObjectMemory stepInterruptHandler:nil
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   221
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   222
a27a279701f8 Initial revision
claus
parents:
diff changeset
   223
trace:aBlock
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   224
    self trace:aBlock with:[:where | where lowLevelErrorPrintCR]
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   225
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   226
    "Modified: 20.5.1996 / 10:27:37 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   227
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   228
a27a279701f8 Initial revision
claus
parents:
diff changeset
   229
trace:aBlock on:aStream
a27a279701f8 Initial revision
claus
parents:
diff changeset
   230
    self trace:aBlock with:[:where | where printString printOn:aStream.
159
514c749165c3 *** empty log message ***
claus
parents: 93
diff changeset
   231
				     aStream cr]
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   232
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   233
a27a279701f8 Initial revision
claus
parents:
diff changeset
   234
trace:aBlock with:aTraceBlock
a27a279701f8 Initial revision
claus
parents:
diff changeset
   235
    |aDebugger|
a27a279701f8 Initial revision
claus
parents:
diff changeset
   236
a27a279701f8 Initial revision
claus
parents:
diff changeset
   237
    aDebugger := self new tracingWith:aTraceBlock.
241
6f30be88e314 *** empty log message ***
claus
parents: 216
diff changeset
   238
    ObjectMemory stepInterruptHandler:aDebugger.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   239
    ObjectMemory flushInlineCaches.
241
6f30be88e314 *** empty log message ***
claus
parents: 216
diff changeset
   240
    StepInterruptPending := 1.
6f30be88e314 *** empty log message ***
claus
parents: 216
diff changeset
   241
    InterruptPending := 1.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   242
    aBlock value.
2
claus
parents: 1
diff changeset
   243
    ObjectMemory stepInterruptHandler:nil.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   244
    StepInterruptPending := nil.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   245
    ^ nil
a27a279701f8 Initial revision
claus
parents:
diff changeset
   246
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   247
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   248
!MiniDebugger methodsFor:'accessing'!
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   249
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   250
inputStream:aStream
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   251
    "if non-nil, the debugger will read its input from there.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   252
     This allows for a miniDebugger to be used in a telnet stream (scripting)"
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   253
     
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   254
    inputStream := aStream.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   255
! !
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   256
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   257
!MiniDebugger methodsFor:'entering'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   258
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   259
enter:aContext mayProceed:mayProceed
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   260
    "regular entry, via unhandled exception"
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   261
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   262
    |c leaveCmd stillHere yesNo|
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   263
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   264
    Display notNil ifTrue:[
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   265
        Display ungrabKeyboard; ungrabPointer.
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   266
    ].
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   267
    
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   268
    enteringContext := dot := aContext.
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   269
    nesting := 0.
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   270
    c := aContext.
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   271
    [c notNil] whileTrue:[
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   272
        c selector == #enter:mayProceed: ifTrue:[
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   273
            nesting := nesting + 1.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   274
        ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   275
        c := c sender.
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   276
    ].
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   277
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   278
    stillHere := true.
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   279
    [stillHere] whileTrue:[
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   280
        AbortOperationRequest handle:[:ex |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   281
            '** Abort caught - back in previous debugLevel' lowLevelErrorPrintCR.
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   282
        ] do:[
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   283
            Error handle:[:ex |
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   284
                StreamError handle:[:ex|
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   285
                    "You won't see this probably - but you will see it when doing a syscall trace"
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   286
                    'Error while processing lowLevelError in MiniDebugger (Stdout closed?):' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   287
                    ex description lowLevelErrorPrintCR.
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   288
                    OperatingSystem exit:10.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   289
                ] do:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   290
                    'Error while executing MiniDebugger command: ' lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   291
                    ex description lowLevelErrorPrintCR.
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   292
                    yesNo := self getCommand:'- (i)gnore / (p)roceed / (d)ebug / b(acktrace) ? '.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   293
                    yesNo == $d ifTrue:[
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   294
                        MiniDebugger enterWithMessage:'Debugging debugger' mayProceed:true.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   295
                        ex proceed
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   296
                    ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   297
                    yesNo == $p ifTrue:[
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   298
                        ex proceed
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   299
                    ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   300
                    yesNo == $b ifTrue:[
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   301
                        ex suspendedContext fullPrintAll.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   302
                        ex proceed
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   303
                    ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   304
                ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   305
            ] do:[
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   306
                [
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   307
                    leaveCmd := self commandLoop.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   308
                ] valueUnpreemptively.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   309
            ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   310
        ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   311
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   312
        (leaveCmd == $s) ifTrue: [
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   313
            self stepping.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   314
            ObjectMemory flushInlineCaches.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   315
            ObjectMemory stepInterruptHandler:self.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   316
            stillHere := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   317
            StepInterruptPending := 1.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   318
            InterruptPending := 1
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   319
        ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   320
        (leaveCmd == $t) ifTrue: [
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   321
            traceBlock := [:where | self printContext:where].
19148
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   322
            ObjectMemory flushInlineCaches.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   323
            ObjectMemory stepInterruptHandler:self.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   324
            stillHere := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   325
            StepInterruptPending := 1.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   326
            InterruptPending := 1
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   327
        ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   328
        (leaveCmd == $c) ifTrue: [
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   329
            traceBlock := nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   330
            ObjectMemory flushInlineCaches.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   331
            ObjectMemory stepInterruptHandler:nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   332
            stillHere := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   333
            stepping := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   334
            tracing := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   335
            StepInterruptPending := nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   336
            InterruptPending := nil
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   337
        ].
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   338
        ((leaveCmd == $a) or:[(leaveCmd == $Y)]) ifTrue: [
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   339
            "abort"
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   340
            traceBlock := nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   341
            ObjectMemory flushInlineCaches.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   342
            ObjectMemory stepInterruptHandler:nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   343
            stepping := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   344
            tracing := false.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   345
            StepInterruptPending := nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   346
            InterruptPending := nil.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   347
            self doAbort.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   348
            stillHere := true.
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   349
            "failed abort"
705da493d1e9 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19147
diff changeset
   350
        ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   351
    ].
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   352
    enteringContext := dot := nil.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   353
    ^ nil
3769
e165c2b17d28 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3701
diff changeset
   354
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   355
    "Modified (comment): / 29-09-2011 / 09:05:57 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   356
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   357
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   358
stepInterrupt
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   359
    "entry via single stepinterrupt"
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   360
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   361
    |where|
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   362
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   363
    where := thisContext.        "where is stepInterrupt context"
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   364
    where notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   365
        where := where sender    "where is now interrupted methods context"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   366
    ].
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   367
    stepping ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   368
        where notNil ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   369
            self printContext:where
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   370
        ] ifFalse:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   371
            'stepInterrupt: no context' lowLevelErrorPrintCR
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   372
        ].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   373
        self enter:where mayProceed:true
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   374
    ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   375
        where notNil ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   376
            traceBlock notNil ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   377
                traceBlock value:where
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   378
            ]
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   379
        ] ifFalse:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   380
            'traceInterrupt: no context' lowLevelErrorPrintCR
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   381
        ].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   382
        ObjectMemory flushInlineCaches.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   383
        StepInterruptPending := 1.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   384
        InterruptPending := 1
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   385
    ]
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   386
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   387
    "Modified: / 20-05-1996 / 10:23:11 / cg"
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   388
    "Modified (comment): / 29-09-2011 / 09:06:29 / cg"
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   389
! !
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   390
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   391
!MiniDebugger methodsFor:'initialization'!
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   392
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   393
initialize
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   394
    traceBlock := nil.
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   395
    tracing := false.
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   396
    stepping := false
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   397
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
   398
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   399
!MiniDebugger methodsFor:'private'!
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   400
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   401
findContext:aSelector
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   402
    |con|
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   403
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   404
    con := thisContext sender.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   405
    [con notNil] whileTrue:[
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   406
	(con isBlockContext not and:[con selector == aSelector]) ifTrue:[
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   407
	    "got it"
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   408
	    ^ con
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   409
	].
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   410
	con := con sender
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   411
    ].
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   412
    ^ nil
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   413
!
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   414
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
   415
garbageCollectCommand:id
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
   416
    id == 3 ifTrue:[
8840
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   417
	ObjectMemory reclaimSymbols.
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   418
	ObjectMemory compressOldSpace.
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
   419
    ] ifFalse:[
8840
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   420
	id == 2 ifTrue:[
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   421
	    ObjectMemory reclaimSymbols.
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   422
	] ifFalse:[
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   423
	    ObjectMemory garbageCollect.
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   424
	]
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
   425
    ]
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
   426
!
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
   427
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   428
getCharacter
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   429
    inputStream isNil ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   430
        "/ globally blocking
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   431
        ^ Character fromUser
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   432
    ].
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   433
    ^ inputStream next
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   434
!
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   435
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   436
getContext
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   437
    |backtrace|
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   438
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   439
    backtrace := thisContext.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   440
    (backtrace notNil) ifTrue: [
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   441
	[backtrace selector ~~ #commandLoop] whileTrue:[
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   442
	    backtrace := backtrace sender.
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   443
	].
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   444
	"remove Debugger commandLoop frame"
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   445
	backtrace := backtrace sender.
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   446
	"remove Debugger enter frame"
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   447
	backtrace := backtrace sender
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   448
    ].
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   449
    ^ backtrace
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   450
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   451
    "Modified: / 29-09-2011 / 09:00:14 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   452
!
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   453
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   454
moveDotDown
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   455
    "/ sigh - must search
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   456
    |c|
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   457
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   458
    c := enteringContext.
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   459
    [ c notNil and:[ c sender ~~ dot ] ] whileTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   460
        c := c sender.
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   461
    ].
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   462
    c notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   463
        dot := c.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   464
        "/ dot fullPrint.
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   465
    ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   466
        '** dot is the bottom of the calling chain' lowLevelErrorPrintCR.
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   467
    ].
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   468
!
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   469
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   470
moveDotUp
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   471
    dot sender notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   472
        dot := dot sender.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   473
        "/ dot fullPrint.
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   474
    ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   475
        '** dot is the top of the calling chain' lowLevelErrorPrintCR.
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   476
    ].
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   477
!
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   478
2772
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
   479
printBacktraceFrom:aContext
4003
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   480
    |context n|
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   481
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   482
    aContext isNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   483
        'no context' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   484
        ^ self
4003
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   485
    ].
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   486
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   487
    context := aContext.
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   488
    n := commandCount.
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   489
    [context notNil] whileTrue: [
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   490
        self printContext:context.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   491
        context := context sender.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   492
        n notNil ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   493
            n := n - 1.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   494
            n <= 0 ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   495
                ^ self
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   496
            ]
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   497
        ]
2772
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
   498
    ]
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
   499
!
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
   500
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   501
printContext:aContext
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   502
    "print the receiver, selector and args of the context"
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   503
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   504
    "/ aContext fullPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   505
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   506
    aContext receiverPrintString lowLevelErrorPrint. ' ' lowLevelErrorPrint. 
20499
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
   507
    aContext selector asString lowLevelErrorPrint.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   508
    aContext argumentCount ~~ 0 ifTrue: [
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   509
        ' ' lowLevelErrorPrint. aContext argsDisplayString lowLevelErrorPrint
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   510
    ].
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   511
    ' [' lowLevelErrorPrint. 
20499
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
   512
    aContext lineNumber asString lowLevelErrorPrint. 
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   513
    ']' lowLevelErrorPrintCR
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   514
!
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   515
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   516
printDot
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   517
    self printContext:dot.
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   518
    '  receiver: ' lowLevelErrorPrint. dot receiver printString lowLevelErrorPrintCR.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   519
    '  selector: ' lowLevelErrorPrint. dot selector lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   520
    '  args: ' lowLevelErrorPrintCR.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   521
    dot args keysAndValuesDo:[:idx :eachArg |
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   522
        '    ' lowLevelErrorPrint. idx  printString lowLevelErrorPrint. 
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   523
        ': ' lowLevelErrorPrint. eachArg printString lowLevelErrorPrintCR.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   524
    ].
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   525
    '  vars: ' lowLevelErrorPrintCR.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   526
    dot vars keysAndValuesDo:[:idx :eachVar |
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   527
        '    ' lowLevelErrorPrint. idx  printString lowLevelErrorPrint. 
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   528
        ': ' lowLevelErrorPrint. eachVar printString lowLevelErrorPrintCR.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   529
    ].
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   530
!
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   531
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   532
printDotsMethodSource
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   533
    self printDotsMethodSource:false
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   534
!
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   535
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   536
printDotsMethodSource:full
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   537
    |home mthd src pcLineNr startLnr stopLnr|
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   538
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   539
    home := dot methodHome.
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   540
    mthd := home method.
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   541
    mthd isNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   542
        '** no source **' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   543
        ^ self.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   544
    ].
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   545
    src := mthd source.
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   546
    src isNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   547
        '** no source **' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   548
        ^ self.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   549
    ].
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   550
    pcLineNr := dot lineNumber.
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   551
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   552
    src := src asCollectionOfLines.
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   553
    full ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   554
        startLnr := 1.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   555
        stopLnr := src size.
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   556
    ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   557
        startLnr := pcLineNr-10 max:1.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   558
        stopLnr := pcLineNr+10 min:src size.
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   559
    ].
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   560
    startLnr to:stopLnr do:[:lNr |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   561
        lNr == pcLineNr ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   562
            '>> ' lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   563
        ] ifFalse:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   564
            '   ' lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   565
        ].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   566
        (lNr printStringLeftPaddedTo:3) lowLevelErrorPrint. ' ' lowLevelErrorPrint.
20498
55a474a03da9 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20497
diff changeset
   567
        (src at:lNr) asString lowLevelErrorPrintCR.
8717
b1d4786a1e2f more functions
Claus Gittinger <cg@exept.de>
parents: 8389
diff changeset
   568
    ]
5942
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   569
!
e3431a2c33f1 avoid statements after return
Claus Gittinger <cg@exept.de>
parents: 5921
diff changeset
   570
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   571
stepping
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   572
    traceBlock := nil.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   573
    tracing := false.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   574
    stepping := true
74
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   575
!
5fb970c7cb96 *** empty log message ***
claus
parents: 33
diff changeset
   576
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   577
tracingWith:aBlockOrNil
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   578
    traceBlock := aBlockOrNil.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   579
    stepping := false.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   580
    tracing := true
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   581
! !
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   582
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   583
!MiniDebugger methodsFor:'user commands'!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   584
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   585
commandLoop
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   586
    "read-eval commands, until one of the continue, abort or single step commands is entered;
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   587
     return the last command character"
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   588
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   589
    |cmd done|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   590
a27a279701f8 Initial revision
claus
parents:
diff changeset
   591
    done := false.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   592
    [done] whileFalse:[
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   593
	cmd := self getCommand:nil.
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   594
	cmd isNil ifTrue:[   "/ EOF is treated like continue command
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   595
	    cmd := $c
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   596
	].
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   597
	done := self doCommand:cmd.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   598
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
   599
    ^ cmd
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   600
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   601
    "Modified (comment): / 29-09-2011 / 09:02:24 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   602
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   603
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   604
doAbort
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   605
    |con sig|
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   606
6204
2bafef9151dd class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 5942
diff changeset
   607
    (sig := AbortOperationRequest) isHandled ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   608
        sig raise.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   609
        'abort raise failed' lowLevelErrorPrintCR.
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   610
    ].
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   611
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   612
    "TEMPORARY kludge - find event handler context
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   613
     this will be removed, once real debugging is possible
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   614
    "
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   615
    con := self findContext:#processEvent.
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   616
    con isNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   617
        con := self findContext:#dispatch.
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   618
    ].
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   619
    con notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   620
        "got it"
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   621
        con return.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   622
        'return failed' lowLevelErrorPrintCR.
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   623
    ].
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   624
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   625
    'found no context to resume' lowLevelErrorPrintCR.
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
   626
6204
2bafef9151dd class based exceptions - abortSignal;
Claus Gittinger <cg@exept.de>
parents: 5942
diff changeset
   627
    "Modified: / 16.11.2001 / 17:39:14 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   628
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   629
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   630
doCommand:cmd
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   631
    "a single command;
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   632
     return true, if command loop should be finished"
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   633
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   634
    |id proc bool|
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   635
15860
7952d944b767 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15859
diff changeset
   636
    commandArg notEmptyOrNil ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   637
        id := Number readFrom:commandArg onError:nil.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   638
        id notNil ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   639
            proc := Process allSubInstances detect:[:p | p id == id] ifNone:nil.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   640
            proc == Processor activeProcess ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   641
                id := proc := nil
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   642
            ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   643
        ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   644
            commandArg = '-' ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   645
                bool := false
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   646
            ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   647
                commandArg = '+' ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   648
                    bool := true
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   649
                ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   650
            ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   651
        ]
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   652
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   653
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   654
    (cmd == $w) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   655
        proc notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   656
            '-------- walkback of process ' lowLevelErrorPrint. id lowLevelErrorPrint. ' -------' lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   657
            self printBacktraceFrom:(proc suspendedContext)
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   658
        ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   659
            id notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   660
                'no process with id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   661
            ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   662
                '-------- walkback of current process -------' lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   663
                self printBacktraceFrom:(self getContext)
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   664
            ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   665
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   666
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   667
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   668
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   669
    (cmd == $b) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   670
        proc notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   671
            '-------- VM walkback of process ' lowLevelErrorPrint. id lowLevelErrorPrint. ' -------' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   672
            (Processor activeProcess environmentAt:#Stderr ifAbsent:Stderr) == Stderr ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   673
                ObjectMemory printStackBacktraceFrom:(proc suspendedContext)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   674
            ] ifFalse:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   675
                self printBacktraceFrom:(proc suspendedContext)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   676
                "/ proc suspendedContext fullPrintAllOn:(Processor activeProcess environmentAt:#Stderr)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   677
            ].    
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   678
        ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   679
            id notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   680
                'no process with id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   681
            ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   682
                '-------- VM walkback of current process -------' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   683
                (Processor activeProcess environmentAt:#Stderr ifAbsent:Stderr) == Stderr ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   684
                    ObjectMemory printStackBacktrace
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   685
                ] ifFalse:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   686
                    "/ self printBacktraceFrom:(self getContext)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   687
                    thisContext fullPrintAllOn:(Processor activeProcess environmentAt:#Stderr)
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   688
                ]
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   689
            ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   690
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   691
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   692
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   693
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   694
    (cmd == $S) ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   695
        'saving "crash.img"...' lowLevelErrorPrint.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   696
        ObjectMemory writeCrashImage.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   697
        'done.' lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   698
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   699
    ].
15859
15dc2dbf6e8f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15738
diff changeset
   700
    (cmd == $C) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   701
        |changesFilename|
15859
15dc2dbf6e8f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15738
diff changeset
   702
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   703
        changesFilename := Timestamp now
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   704
             printStringFormat:'changes_%(year)-%(month)-%(day)__%h:%m:%s.chg'.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   705
        OperatingSystem isMSWINDOWSlike ifTrue:[ changesFilename replaceAll:$: with:$_ ].
15861
3728b99e2452 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15860
diff changeset
   706
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   707
        ChangeSet current fileOutAs: changesFilename.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   708
        ('saved session changes to "',changesFilename,'".') lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   709
        ^ false
15859
15dc2dbf6e8f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15738
diff changeset
   710
    ].
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   711
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   712
    (cmd == $B) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   713
        self printAllBacktraces.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   714
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   715
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   716
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   717
    (cmd == $P) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   718
        self showProcesses:#all.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   719
        ^ false
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   720
    ].
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   721
    (cmd == $p) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   722
        self showProcesses:#live.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   723
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   724
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   725
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   726
    (cmd == $r) ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   727
        dot receiver lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   728
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   729
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   730
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   731
    (cmd == $i) ifTrue:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   732
        |inspectedObject|
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   733
        
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   734
        (commandArg ? '') withoutSeparators notEmpty ifTrue:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   735
            inspectedObject := (Parser evaluate:commandArg).
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   736
        ] ifFalse:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   737
            inspectedObject := (dot receiver).
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   738
        ].
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   739
        MiniInspector openOn:inspectedObject input:inputStream.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   740
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   741
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   742
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   743
    (cmd == $I) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   744
        self interpreterLoopWith:nil.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   745
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   746
    ].
15705
4e118b084e01 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15691
diff changeset
   747
    (cmd == $E) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   748
        Parser evaluate:commandArg.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   749
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   750
    ].
15705
4e118b084e01 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15691
diff changeset
   751
    (cmd == $e) ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   752
        (Parser evaluate:commandArg) lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   753
        ^ false
15691
80911ed523c0 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15195
diff changeset
   754
    ].
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   755
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   756
    (cmd == $c) ifTrue:[^ true].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   757
    (cmd == $s) ifTrue:[^ true].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   758
    (cmd == $t) ifTrue:[^ true].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   759
    (cmd == $a) ifTrue:[^ true].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   760
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   761
    (cmd == $u) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   762
        stepping := false.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   763
        tracing := false.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   764
        Processor activeProcess vmTrace:false.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   765
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   766
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   767
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   768
    (cmd == $h) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   769
        (bool notNil) ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   770
            Smalltalk ignoreHalt:bool not.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   771
        ].
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   772
        'halts are ' lowLevelErrorPrint. (Smalltalk ignoreHalt ifTrue:['disabled'] ifFalse:['enabled']) lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   773
        ^ false
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   774
    ].
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
   775
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   776
    (cmd == $R) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   777
        proc notNil ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   778
            proc resume.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   779
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   780
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   781
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   782
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   783
    (cmd == $T) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   784
        proc notNil ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   785
            proc terminate.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   786
        ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   787
            id notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   788
                'no process with id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   789
            ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   790
                Processor terminateActive
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   791
            ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   792
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   793
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   794
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   795
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   796
    (cmd == $W) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   797
        proc notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   798
            'stopping process id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   799
            proc stop.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   800
        ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   801
            'invalid process id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   802
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   803
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   804
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   805
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   806
    (cmd == $a) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   807
        "without id-arg, this is handled by caller"
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   808
        proc notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   809
            'aborting process id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   810
            proc interruptWith:[AbortOperationRequest raise]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   811
        ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   812
            'aborting' lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   813
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   814
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   815
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   816
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   817
    (cmd == $Q) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   818
        proc notNil ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   819
            proc terminateNoSignal.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   820
        ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   821
            id notNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   822
                'no process with id: ' lowLevelErrorPrint. id lowLevelErrorPrintCR.
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   823
            ] ifFalse:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   824
                Processor terminateActiveNoSignal
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   825
            ]
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   826
        ].
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   827
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   828
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   829
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   830
    (cmd == $g) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   831
        self garbageCollectCommand:id.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   832
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   833
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   834
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   835
    (cmd == $U) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   836
        MessageTracer unwrapAllMethods.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   837
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   838
    ].
15929
84483f64a975 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15927
diff changeset
   839
    (cmd == $D) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   840
        Breakpoint disableAllBreakpoints.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   841
        ^ false
15929
84483f64a975 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15927
diff changeset
   842
    ].
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   843
    (cmd == $X) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   844
        Smalltalk fatalAbort.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   845
        "/ not reached
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   846
        ^ false
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   847
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   848
    (cmd == $x) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   849
        OperatingSystem exit.
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   850
        "/ not reached
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   851
        ^ false
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   852
    ].
19146
29102aa35885 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19145
diff changeset
   853
    (cmd == $Y) ifTrue:[
19925
a587d23acfc7 #BUGFIX by mawalch
mawalch
parents: 19389
diff changeset
   854
        Display := nil.
19147
dc16eac48a43 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19146
diff changeset
   855
        Smalltalk openDisplay.
dc16eac48a43 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19146
diff changeset
   856
        NewLauncher open.
dc16eac48a43 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19146
diff changeset
   857
        ^ true
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   858
    ].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   859
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   860
    (cmd == $.) ifTrue:[self printDot. ^ false ].
14737
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   861
    (cmd == $l) ifTrue:[self printDotsMethodSource:false. ^ false ].
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   862
    (cmd == $L) ifTrue:[self printDotsMethodSource:true. ^ false ].
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   863
    (cmd == $-) ifTrue:[self moveDotUp. self printDot. ^ false ].
e00cd7ab5db3 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 13740
diff changeset
   864
    (cmd == $+) ifTrue:[self moveDotDown. self printDot. ^ false ].
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   865
    (cmd == $?) ifTrue:[
19145
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   866
        commandArg notEmpty ifTrue:[
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   867
            self helpOn:commandArg. ^ false
d67d8a5f23a0 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19144
diff changeset
   868
        ]
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   869
    ].
13740
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   870
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   871
    "/ avoid usage print if return was typed ...
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   872
    ((cmd == Character return)
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   873
    or:[cmd == Character linefeed]) ifTrue:[^ false].
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   874
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   875
    self showValidCommandHelp.
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   876
    ^ false.
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   877
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   878
    "Created: / 29-09-2011 / 08:58:47 / cg"
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   879
!
7a20ba6d637f refactored
Claus Gittinger <cg@exept.de>
parents: 13113
diff changeset
   880
5802
93748287026d better Mini- debugging tools (+/- context in debugger); interpreter in inspector.
Claus Gittinger <cg@exept.de>
parents: 5054
diff changeset
   881
getCommand:prompt
3126
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   882
"/    Screen notNil ifTrue:[
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   883
"/        Screen allScreens do:[:aScreen |
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   884
"/            aScreen ungrabPointer.
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   885
"/            aScreen ungrabKeyboard.
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   886
"/        ].
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   887
"/    ].
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   888
e37ccb66f1b0 onlz ungrab the main Display (remote display could be inoperable)
Claus Gittinger <cg@exept.de>
parents: 3009
diff changeset
   889
    Display notNil ifTrue:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   890
        Display ungrabPointer.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   891
        Display ungrabKeyboard.
852
5c4a0585ba0b ungrab pointer for every input
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   892
    ].
5c4a0585ba0b ungrab pointer for every input
Claus Gittinger <cg@exept.de>
parents: 720
diff changeset
   893
8840
c1de163feeb7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8721
diff changeset
   894
    (prompt
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   895
        ? (nesting == 0 ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   896
            'MiniDebugger> '
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   897
          ] ifFalse:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   898
            'MiniDebugger' , nesting printString , '>'
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   899
          ])) lowLevelErrorPrint.
93
e31220cb391f *** empty log message ***
claus
parents: 89
diff changeset
   900
7706
69afbbcd7033 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7705
diff changeset
   901
    UserInterrupt handle:[:ex |
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   902
        ex restart
159
514c749165c3 *** empty log message ***
claus
parents: 93
diff changeset
   903
    ] do:[
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   904
        |c cmd arg cnt|
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   905
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   906
        cmd := self getCharacter.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   907
        cmd isNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   908
            '<EOF>' lowLevelErrorPrintCR.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   909
            "
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   910
             mhmh end-of-file;
20420
79810aad4d09 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 19925
diff changeset
   911
             return a 'c' (for continue); hope that's ok.
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   912
            "
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   913
            cmd := $c
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   914
        ].
93
e31220cb391f *** empty log message ***
claus
parents: 89
diff changeset
   915
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   916
        cnt := nil.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   917
        (cmd isDigit) ifTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   918
            cnt := 0.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   919
            [
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   920
                cnt := (cnt * 10) + cmd digitValue.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   921
                cmd := self getCharacter
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   922
            ] doWhile:[cmd notNil and:[cmd isDigit]].
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   923
            [cmd notNil and:[cmd == Character space]] whileTrue:[
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   924
                cmd := self getCharacter
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   925
            ].
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   926
            cmd isNil ifTrue:[ '<EOF>' lowLevelErrorPrintCR ].
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   927
        ].
4003
d0f97b9cd4de added 'S' -> stopp a process
Claus Gittinger <cg@exept.de>
parents: 3814
diff changeset
   928
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   929
        "
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   930
         collect to end-of-line in arg
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   931
        "
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   932
        c := cmd.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   933
        arg := ''.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   934
        [c isNil or:[c isEndOfLineCharacter]] whileFalse: [
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   935
            arg := arg copyWith:c.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   936
            c := self getCharacter.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   937
            c isNil ifTrue:[ '<EOF>' lowLevelErrorPrintCR ].
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   938
        ].
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   939
        commandArg := (arg copyFrom:2) withoutSeparators.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   940
        command := cmd.
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
   941
        commandCount := cnt.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   942
    ].
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   943
    ^ command
976
d27628f54b71 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 940
diff changeset
   944
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
   945
    "Modified: / 31.7.1998 / 16:11:01 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   946
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
   947
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   948
helpOn:commandArg
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   949
    |args className sym val match showMethod|
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   950
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   951
    commandArg withoutSeparators isEmpty ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   952
        'usage: H className [methodPattern]' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   953
        ^self
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   954
    ].
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   955
    args := commandArg asCollectionOfWords.
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   956
    className := args first.
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   957
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   958
    (sym := className asSymbolIfInterned) isNil ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   959
        'no such class' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   960
        ^ self.
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   961
    ].
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   962
    val := Smalltalk at:sym ifAbsent:['no such class' lowLevelErrorPrintCR. ^ self.].
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   963
    val isBehavior ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   964
        'not a class: ' lowLevelErrorPrint. className lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   965
        val := val class.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   966
        'showing help for ' lowLevelErrorPrint. val name lowLevelErrorPrintCR.
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   967
    ].
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   968
    args size > 1 ifTrue:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   969
        match := args at:2
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   970
    ] ifFalse:[
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   971
        match := '*'
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   972
    ].
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   973
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
   974
    showMethod :=
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   975
        [:sel :cls |
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   976
            |mthd|
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   977
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   978
            ((match includesMatchCharacters and:[ sel matches:match caseSensitive:false])
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   979
            or:[ sel asLowercase startsWith:match asLowercase ]) ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   980
                mthd := cls compiledMethodAt:sel.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   981
                mthd category ~= 'documentation' ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   982
                    sel lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   983
                    (mthd comment ? '') asStringCollection do:[:l |
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   984
                        '    ' lowLevelErrorPrint. l withoutSeparators lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   985
                    ].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   986
                    '' lowLevelErrorPrintCR
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   987
                ].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   988
            ].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   989
        ].
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   990
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   991
    val theMetaclass selectors copy sort do:[:sel |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   992
        showMethod value:sel value:val theMetaclass
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   993
    ].
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   994
    val theNonMetaclass selectors copy sort do:[:sel |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
   995
        showMethod value:sel value:val theNonMetaclass
15195
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   996
    ].
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   997
!
e92dd9929b4f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15122
diff changeset
   998
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   999
interpreterLoopWith:anObject
16079
3eb69d91d0e4 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15930
diff changeset
  1000
    'MinDebugger read-eval-print loop; exit with "#exit"; help with "?"' printCR.
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
  1001
    ReadEvalPrintLoop new
19389
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
  1002
        doChunkFormat:false;
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
  1003
        error:(Processor activeProcess stderr);
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
  1004
        prompt:'mDBG > ';
a5eb4f53c2b4 #FEATURE
Claus Gittinger <cg@exept.de>
parents: 19149
diff changeset
  1005
        readEvalPrintLoop.
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
  1006
10630
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1007
"/    |line done rslt|
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1008
"/
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1009
"/    'read-eval-print loop; exit with empty line' printCR.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1010
"/    '' printCR.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1011
"/
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1012
"/    done := false.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1013
"/    [done] whileFalse:[
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1014
"/        '> ' print.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1015
"/
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1016
"/        line := Stdin nextLine.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1017
"/        (line size == 0) ifTrue:[
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1018
"/            done := true
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1019
"/        ] ifFalse:[
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1020
"/            "/ rslt := Compiler evaluate:line
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1021
"/            "/                  receiver:anObject
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1022
"/            "/                  notifying:nil.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1023
"/
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1024
"/            rslt := Compiler
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1025
"/                evaluate:line
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1026
"/                in:dot
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1027
"/                receiver:dot receiver
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1028
"/                notifying:self "/ nil
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1029
"/                ifFail:[].
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1030
"/            rslt printCR.
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1031
"/        ]
ea09f0304075 use REPL
Claus Gittinger <cg@exept.de>
parents: 10554
diff changeset
  1032
"/    ]
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
  1033
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
  1034
    "Modified: / 31.7.1998 / 16:01:47 / cg"
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1035
!
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1036
2772
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1037
printAllBacktraces
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1038
    Process allInstancesDo:[:p |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1039
        (p isActive not
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1040
        and:[p isDead not]) ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1041
            '---------------------------------------------------------' lowLevelErrorPrintCR.
20499
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
  1042
            '  proc id=' lowLevelErrorPrint. p id asString lowLevelErrorPrint.
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
  1043
            ' name=''' lowLevelErrorPrint. p name asString lowLevelErrorPrint.
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
  1044
            ''' createdBy: ' lowLevelErrorPrint. p creatorId asString lowLevelErrorPrint.
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
  1045
            ' state=' lowLevelErrorPrint.  p state asString lowLevelErrorPrint.
92e0c1d2ecc8 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20498
diff changeset
  1046
            ' prio=' lowLevelErrorPrint. p priority asString lowLevelErrorPrintCR.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1047
            '' lowLevelErrorPrintCR. '' lowLevelErrorPrintCR.
2772
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1048
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1049
            self printBacktraceFrom:(p suspendedContext)
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1050
        ]
2772
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1051
    ]
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1052
!
89f7289950b1 handle EOF input
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
  1053
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1054
showProcesses
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
  1055
    self showProcesses:#all
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
  1056
!
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
  1057
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
  1058
showProcesses:how
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1059
    |active|
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1060
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1061
    active := Processor activeProcess.
20497
d8b1e0c73ef5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20496
diff changeset
  1062
    'current id=' lowLevelErrorPrint. 
d8b1e0c73ef5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20496
diff changeset
  1063
    active id printString lowLevelErrorPrint. 
d8b1e0c73ef5 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20496
diff changeset
  1064
    ' name=''' lowLevelErrorPrint. active name lowLevelErrorPrint. '''' lowLevelErrorPrintCR.
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1065
16094
b62b75e28f18 class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16093
diff changeset
  1066
    (Process allSubInstances sort:[:a :b | (a id ? -1)<(b id ? -1)]) do:[:p |
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1067
        |doShow|
14797
a648fe8b3c5e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14737
diff changeset
  1068
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1069
        doShow := (how == #all).
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1070
        doShow := doShow or:[ (how == #dead) and:[ p isDead ]].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1071
        doShow := doShow or:[ (how ~~ #dead) and:[ p isDead not ]].
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1072
        doShow ifTrue:[
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1073
            'proc id=' lowLevelErrorPrint. (p id printStringPaddedTo:6) lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1074
            (p state printStringPaddedTo:10) lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1075
            ' pri=' lowLevelErrorPrint. (p priority printStringPaddedTo:2) lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1076
            ' creator:' lowLevelErrorPrint. (p creatorId printStringPaddedTo:5) lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1077
            ' group:' lowLevelErrorPrint. (p processGroupId printStringPaddedTo:5) lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1078
            ' sys:' lowLevelErrorPrint. (p isSystemProcess ifTrue:'y' ifFalse:'n') lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1079
            ' ui:' lowLevelErrorPrint. (p isGUIProcess ifTrue:'y' ifFalse:'n') lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1080
            ' name=''' lowLevelErrorPrint. p name lowLevelErrorPrint.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1081
            '''' lowLevelErrorPrintCR.
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1082
        ]
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1083
    ]
1424
4e56d48526c7 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 1297
diff changeset
  1084
3700
95530aec6e0b better process debugging.
Claus Gittinger <cg@exept.de>
parents: 3126
diff changeset
  1085
    "Modified: / 31.7.1998 / 16:30:19 / cg"
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1086
!
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1087
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1088
showValidCommandHelp
19144
2f3d50c4e256 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 18681
diff changeset
  1089
        'valid commands:
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1090
   c ........ continue
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1091
   s ........ step
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1092
   t ........ trace (continue with trace)
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1093
   a [id] ... abort (i.e. raise abort signal) in (current) process
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1094
   T [id] ... terminate (current) process
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1095
   W [id] ... stop (current) process
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1096
   R [id] ... resume (current) process
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1097
   Q [id] ... quick terminate (current) process - no unwinds or cleanup
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1098
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1099
   p ........ list processes ("P" for full list)
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1100
   w [id] ... walkback (of current/process with id)
16557
f66c1022d93b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16249
diff changeset
  1101
   b [id] ... full (VM) backtrace with more detail
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1102
   B ........ backtrace of all other processes
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1103
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1104
   U ........ unwrap all traced/breakpointed methods
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1105
   D ........ disable all line breakpoints
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1106
   h [-/+] .. disable/enable halts
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1107
   g ........ collect all garbage
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1108
   g 2 ...... collect all garbage & reclaim symbols
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1109
   g 3 ...... collect all garbage, reclaim symbols and compress
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1110
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1111
   S ........ save snapshot into "crash.img"
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1112
   C ........ save session changes to a separate change file
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1113
   x ........ exit Smalltalk ("X" to exit with core dump)
19149
e144119b2852 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 19148
diff changeset
  1114
   Y ........ reopen display, reopen launcher
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1115
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1116
   . ........ print dot (the current context)
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1117
   - ........ move dot up (sender)
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1118
   + ........ move dot down (called context)
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1119
   l ........ list dot''s method source around PC ("L" for full list)
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1120
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1121
   r ........ receiver (in dot) printString
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1122
   i [expr] . inspect expression (or receiver in dot)
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1123
   I ........ interpreter (expression evaluator)
19144
2f3d50c4e256 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 18681
diff changeset
  1124
   e expr ... evaluate expression & print result ("E" to not print)
2f3d50c4e256 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 18681
diff changeset
  1125
   ? c [p] .. help on class c (selectors matching p)
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1126
'  lowLevelErrorPrintCR.
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1127
14798
a31ff766419e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14797
diff changeset
  1128
   (XWorkstation notNil and:[ Screen default isKindOf:XWorkstation ]) ifTrue:[
a31ff766419e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14797
diff changeset
  1129
'   To repair a broken X-Connection, enter an interpreter (enter "I") and evaluate:
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1130
      Display := XWorkstation new.
14798
a31ff766419e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14797
diff changeset
  1131
      Display initializeFor:''localhost:0''.
7701
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1132
      Display startDispatch.
81a948fdd026 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7477
diff changeset
  1133
      NewLauncher openOnDevice:Display.
16095
3ce0f0344fdc class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 16094
diff changeset
  1134
      #exit
14798
a31ff766419e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14797
diff changeset
  1135
    then enter "c" to continue; a NewLauncher should pop up soon.
20496
0c25051acebd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 20420
diff changeset
  1136
'  lowLevelErrorPrintCR
14798
a31ff766419e class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 14797
diff changeset
  1137
    ]
15859
15dc2dbf6e8f class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15738
diff changeset
  1138
15930
4e1fdd602add class: MiniDebugger
Claus Gittinger <cg@exept.de>
parents: 15929
diff changeset
  1139
    "Modified: / 03-02-2014 / 10:38:36 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1140
! !
618
9048d43527d2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
  1141
658
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
  1142
!MiniDebugger class methodsFor:'documentation'!
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
  1143
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
  1144
version
18681
8844866e1a4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16626
diff changeset
  1145
    ^ '$Header$'
13113
803d470a0d28 changed:
Claus Gittinger <cg@exept.de>
parents: 11534
diff changeset
  1146
!
803d470a0d28 changed:
Claus Gittinger <cg@exept.de>
parents: 11534
diff changeset
  1147
803d470a0d28 changed:
Claus Gittinger <cg@exept.de>
parents: 11534
diff changeset
  1148
version_CVS
18681
8844866e1a4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 16626
diff changeset
  1149
    ^ '$Header$'
658
cf969399434d version at the end
Claus Gittinger <cg@exept.de>
parents: 618
diff changeset
  1150
! !
16626
bbf6b95f092f class: MiniDebugger
Stefan Vogel <sv@exept.de>
parents: 16557
diff changeset
  1151