Breakpoint.st
author Claus Gittinger <cg@exept.de>
Wed, 18 Dec 2019 19:06:30 +0100
changeset 4614 60fcb6d008cf
parent 4539 e2f831b09a0b
child 4647 ad7e7794f729
permissions -rw-r--r--
regenerated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
3129
7b4542cc9a9e Added support for new breakpoint implementation. Backward compatible.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128
diff changeset
     3
              All Rights Reserved
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
 hereby transferred.
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
"
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
"{ Package: 'stx:libcomp' }"
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
3588
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
    14
"{ NameSpace: Smalltalk }"
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
    15
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
Object subclass:#Breakpoint
3509
96499f5b060d Removed code for not-yet-finished new breakpoint support.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3491
diff changeset
    17
	instanceVariableNames:'position description line isReached method'
3149
218843d4d2b9 class: Breakpoint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3129
diff changeset
    18
	classVariableNames:''
218843d4d2b9 class: Breakpoint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3129
diff changeset
    19
	poolDictionaries:''
218843d4d2b9 class: Breakpoint
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3129
diff changeset
    20
	category:'System-Compiler-Debugging'
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
!Breakpoint class methodsFor:'documentation'!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
copyright
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
"
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
 COPYRIGHT (c) 2006 by eXept Software AG
3129
7b4542cc9a9e Added support for new breakpoint implementation. Backward compatible.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 3128
diff changeset
    28
              All Rights Reserved
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
 hereby transferred.
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
"
3347
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    37
!
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    38
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    39
documentation
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    40
"
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    41
    statement breakpoint support.
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    42
    Instances of me are placed into a (bytecode-) compiled method's
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
    43
    literal array and are sent #break messages when a statement
3347
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    44
    with a breakpoint is about to be executed.
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
    45
    The actual control is via the breakpoint's description, 
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
    46
    which contains further constraints about when the breakpoint should stop and enter the debugger
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
    47
    (for example: constraints on the reciever, the thread, the count, etc.)
3347
07358d349ba3 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3223
diff changeset
    48
"    
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
! !
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
!Breakpoint class methodsFor:'instance creation'!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
new
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    "return an initialized instance"
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
    ^ self basicNew initialize.
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
! !
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
3973
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    59
!Breakpoint class methodsFor:'queries'!
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    60
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    61
breakpointDescriptionClass
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    62
    "redefinable in subclasses"
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    63
    
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    64
    ^ BreakpointDescription
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    65
! !
aa193dc9210e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3930
diff changeset
    66
3354
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    67
!Breakpoint class methodsFor:'utilities'!
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    68
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    69
disableAllBreakpoints
3491
82c932be88db class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3490
diff changeset
    70
    MethodWithBreakpoints allBreakpointedMethods do:[:m |
82c932be88db class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3490
diff changeset
    71
        m disableAllBreakpoints
3354
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    72
    ]
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    73
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    74
    "Created: / 03-02-2014 / 10:35:55 / cg"
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    75
! !
ae5f5f1ea5d2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3347
diff changeset
    76
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
!Breakpoint methodsFor:'accessing'!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
2551
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
    79
description
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
    80
    ^ description
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
2551
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
    83
description:aBreakpointDescription
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
    84
    description := aBreakpointDescription.
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
2541
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    87
isReached
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    88
    ^ isReached
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    89
!
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    90
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    91
isReached:aBoolean
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    92
    isReached := aBoolean.
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    93
!
21bf1e0c7e8d class definition
Claus Gittinger <cg@exept.de>
parents: 2510
diff changeset
    94
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
line
3884
43d16f48db03 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
    96
    "the lineNr"
43d16f48db03 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3683
diff changeset
    97
    
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    ^ line
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
3465
f41acc7867fb class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   101
line:lineArg
f41acc7867fb class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   102
    self assert:lineArg >= 0.
f41acc7867fb class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   103
    line := lineArg.
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
3588
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   106
method:something
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   107
    method := something.
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   108
!
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   109
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
position
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
    ^ position
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
2894
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   114
position:anInteger
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   115
    position := anInteger.
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   116
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   117
    "Modified (format): / 02-08-2012 / 09:26:03 / cg"
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   118
!
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   119
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   120
position:positionArg line:lineArg
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   121
    position := positionArg.
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   122
    line := lineArg.
3465
f41acc7867fb class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3444
diff changeset
   123
    self assert:lineArg >= 0.
2894
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   124
1520aa38f2f3 added: #position:line:
Claus Gittinger <cg@exept.de>
parents: 2797
diff changeset
   125
    "Created: / 02-08-2012 / 09:26:27 / cg"
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
! !
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   128
!Breakpoint methodsFor:'hitting'!
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   129
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
break
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   131
    "invoked by the breakPoint's code (see BreakPointNode),
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   132
     which is compiled into the code as:
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   133
        pushLit <theBreakpoint>
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   134
        send0 #break
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   135
    "
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
    <resource: #skipInDebuggersWalkBack>
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   139
    |sender message|
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   140
3223
34bf02a37ac1 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3202
diff changeset
   141
    description isEnabled ifFalse:[^ self].
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   142
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   143
    sender := thisContext sender.
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   144
    (description shouldBreakIn:sender) ifTrue:[
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   145
        message := self breakPointMessageForContext:sender.
4298
86a5dcc7d408 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
   146
        "/ to disable this breakpoint:
86a5dcc7d408 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
   147
        "/ description disable.
86a5dcc7d408 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4201
diff changeset
   148
4363
52a36e73c6d0 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   149
        BreakPointInterrupt basicNew
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   150
            raiseRequestWith:self 
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   151
            errorString:message
4364
dbfef9144fed #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4363
diff changeset
   152
            "/ not in sender, because otherwise the debugger won't
dbfef9144fed #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4363
diff changeset
   153
            "/ detect the break on the stack
3490
10ea05a365c2 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3465
diff changeset
   154
            "/ in:sender.
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   155
    ].
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   156
    (description shouldTraceIn:sender) ifTrue:[
4451
a6536ecebfb5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   157
        sender method numArgs == 0 ifTrue:[
4455
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   158
            Transcript showCR:('%1 Trace: %2 [%3]' 
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   159
                        bindWith:Timestamp now 
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   160
                        with:sender methodPrintString 
4451
a6536ecebfb5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   161
                        with:self line)
a6536ecebfb5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   162
        ] ifFalse:[    
4455
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   163
            Transcript showCR:('%1 Trace: %2 [%3] args: %4' 
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   164
                        bindWith:Timestamp now 
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   165
                        with:sender methodPrintString 
4313
e756e66cb104 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 4298
diff changeset
   166
                        with:self line
e756e66cb104 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 4298
diff changeset
   167
                        with:sender argsDisplayStringShort)
4451
a6536ecebfb5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   168
        ].
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   169
    ].
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
    "Created: / 15-06-2011 / 12:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2551
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
   172
    "Modified: / 11-07-2011 / 18:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4201
858fe63ce55e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4136
diff changeset
   173
    "Modified: / 21-10-2017 / 15:24:35 / cg"
4455
ca939ac8475f #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 4451
diff changeset
   174
    "Modified: / 02-07-2019 / 23:49:17 / Claus Gittinger"
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   175
!
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   176
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   177
breakPointMessageForContext:sender
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   178
    |mthd where lineNr message 
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   179
     source sourceLines sourceLine prevLine nextLine|
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   180
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   181
    message := 'Breakpoint encountered at line %1 in %2'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   182
    where := '?'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   183
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   184
    mthd := method.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   185
    mthd notNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   186
        mthd mclass isNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   187
            mthd := sender method.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   188
        ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   189
        where := mthd whoString.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   190
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   191
        (lineNr := self line) notNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   192
            (source := mthd source) notNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   193
                sourceLines := source asStringCollection.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   194
                sourceLine := sourceLines at:lineNr ifAbsent:[nil].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   195
                sourceLine notNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   196
                    sourceLine := (sourceLine "withoutLeadingSeparators" contractAtEndTo:60) allItalic withColor:Color darkRed.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   197
                    message := 'Breakpoint encountered at line %1 in %2\near:\%3'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   198
                    lineNr > 1 ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   199
                        prevLine := sourceLines at:(lineNr-1) ifAbsent:[nil].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   200
                        prevLine notEmptyOrNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   201
                            "/ prevLine := prevLine withoutLeadingSeparators.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   202
                            prevLine notEmpty ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   203
                                prevLine := (prevLine contractAtEndTo:60) allItalic.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   204
                                lineNr > 2 ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   205
                                    prevLine := '...', Character cr , prevLine.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   206
                                ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   207
                            ] ifFalse:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   208
                                prevLine := '...'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   209
                            ].  
4539
e2f831b09a0b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4456
diff changeset
   210
                            prevLine := prevLine allGray.
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   211
                            message := 'Breakpoint encountered at line %1 in %2\near:\%4\%3'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   212
                        ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   213
                    ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   214
                    lineNr < (sourceLines size) ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   215
                        nextLine := sourceLines at:(lineNr+1) ifAbsent:[nil].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   216
                        nextLine notEmptyOrNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   217
                            "/ nextLine := nextLine withoutLeadingSeparators.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   218
                            nextLine notEmpty ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   219
                                nextLine := (nextLine contractAtEndTo:60) allItalic.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   220
                                lineNr < (sourceLines size - 1) ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   221
                                    nextLine := nextLine , Character cr , '...'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   222
                                ].    
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   223
                            ] ifFalse:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   224
                                nextLine := '...'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   225
                            ].    
4539
e2f831b09a0b #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 4456
diff changeset
   226
                            nextLine := nextLine allGray.
4456
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   227
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   228
                            prevLine notNil ifTrue:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   229
                                message := 'Breakpoint encountered at line %1 in %2\near:\%4\%3\%5'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   230
                            ] ifFalse:[
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   231
                                message := 'Breakpoint encountered at line %1 in %2\near:\%3\%5'.
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   232
                            ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   233
                        ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   234
                    ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   235
                ].    
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   236
            ].    
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   237
        ].    
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   238
    ].
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   239
    ^ (message withCRs 
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   240
            bindWith:self line 
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   241
            with:where 
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   242
            with:sourceLine
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   243
            with:prevLine
698fe54bf9c6 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
   244
            with:nextLine)
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   245
! !
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   246
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   247
!Breakpoint methodsFor:'initialization'!
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   248
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   249
initialize
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   250
    "Invoked when a new instance is created."
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   251
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   252
    "/ please change as required (and remove this comment)
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   253
    "/ method := nil.
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   254
    "/ position := nil.
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   255
    description := self class breakpointDescriptionClass new.
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   256
    "/ line := nil.
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   257
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   258
    "/ super initialize.   -- commented since inherited method does nothing
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   259
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   260
    "Modified: / 21-08-2014 / 09:35:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   261
! !
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   262
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   263
!Breakpoint methodsFor:'printing & storing'!
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   264
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   265
inspectorValueStringInListFor:anInspector
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   266
    "returns a string to be shown in the inspector's list"
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   267
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   268
    ^ self printString
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   269
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   270
    "Created: / 29-05-2019 / 15:14:52 / Claus Gittinger"
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   271
!
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   272
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   273
printBreakpointNrInDebuggerOn:aStream
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   274
    "to be redefined for concrete debuggers 
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   275
     (some require a bpnt to be registered and use a handle or id to refer to them)"
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   276
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   277
    "Modified (comment): / 29-05-2019 / 15:11:55 / Claus Gittinger"
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   278
!
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   279
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   280
printOn:aStream
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   281
    "append a printed representation of the receiver to the argument, aStream"
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   282
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   283
    |info|
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   284
    
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   285
    aStream nextPutAll: 'BPNT'.
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   286
    self printBreakpointNrInDebuggerOn:aStream.
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   287
    aStream nextPutAll: ' at'.
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   288
    self printPositionOrLineNumberOn:aStream.
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   289
    self isEnabled ifTrue:[ 
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   290
        description condition notNil 
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   291
            ifTrue:[info := ' (conditional)']
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   292
            ifFalse:[info := ' (enabled)']
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   293
    ] ifFalse:[
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   294
        info :=' (disabled)'
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   295
    ].
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   296
    aStream nextPutAll:info
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   297
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   298
    "Modified: / 24-04-2013 / 20:42:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   299
    "Modified: / 29-05-2019 / 15:21:36 / Claus Gittinger"
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   300
!
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   301
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   302
printPositionOrLineNumberOn:aStream
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   303
    (position isNil and:[line isNil]) ifTrue:[
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   304
        aStream nextPutAll: ' ???'
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   305
    ] ifFalse:[
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   306
        position notNil ifTrue:[
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   307
            aStream
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   308
                nextPutAll: ' position:';
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   309
                print: position.
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   310
        ].
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   311
        line notNil ifTrue:[
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   312
            aStream
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   313
                nextPutAll: ' line:';
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   314
                print: line.
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   315
        ].
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   316
    ].
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   317
4424
426e55dae825 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 4392
diff changeset
   318
    "Created: / 29-05-2019 / 15:13:42 / Claus Gittinger"
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   319
! !
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   320
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   321
!Breakpoint methodsFor:'support'!
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   322
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   323
beInvisible
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   324
    "make this breakpoint hidden (in gutter)"
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   325
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   326
    description beInvisible
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   327
!
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   328
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   329
beTracepoint
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   330
    "make this breakpoint a tracepoint"
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   331
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   332
    description beTracepoint
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   333
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   334
    "Created: / 27-01-2012 / 13:56:11 / cg"
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   335
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   336
2968
e69a084842cc added: #disable
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
   337
disable
e69a084842cc added: #disable
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
   338
    "disable this breakpoint"
e69a084842cc added: #disable
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
   339
3588
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   340
    "/ if there is currently an ignore on this breakpoint in the debugger, remove it
4374
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   341
    Debugger notNil ifTrue:[
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   342
        DebugView stopIgnoringHaltsFor:method atLineNr:line.
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   343
    ].
2968
e69a084842cc added: #disable
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
   344
    description disable
4374
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   345
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   346
    "Modified: / 02-03-2019 / 11:30:45 / Claus Gittinger"
2968
e69a084842cc added: #disable
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
   347
!
e69a084842cc added: #disable
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
   348
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   349
toggle
2792
41047dab5b11 class definition
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   350
    "toggle this breakpoint"
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   351
3588
9a435f75bc8c class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   352
    "/ if there is currently an ignore on this breakpoint in the debugger, remove it
4374
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   353
    Debugger notNil ifTrue:[
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   354
        Debugger stopIgnoringHaltsFor:method atLineNr:line.
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   355
    ].
2551
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
   356
    description toggle
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   357
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   358
    "Created: / 17-06-2011 / 13:40:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2551
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
   359
    "Modified: / 11-07-2011 / 18:18:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2792
41047dab5b11 class definition
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
   360
    "Modified (comment): / 27-01-2012 / 10:41:03 / cg"
4374
2ea996ddf3a1 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 4364
diff changeset
   361
    "Modified: / 02-03-2019 / 11:30:31 / Claus Gittinger"
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   362
!
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   363
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   364
toggleTracing
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   365
    "toggle tracing of this breakpoint"
2795
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   366
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   367
    description toggleTracing
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   368
69ab29839a96 tracing
Claus Gittinger <cg@exept.de>
parents: 2792
diff changeset
   369
    "Created: / 27-01-2012 / 13:56:05 / cg"
4362
0b16a2eb96d9 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4313
diff changeset
   370
    "Modified (comment): / 20-02-2019 / 10:46:54 / Claus Gittinger"
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   371
! !
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   372
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   373
!Breakpoint methodsFor:'testing'!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   374
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   375
isEnabled
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   376
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   377
    "Bad coding here, state should be full object"
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   378
2551
4470029ad63a Breakpoint state extracted to BreakpointDescription object
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2545
diff changeset
   379
    ^description isEnabled
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   380
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   381
    "Created: / 28-06-2011 / 08:27:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3202
dc677a63a7ad class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   382
!
dc677a63a7ad class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   383
4000
d9956ca67abf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3982
diff changeset
   384
isTracepoint
d9956ca67abf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3982
diff changeset
   385
    ^description isTracepoint
d9956ca67abf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3982
diff changeset
   386
!
d9956ca67abf #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3982
diff changeset
   387
3202
dc677a63a7ad class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   388
isVisible
dc677a63a7ad class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3196
diff changeset
   389
    ^description isVisible
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   390
! !
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   391
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   392
!Breakpoint class methodsFor:'documentation'!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   393
2554
31516fc84824 #icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2551
diff changeset
   394
version
3683
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
   395
    ^ '$Header$'
2554
31516fc84824 #icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2551
diff changeset
   396
!
31516fc84824 #icon moved to stx:libtool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2551
diff changeset
   397
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   398
version_CVS
3683
Claus Gittinger <cg@exept.de>
parents: 3631
diff changeset
   399
    ^ '$Header$'
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   400
!
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   401
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   402
version_SVN
3196
99005bd9a1f7 class: Breakpoint
Claus Gittinger <cg@exept.de>
parents: 3149
diff changeset
   403
    ^ '$ Id $'
2510
98bad3cbfbd8 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   404
! !
3115
3208c8b4661c Some more support for new breakpoints.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2968
diff changeset
   405