Skip to content

Small improvements and fixes #104

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

Merged
merged 3 commits into from
Apr 4, 2025
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
2 changes: 1 addition & 1 deletion src/Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ SindarinDebuggerTest >> testNode [
self assert: node selector equals: #asInteger
]

{ #category : 'tests' }
{ #category : 'tests - pc' }
SindarinDebuggerTest >> testPc [
| dbg |
dbg := SindarinDebugger
Expand Down
19 changes: 10 additions & 9 deletions src/Sindarin/SindarinDebugger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,17 @@ SindarinDebugger >> assignmentVariableName [
^ self node variable name
]

{ #category : 'astAndAstMapping' }
SindarinDebugger >> bestNodeFor: anInterval [

^ self node methodNode bestNodeFor: anInterval
]

{ #category : 'ast manipulation' }
SindarinDebugger >> canStillExecute: aProgramNode [
"returns true if the last pc mapped to aProgramNode is greater than `self pc` in the right context "

| lastPcForNode rightContext |
| lastPcForNode rightContext outerContext |
rightContext := self context.
outerContext := rightContext outerContext ifNil: [ rightContext ].

[
rightContext == rightContext outerMostContext or: [
rightContext method ast allChildren identityIncludes: aProgramNode ] ]
rightContext == outerContext or: [
rightContext method ast allChildren identityIncludes: aProgramNode ] ]
whileFalse: [ rightContext := rightContext sender ].

lastPcForNode := (rightContext method ast lastPcForNode: aProgramNode)
Expand Down Expand Up @@ -609,6 +604,12 @@ SindarinDebugger >> stepUntil: aBlock [
aBlock whileFalse: [ self step ]
]

{ #category : 'astAndAstMapping' }
SindarinDebugger >> targetNodeFor: anInterval [

^ self node methodNode bestNodeFor: anInterval
]

{ #category : 'API - changes' }
SindarinDebugger >> tryMoveToNodeInHomeContext: aNode [
"Moves to node aNode if aNode is in the lexical context. Otherwise, the program state goes back to how it was before trying and signals an error as the node is not in AST"
Expand Down
2 changes: 1 addition & 1 deletion src/Sindarin/TSindarin.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ TSindarin >> outerMostContextOf: aContext [
oldContext := nil.
[currentContext ~= oldContext] whileTrue: [
oldContext := currentContext.
currentContext := currentContext outerMostContext ].
currentContext := currentContext outerContext ifNil:[currentContext]].
^ currentContext
]

Expand Down
Loading