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