Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testRecompileMethodToInBlockContext++ using clean blocks #605

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/NewTools-Debugger-Tests/StDebuggerActionModelTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ StDebuggerActionModelTest >> methodWithBlockContext [
{ #category : 'helper' }
StDebuggerActionModelTest >> methodWithDeadBlockContext [

^ [ (1+1 ) printString ]
^ [ (1 + 1) printString ]
]

{ #category : 'helper' }
Expand All @@ -127,14 +127,13 @@ StDebuggerActionModelTest >> newSessionWithBlockContext [
| process method |
method := self class >> #methodWithBlockContext.
methodWithBlockContextOriginalSource := method sourceCode.
process := [ method valueWithReceiver: self arguments: #( ) ]
newProcess.
self
setSessionAndDebuggerModelForMethod: method
inContext: process suspendedContext.
process := [ method valueWithReceiver: self arguments: #( ) ] newProcess.
self setSessionAndDebuggerModelForMethod: method inContext: process suspendedContext.

4 timesRepeat: [
debugActionModel stepInto: debugActionModel topContext ]
[ debugActionModel topContext closure isNil ] whileTrue: [
debugActionModel stepInto: debugActionModel topContext ].
"Step on (1 + 1) message"
debugActionModel stepInto: debugActionModel topContext
]

{ #category : 'helper' }
Expand Down
5 changes: 4 additions & 1 deletion src/NewTools-Debugger/StDebuggerActionModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,18 @@ StDebuggerActionModel >> recompileMethodTo: aString inContext: aContext notifyin

| methodContext homePC |
aContext ifNil: [ ^ self ].
"Get the home before to recompile the method, we can lost it (for clean blocks)"
methodContext := aContext home.

self session
recompileMethodTo: aString
inContext: aContext
notifying: aNotifyer.

methodContext := aContext home.
homePC := methodContext isDead
ifTrue: [ methodContext endPC ]
ifFalse: [ methodContext pc ].

previousASTScope := (methodContext compiledCode sourceNodeForPC:
homePC) scope
]
Expand Down