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