Skip to content

Commit a65ddaa

Browse files
committed
Fix sindarin tests
1 parent f542630 commit a65ddaa

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

src/DebugInfo/OnlineSourceDebugInfo.class.st

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ OnlineSourceDebugInfo >> isFirstPCOfMessage: aBytecodePC [
180180
^ (mappedNode methodOrBlockNode scope outerNotOptimizedScope node firstPcForNode: mappedNode) = aBytecodePC
181181
]
182182

183+
{ #category : 'api' }
184+
OnlineSourceDebugInfo >> isSourceBlockCreation: aBytecodePC [
185+
186+
(self privateSourceNodeForPC: aBytecodePC) ifNil: [ ^ false ].
187+
"For many reasons we need for now to consider that the block creation is the block creation bytecode, and not the first bytecode mapped to it -- which correctly considers the pushing of copied vars and temp vectors"
188+
^ (InstructionStream on: compiledCode pc: aBytecodePC) willCreateBlock
189+
"^ (self privateSourceNodeForPC: aBytecodePC) isBlock"
190+
]
191+
183192
{ #category : 'api' }
184193
OnlineSourceDebugInfo >> isSourceReturn: aBytecodePC [
185194

@@ -204,7 +213,10 @@ OnlineSourceDebugInfo >> isSourceSend: aBytecodePC [
204213
OnlineSourceDebugInfo >> isSourceStore: aBytecodePC [
205214

206215
(self privateSourceNodeForPC: aBytecodePC) ifNil: [ ^ false ].
207-
^ (self privateSourceNodeForPC: aBytecodePC) isAssignment
216+
"For many reasons we need for now to consider that the stores are the store bytecodes.
217+
However, this takes into account stores inserted by the compiler and not written by users!"
218+
^ (InstructionStream on: compiledCode pc: aBytecodePC) willStore
219+
"^ (self privateSourceNodeForPC: aBytecodePC) isAssignment"
208220
]
209221

210222
{ #category : 'private' }
@@ -239,7 +251,8 @@ OnlineSourceDebugInfo >> shouldStopAt: aBytecodePC [
239251

240252
^ (self isSourceSend: aBytecodePC) or: [
241253
(self isSourceReturn: aBytecodePC) or: [
242-
self isSourceStore: aBytecodePC ] ]
254+
(self isSourceStore: aBytecodePC)
255+
or: [ self isSourceBlockCreation: aBytecodePC ] ] ]
243256
]
244257

245258
{ #category : 'accessing' }

src/Debugging-Core/Context.extension.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Context >> stepToSendOrReturn [
258258

259259
| stream context |
260260
stream := InstructionStream on: method pc: pc.
261-
[ self isDead or: [ stream willSend or: [ stream willReturn or: [ stream willStore ] ] ] ]
261+
[ self isDead or: [ stream willSend or: [ stream willReturn or: [ stream willStore or: [ stream willCreateBlock ] ] ] ] ]
262262
whileFalse: [
263263
context := stream interpretNextInstructionFor: self.
264264
context == self ifFalse: [

src/Kernel-CodeModel/Context.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ Context >> executedPC [
703703

704704
"Return the PC of the previous instruction.
705705
Heuristic (maybe wrong) we just go back one byte"
706-
^ self currentPC - 1
706+
^ self currentPC - 1 max: method initialPC
707707
]
708708

709709
{ #category : 'system simulation' }

src/Slot-Tests/TemporaryVariableTest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TemporaryVariableTest >> testDefiningNode [
2828

2929
{ #category : 'tests' }
3030
TemporaryVariableTest >> testIsReferenced [
31-
| method |
31+
| method notReferenced |
3232
"The temp notReferenced is not used as we test exactly that here"
3333
method := self class >> #testIsReferenced.
3434
self assert: method temporaryVariables first isReferenced.

0 commit comments

Comments
 (0)