ByteCodeCompilerWithBreakpointSupport.st
author Jan Vrany <jan.vrany@labware.com>
Thu, 27 Oct 2022 14:53:59 +0100
branchjv
changeset 4735 3b11fb3ede98
parent 4593 c4e1882bb146
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:
4566
17db3668fea9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4366
diff changeset
     1
"{ Encoding: utf8 }"
17db3668fea9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4366
diff changeset
     2
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
 COPYRIGHT (c) 2006 by eXept Software AG
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	      All Rights Reserved
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
 This software is furnished under a license and may be used
43bfd25f2552 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
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
 hereby transferred.
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
"{ Package: 'stx:libcomp' }"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
4171
3f8437757dba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3520
diff changeset
    16
"{ NameSpace: Smalltalk }"
3f8437757dba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3520
diff changeset
    17
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
ByteCodeCompiler subclass:#ByteCodeCompilerWithBreakpointSupport
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
	instanceVariableNames:'breakpoints'
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
	classVariableNames:''
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
	poolDictionaries:''
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
	category:'System-Compiler-Debugging'
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
!ByteCodeCompilerWithBreakpointSupport class methodsFor:'documentation'!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
copyright
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
 COPYRIGHT (c) 2006 by eXept Software AG
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
	      All Rights Reserved
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
 This software is furnished under a license and may be used
43bfd25f2552 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
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
 hereby transferred.
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
documentation
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
    I'm an experimental compiler class that supports
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
    breakpoints. Once tested, the code will be merged
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
    to ByteCodeCompiler.
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
    [author:]
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
        Jan Vrany <jan.vrany@fit.cvut.cz>
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
    [instance variables:]
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
    [class variables:]
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
    [see also:]
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
"
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
! !
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    59
!ByteCodeCompilerWithBreakpointSupport methodsFor:'adding breakpoint'!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    60
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    61
possiblyWrapABreakPointAround:aBlock
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    62
    "refactored Jan's original code; changed to not wrap an already wrapped expression"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    63
4593
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    64
    | expr bpIdx bpnt tokenPositionBefore tokenLineNrBefore |
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    65
3199
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
    66
    tokenPositionBefore := tokenPosition ? source position.
3198
47a691bea790 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
    67
    tokenLineNrBefore := tokenLineNr.
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    68
3205
aaf9ba016d5b class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
    69
    "/ find the very first breakpoint, which is right after the
aaf9ba016d5b class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
    70
    "/ current line start, and remove it from the breakpoints collection,
aaf9ba016d5b class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
    71
    "/ incl. all before. This removes breakpoints on empty lines or inside strings etc.
4593
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    72
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    73
    "/ does not work
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    74
"/    bpIdx := breakpoints findFirst:[:b | b line >= tokenLineNrBefore].
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    75
"/    bpIdx > 0 ifTrue:[
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    76
"/        bpnt := breakpoints at:bpIdx.
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    77
"/        breakpoints removeIndex:bpIdx
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    78
"/    ] ifFalse:[
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    79
        [
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    80
            breakpoints notEmpty
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    81
            and:[(breakpoints first position ? 0) <= tokenPositionBefore]
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    82
        ] whileTrue:[
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    83
            bpnt := breakpoints removeFirst
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    84
        ].
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    85
"/    ].
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    86
    "/    Transcript showCR:tokenLineNrBefore.
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    87
    "/    Transcript showCR:thisContext sender.
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    88
    "/    Transcript showCR:bpnt.
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    89
    "/    Transcript showCR:'-----------'.
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    90
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    91
    expr := aBlock value.
3520
b2b6462d8cd7 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3517
diff changeset
    92
    expr == #Error ifTrue:[^expr].
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
    93
    bpnt isNil ifTrue:[^expr].
4566
17db3668fea9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4366
diff changeset
    94
17db3668fea9 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4366
diff changeset
    95
    bpnt isReached:true.
4593
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    96
    expr isBreakPointNode ifTrue:[
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    97
        expr lineNumber <= bpnt line ifTrue:[
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    98
            "/ Transcript showCR:'bp [%1] expr already breakpointed: %2 ' with:bpnt line with:expr.
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
    99
            ^expr
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   100
        ].
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   101
    ].
3199
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   102
    tokenPositionBefore = tokenPosition ifTrue:[
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   103
        "/ nothing scanned - happens with unaryExpression which does not find anything,
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   104
        "/ but returns due to a ')' or ']' token.
4593
c4e1882bb146 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   105
        "/ Transcript showCR:'nothing scanned'.
3199
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   106
        ^expr
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   107
    ].
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   108
2799
37dfd9b9d9ee changed: #possiblyWrapABreakPointAround:
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
   109
    "/ Transcript show:'adding breakpoint '; show:bpnt; show:' before: '; showCR:expr.
37dfd9b9d9ee changed: #possiblyWrapABreakPointAround:
Claus Gittinger <cg@exept.de>
parents: 2758
diff changeset
   110
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   111
    ^ BreakpointNode new
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   112
        breakpoint: bpnt;
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   113
        expression: expr;
3198
47a691bea790 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   114
        lineNumber:(bpnt line ? tokenLineNrBefore);
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   115
        yourself
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   116
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   117
    "Created: / 05-07-2011 / 21:11:19 / cg"
4171
3f8437757dba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3520
diff changeset
   118
    "Modified: / 25-07-2017 / 12:37:24 / stefan"
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   119
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   120
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   121
removeMissedBreakpointsBefore:aPosition
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   122
    [
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   123
        breakpoints notEmpty
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   124
        and:[breakpoints first position < aPosition]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   125
    ] whileTrue:[
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   126
        breakpoints removeFirst
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   127
    ].
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   128
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   129
    "Created: / 05-07-2011 / 23:13:25 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   130
! !
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   131
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
!ByteCodeCompilerWithBreakpointSupport methodsFor:'parsing-expressions'!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   134
binaryExpression
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   135
    ^ self possiblyWrapABreakPointAround:[super binaryExpression]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   136
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   137
    "Created: / 05-07-2011 / 23:08:43 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   138
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   139
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   140
binaryExpressionFor:aReceiver
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   141
    ^ self possiblyWrapABreakPointAround:[super binaryExpressionFor:aReceiver]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   142
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   143
    "Created: / 05-07-2011 / 21:10:53 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   144
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   145
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   146
block
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   147
    |blockNode|
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   148
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   149
    self removeMissedBreakpointsBefore:source position.
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   150
    blockNode := super block.
3517
b71d7aeb8c41 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3426
diff changeset
   151
    blockNode ~~ #Error ifTrue:[
b71d7aeb8c41 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3426
diff changeset
   152
        self removeMissedBreakpointsBefore:blockNode endPosition+2.
b71d7aeb8c41 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3426
diff changeset
   153
    ].
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   154
    ^ blockNode
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   155
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   156
    "Created: / 05-07-2011 / 22:56:19 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   157
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   158
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
expression
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   160
    ^ self possiblyWrapABreakPointAround:[super expression]
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   162
    "Created: / 16-06-2011 / 14:58:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   163
    "Modified: / 05-07-2011 / 21:11:38 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   164
!
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   166
primary
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   167
    ^ self possiblyWrapABreakPointAround:[super primary]
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
    "Created: / 16-06-2011 / 14:58:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   170
    "Modified: / 05-07-2011 / 21:11:38 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   171
    "Created: / 05-07-2011 / 23:05:23 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   172
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   173
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   174
unaryExpression
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   175
    ^ self possiblyWrapABreakPointAround:[super unaryExpression]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   176
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   177
    "Created: / 05-07-2011 / 23:08:54 / cg"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   178
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   179
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   180
unaryExpressionFor:aReceiver
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   181
    ^ self possiblyWrapABreakPointAround:[super unaryExpressionFor:aReceiver]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   182
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   183
    "Created: / 05-07-2011 / 21:15:30 / cg"
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   184
! !
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   185
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   186
!ByteCodeCompilerWithBreakpointSupport methodsFor:'private'!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   187
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   188
breakpoints:aCollection
4366
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   189
    breakpoints := aCollection copy 
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   190
                        sort:[:a :b| 
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   191
                                (a position notNil and:[b position notNil]) ifTrue:[
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   192
                                    a position < b position
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   193
                                ] ifFalse:[
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   194
                                    a line < b line
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   195
                                ].
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   196
                             ].
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
    "Created: / 16-06-2011 / 14:35:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   199
    "Created: / 05-07-2011 / 21:37:28 / cg"
4366
9e9025f9ca1f #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 4171
diff changeset
   200
    "Modified: / 20-02-2019 / 11:16:25 / Claus Gittinger"
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   201
!
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   202
3225
57126b848598 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   203
methodClass
57126b848598 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   204
    ^ methodClass ? MethodWithBreakpoints
57126b848598 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   205
57126b848598 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   206
    "Created: / 22-07-2013 / 15:54:19 / cg"
57126b848598 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   207
!
57126b848598 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3205
diff changeset
   208
2537
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   209
notifying: anObject
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   210
    super notifying: anObject.
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   211
    anObject notNil ifTrue:[
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   212
        breakpoints isNil ifTrue:[
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   213
            self breakpoints:(anObject perform: #breakpoints ifNotUnderstood:#()).
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   214
        ]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   215
    ]
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   216
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   217
    "Created: / 16-06-2011 / 14:35:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72fde5f496de fixes to make testSuite pass
Claus Gittinger <cg@exept.de>
parents: 2498
diff changeset
   218
    "Modified: / 05-07-2011 / 21:48:37 / cg"
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
! !
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
!ByteCodeCompilerWithBreakpointSupport class methodsFor:'documentation'!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
3199
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   223
version
4171
3f8437757dba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3520
diff changeset
   224
    ^ '$Header$'
3199
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   225
!
0c12b1eefc58 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   226
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
version_CVS
4171
3f8437757dba #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 3520
diff changeset
   228
    ^ '$Header$'
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
!
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
version_SVN
3198
47a691bea790 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   232
    ^ '$ Id $'
2498
43bfd25f2552 Initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
! !
3198
47a691bea790 class: ByteCodeCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   234