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

Rename opal #100

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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/SindarinDebugSessionTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SindarinDebugSessionTest >> testSindarinSessionInstantiation [
sindarinSession := SindarinDebugSession
newWithName: sessionName
forProcess: process.
self assert: sindarinSession debugSession notNil.
self assert: sindarinSession debugSession isNotNil.
self assert: sindarinSession debugSession name equals: sessionName.
self
assert: sindarinSession debugSession process
Expand Down
7 changes: 3 additions & 4 deletions src/Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ SindarinDebuggerTest >> methodWithNotEvaluatedBlockWhoseCreationIsFirstBytecodeI
^ a * 42
]


{ #category : 'helpers' }
SindarinDebuggerTest >> methodWithOneAssignment [

Expand Down Expand Up @@ -1399,7 +1398,7 @@ SindarinDebuggerTest >> testSkipCanSkipReturnIfItIsNotTheLastReturn [
self assert: scdbg node value value equals: 2
]

{ #category : #tests }
{ #category : 'tests' }
SindarinDebuggerTest >> testSkipCannotSkipReturnIfItIsTheLastReturn [

| scdbg nodeWithImplicitReturn |
Expand Down Expand Up @@ -2041,8 +2040,8 @@ SindarinDebuggerTest >> testTemporaryNamed [
SindarinDebuggerTest >> testTerminate [
| dbg |
dbg := SindarinDebugger debug: [ self helperMethod13 ].
self assert: dbg debugSession interruptedContext notNil.
self assert: dbg debugSession interruptedProcess notNil.
self assert: dbg debugSession interruptedContext isNotNil.
self assert: dbg debugSession interruptedProcess isNotNil.
dbg terminate.
self assert: dbg debugSession interruptedContext isNil.
self assert: dbg debugSession interruptedProcess isNil.
Expand Down
4 changes: 2 additions & 2 deletions src/Sindarin/Context.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Context }
Extension { #name : 'Context' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
Context >> stepToSendOrReturnOrJump [

"Simulate the execution of bytecodes until either sending a message or
Expand Down
8 changes: 4 additions & 4 deletions src/Sindarin/DebugSession.extension.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Extension { #name : #DebugSession }
Extension { #name : 'DebugSession' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
DebugSession >> asSindarinDebugSession [
^ SindarinDebugSession new debugSession: self
]

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
DebugSession >> stepToFirstInterestingBytecodeWithJumpIn: aProcess [
"After a restart of a method activation step to the first
bytecode instruction that is of interest for the debugger.
Expand All @@ -24,7 +24,7 @@ DebugSession >> stepToFirstInterestingBytecodeWithJumpIn: aProcess [
^ aProcess stepToSendOrReturnOrJump
]

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
DebugSession >> suspendedContext: aContext [

interruptedContext := aContext
Expand Down
10 changes: 6 additions & 4 deletions src/Sindarin/DebuggedExecutionException.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Class {
#name : #DebuggedExecutionException,
#superclass : #Error,
#category : #'Sindarin-Exceptions'
#name : 'DebuggedExecutionException',
#superclass : 'Error',
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}

{ #category : #testing }
{ #category : 'testing' }
DebuggedExecutionException >> isExceptionSignalledForDebuggedExecution [
^ true
]
8 changes: 5 additions & 3 deletions src/Sindarin/DebuggedExecutionIsFinished.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Class {
#name : #DebuggedExecutionIsFinished,
#superclass : #DebuggedExecutionException,
#category : #'Sindarin-Exceptions'
#name : 'DebuggedExecutionIsFinished',
#superclass : 'DebuggedExecutionException',
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}
12 changes: 6 additions & 6 deletions src/Sindarin/InstructionStream.extension.st
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
Extension { #name : #InstructionStream }
Extension { #name : 'InstructionStream' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
InstructionStream >> willJump [
"Answer whether the next bytecode will jump."

^ self willJumpIfFalse or:[ self willJumpIfTrue or: [ self willJumpTo ] ]
]

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
InstructionStream >> willJumpIfTrue [
"Answer whether the next bytecode is a jump-if-false."

^ self method encoderClass isBranchIfTrueAt: pc in: self method
]

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
InstructionStream >> willJumpTo [
"Answer whether the next bytecode is a jump-if-false."

^ self method encoderClass isJumpAt: pc in: self method
]

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
InstructionStream >> willSendOrReturnOrStoreOrCreateBlock [

"Answer whether the next bytecode will be interesting for the debugger to stop."
Expand All @@ -30,7 +30,7 @@ InstructionStream >> willSendOrReturnOrStoreOrCreateBlock [
self willReturn or: [ self willStore or: [ self willCreateBlock ] ] ]
]

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
InstructionStream >> willStoreButNotPop [
"Answer whether the next bytecode is a store that are not store-pop"

Expand Down
8 changes: 5 additions & 3 deletions src/Sindarin/NodeNotInASTError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
I am signaled when we try to move the execution to a node that is not in the home context's method ast.
"
Class {
#name : #NodeNotInASTError,
#superclass : #Error,
#category : #'Sindarin-Exceptions'
#name : 'NodeNotInASTError',
#superclass : 'Error',
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}
8 changes: 5 additions & 3 deletions src/Sindarin/NotValidPcError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
I am signaled when I try to modify the execution of a context to get to an invalid PC (lower than the method initalPC or greater than the method endPC)
"
Class {
#name : #NotValidPcError,
#superclass : #Error,
#category : #'Sindarin-Exceptions'
#name : 'NotValidPcError',
#superclass : 'Error',
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}
7 changes: 7 additions & 0 deletions src/Sindarin/OCAssignmentNode.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'OCAssignmentNode' }

{ #category : '*Sindarin' }
OCAssignmentNode >> skipWithDebugger: aSindarinDebugger [

aSindarinDebugger skipAssignmentNodeCompletely
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Extension { #name : #RBBlockNode }
Extension { #name : 'OCBlockNode' }

{ #category : #'*Sindarin' }
RBBlockNode >> executedNodesAfter: aNode [
{ #category : '*Sindarin' }
OCBlockNode >> executedNodesAfter: aNode [

"Gives all nodes that are executed after aNode. Assuming that aNode is a recursive child, then all nodes executed after it are all nodes after it in allChildrenPostOrder"

Expand All @@ -13,14 +13,14 @@ RBBlockNode >> executedNodesAfter: aNode [
^ nodesAfter
]

{ #category : #'*Sindarin' }
RBBlockNode >> firstPCOfStatement: aStatementNode [
{ #category : '*Sindarin' }
OCBlockNode >> firstPCOfStatement: aStatementNode [

^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
]

{ #category : #'*Sindarin' }
RBBlockNode >> nextExecutedNodeAfter: aNode [
{ #category : '*Sindarin' }
OCBlockNode >> nextExecutedNodeAfter: aNode [

"Find first node that is after aNode that has an associated pc in method node all children (post-order)"

Expand All @@ -31,17 +31,17 @@ RBBlockNode >> nextExecutedNodeAfter: aNode [
^ nodesAfter at: indexOfNextNode
]

{ #category : #'*Sindarin' }
RBBlockNode >> parentOfIdenticalSubtree: subtree [
{ #category : '*Sindarin' }
OCBlockNode >> parentOfIdenticalSubtree: subtree [

^ self allChildren reversed
detect: [ :e | e == subtree ]
ifFound: [ :e | e parent ]
ifNone: [ nil ]
]

{ #category : #'*Sindarin' }
RBBlockNode >> skipWithDebugger: aSindarinDebugger [
{ #category : '*Sindarin' }
OCBlockNode >> skipWithDebugger: aSindarinDebugger [

aSindarinDebugger skipBlockNode
]
8 changes: 4 additions & 4 deletions src/Sindarin/OCBytecodeToASTCache.extension.st
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Extension { #name : #OCBytecodeToASTCache }
Extension { #name : 'OCBytecodeToASTCache' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
OCBytecodeToASTCache >> firstRecursiveBcOffsetForStatementNode: aStatementNode [

^ self methodOrBlockNode bcToASTCache bcToASTMap keys sorted detect: [
:key | (self nodeForPC: key) statementNode == aStatementNode ]
^ self methodOrBlockNode bcToASTCache bcToASTMap keys sorted
detect: [ :key | (self nodeForPC: key) statementNode == aStatementNode ]
]
7 changes: 7 additions & 0 deletions src/Sindarin/OCMessageNode.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'OCMessageNode' }

{ #category : '*Sindarin' }
OCMessageNode >> skipWithDebugger: aSindarinDebugger [

aSindarinDebugger skipMessageNode
]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Extension { #name : #RBMethodNode }
Extension { #name : 'OCMethodNode' }

{ #category : #'*Sindarin' }
RBMethodNode >> executedNodesAfter: aNode [
{ #category : '*Sindarin' }
OCMethodNode >> executedNodesAfter: aNode [

"Gives all nodes that are executed after aNode. Assuming that aNode is a recursive child, then all nodes executed after it are all nodes after it in allChildrenPostOrder"

Expand All @@ -13,14 +13,14 @@ RBMethodNode >> executedNodesAfter: aNode [
^ nodesAfter
]

{ #category : #'*Sindarin' }
RBMethodNode >> firstPCOfStatement: aStatementNode [
{ #category : '*Sindarin' }
OCMethodNode >> firstPCOfStatement: aStatementNode [

^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
]

{ #category : #'*Sindarin' }
RBMethodNode >> nextExecutedNodeAfter: aNode [
{ #category : '*Sindarin' }
OCMethodNode >> nextExecutedNodeAfter: aNode [

"Find first node that is after aNode that has an associated pc in method node all children (post-order)"

Expand All @@ -31,17 +31,17 @@ RBMethodNode >> nextExecutedNodeAfter: aNode [
^ nodesAfter at: indexOfNextNode
]

{ #category : #'*Sindarin' }
RBMethodNode >> parentOfIdenticalSubtree: subtree [
{ #category : '*Sindarin' }
OCMethodNode >> parentOfIdenticalSubtree: subtree [

^ self allChildren reversed
detect: [ :e | e == subtree ]
ifFound: [ :e | e parent ]
ifNone: [ nil ]
]

{ #category : #'*Sindarin' }
RBMethodNode >> statementNodeContaining: aNode [
{ #category : '*Sindarin' }
OCMethodNode >> statementNodeContaining: aNode [

| statementNode parentOfStatementNode |
statementNode := aNode.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Extension { #name : #RBProgramNode }
Extension { #name : 'OCProgramNode' }

{ #category : #'*Sindarin' }
RBProgramNode >> allChildrenPostOrder [
{ #category : '*Sindarin' }
OCProgramNode >> allChildrenPostOrder [

| children |
children := OrderedCollection new.
Expand All @@ -11,8 +11,8 @@ RBProgramNode >> allChildrenPostOrder [
^ children
]

{ #category : #'*Sindarin' }
RBProgramNode >> skipWithDebugger: aSindarinDebugger [
{ #category : '*Sindarin' }
OCProgramNode >> skipWithDebugger: aSindarinDebugger [

aSindarinDebugger step
]
7 changes: 7 additions & 0 deletions src/Sindarin/OCReturnNode.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'OCReturnNode' }

{ #category : '*Sindarin' }
OCReturnNode >> skipWithDebugger: aSindarinDebugger [

aSindarinDebugger skipReturnNode
]
4 changes: 2 additions & 2 deletions src/Sindarin/Object.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Object }
Extension { #name : 'Object' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
Object >> isExceptionSignalledForDebuggedExecution [
^ false
]
6 changes: 3 additions & 3 deletions src/Sindarin/Process.extension.st
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Extension { #name : #Process }
Extension { #name : 'Process' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
Process >> stepToSendOrReturnOrJump [

^Processor activeProcess
evaluate: [suspendedContext := suspendedContext stepToSendOrReturnOrJump]
evaluate: [ suspendedContext := suspendedContext stepToSendOrReturnOrJump ]
onBehalfOf: self
]
7 changes: 0 additions & 7 deletions src/Sindarin/RBAssignmentNode.extension.st

This file was deleted.

Loading
Loading