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
Changes from 1 commit
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
Next Next commit
Cleanup: do not use #notNil, use #isNotNil instead
Fix #95
astares committed May 16, 2024
commit 18b9e5b79f53cbbb46cc7fc94c0034594ddfd8da
2 changes: 1 addition & 1 deletion src/Sindarin-Tests/SindarinDebugSessionTest.class.st
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions src/Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
@@ -136,7 +136,6 @@ SindarinDebuggerTest >> methodWithNotEvaluatedBlockWhoseCreationIsFirstBytecodeI
^ a * 42
]


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

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

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

| scdbg nodeWithImplicitReturn |
@@ -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.
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
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.
@@ -24,7 +24,7 @@ DebugSession >> stepToFirstInterestingBytecodeWithJumpIn: aProcess [
^ aProcess stepToSendOrReturnOrJump
]

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

interruptedContext := aContext
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."
@@ -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"

8 changes: 5 additions & 3 deletions src/Sindarin/NodeNotInASTError.class.st
Original file line number Diff line number Diff line change
@@ -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
@@ -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'
}
4 changes: 2 additions & 2 deletions src/Sindarin/OCBytecodeToASTCache.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #OCBytecodeToASTCache }
Extension { #name : 'OCBytecodeToASTCache' }

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

^ self methodOrBlockNode bcToASTCache bcToASTMap keys sorted detect: [
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
]
4 changes: 2 additions & 2 deletions src/Sindarin/Process.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Process }
Extension { #name : 'Process' }

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

^Processor activeProcess
4 changes: 2 additions & 2 deletions src/Sindarin/RBAssignmentNode.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #RBAssignmentNode }
Extension { #name : 'RBAssignmentNode' }

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

aSindarinDebugger skipAssignmentNodeCompletely
18 changes: 10 additions & 8 deletions src/Sindarin/RBBlockDefinitionSearchingVisitor.class.st
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
Class {
#name : #RBBlockDefinitionSearchingVisitor,
#superclass : #RBProgramNodeVisitor,
#name : 'RBBlockDefinitionSearchingVisitor',
#superclass : 'RBProgramNodeVisitor',
#instVars : [
'blockToSearch',
'isBlockFound'
],
#category : #'Sindarin-Base'
#category : 'Sindarin-Base',
#package : 'Sindarin',
#tag : 'Base'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
RBBlockDefinitionSearchingVisitor class >> newToSearch: aBlockNode [

^ self new
blockToSearch: aBlockNode;
yourself
]

{ #category : #accessing }
{ #category : 'accessing' }
RBBlockDefinitionSearchingVisitor >> blockToSearch: aBlockNode [

blockToSearch := aBlockNode.
isBlockFound := false
]

{ #category : #initialization }
{ #category : 'initialization' }
RBBlockDefinitionSearchingVisitor >> initialize [

isBlockFound := false
]

{ #category : #accessing }
{ #category : 'accessing' }
RBBlockDefinitionSearchingVisitor >> isBlockFound [

^ isBlockFound
]

{ #category : #visiting }
{ #category : 'visiting' }
RBBlockDefinitionSearchingVisitor >> visitNode: aNode [

super visitNode: aNode.
12 changes: 6 additions & 6 deletions src/Sindarin/RBBlockNode.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #RBBlockNode }
Extension { #name : 'RBBlockNode' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
RBBlockNode >> 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"
@@ -13,13 +13,13 @@ RBBlockNode >> executedNodesAfter: aNode [
^ nodesAfter
]

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

^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
]

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

"Find first node that is after aNode that has an associated pc in method node all children (post-order)"
@@ -31,7 +31,7 @@ RBBlockNode >> nextExecutedNodeAfter: aNode [
^ nodesAfter at: indexOfNextNode
]

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

^ self allChildren reversed
@@ -40,7 +40,7 @@ RBBlockNode >> parentOfIdenticalSubtree: subtree [
ifNone: [ nil ]
]

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

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

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

aSindarinDebugger skipMessageNode
12 changes: 6 additions & 6 deletions src/Sindarin/RBMethodNode.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #RBMethodNode }
Extension { #name : 'RBMethodNode' }

{ #category : #'*Sindarin' }
{ #category : '*Sindarin' }
RBMethodNode >> 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"
@@ -13,13 +13,13 @@ RBMethodNode >> executedNodesAfter: aNode [
^ nodesAfter
]

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

^ self bcToASTCache firstRecursiveBcOffsetForStatementNode: aStatementNode
]

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

"Find first node that is after aNode that has an associated pc in method node all children (post-order)"
@@ -31,7 +31,7 @@ RBMethodNode >> nextExecutedNodeAfter: aNode [
^ nodesAfter at: indexOfNextNode
]

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

^ self allChildren reversed
@@ -40,7 +40,7 @@ RBMethodNode >> parentOfIdenticalSubtree: subtree [
ifNone: [ nil ]
]

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

| statementNode parentOfStatementNode |
6 changes: 3 additions & 3 deletions src/Sindarin/RBProgramNode.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #RBProgramNode }
Extension { #name : 'RBProgramNode' }

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

| children |
@@ -11,7 +11,7 @@ RBProgramNode >> allChildrenPostOrder [
^ children
]

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

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

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

aSindarinDebugger skipReturnNode
38 changes: 20 additions & 18 deletions src/Sindarin/SindarinDebugSession.class.st
Original file line number Diff line number Diff line change
@@ -4,17 +4,19 @@ stepRecord: StepRecord
StepRecords: LinkedList[StepRecord]
"
Class {
#name : #SindarinDebugSession,
#superclass : #Object,
#name : 'SindarinDebugSession',
#superclass : 'Object',
#instVars : [
'triggerEventOn',
'canBeTerminated',
'debugSession'
],
#category : #'Sindarin-Core'
#category : 'Sindarin-Core',
#package : 'Sindarin',
#tag : 'Core'
}

{ #category : #'instance creation' }
{ #category : 'instance creation' }
SindarinDebugSession class >> newWithName: aString forProcess: aProcess [

^ DebugSession new
@@ -23,73 +25,73 @@ SindarinDebugSession class >> newWithName: aString forProcess: aProcess [
asSindarinDebugSession
]

{ #category : #initialization }
{ #category : 'initialization' }
SindarinDebugSession >> activateEventTriggering [
triggerEventOn := true.
self flag: 'Why not refreshing?'.
"self refreshAttachedDebugger."
]

{ #category : #converting }
{ #category : 'converting' }
SindarinDebugSession >> asSindarinDebugSession [

^ self
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDebugSession >> canBeTerminated [

^ canBeTerminated
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDebugSession >> canBeTerminated: anObject [

canBeTerminated := anObject
]

{ #category : #initialization }
{ #category : 'initialization' }
SindarinDebugSession >> deactivateEventTriggering [

triggerEventOn := false
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDebugSession >> debugSession [

^ debugSession
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDebugSession >> debugSession: anObject [

debugSession := anObject
]

{ #category : #initialization }
{ #category : 'initialization' }
SindarinDebugSession >> initialize [

super initialize.
triggerEventOn := true.
canBeTerminated := true
]

{ #category : #initialization }
{ #category : 'initialization' }
SindarinDebugSession >> refreshAttachedDebugger [
"The following lines are to force possible debuggers observing the same debug session to update themselves based"

self debugSession triggerEvent: #contextChanged
]

{ #category : #'debugging actions' }
{ #category : 'debugging actions' }
SindarinDebugSession >> resumeAndClear [

self debugSession
resume;
clear
]

{ #category : #'debugging actions' }
{ #category : 'debugging actions' }
SindarinDebugSession >> stepInto: aContext [
"Should not step more a process that is terminating, otherwise the image will get locked."
self flag: 'Why the image gets locked? Please investigate.'.
@@ -99,7 +101,7 @@ SindarinDebugSession >> stepInto: aContext [
^ self debugSession stepInto: aContext
]

{ #category : #'debugging actions' }
{ #category : 'debugging actions' }
SindarinDebugSession >> stepOver: aContext [
"Should not step more a process that is terminating, otherwise the image will get locked."
self flag: 'Why the image gets locked? Please investigate.'.
@@ -109,13 +111,13 @@ SindarinDebugSession >> stepOver: aContext [
^ self debugSession stepOver: aContext
]

{ #category : #'debugging actions' }
{ #category : 'debugging actions' }
SindarinDebugSession >> terminate [

canBeTerminated ifTrue: [ ^ self debugSession terminate ]
]

{ #category : #'debugging actions' }
{ #category : 'debugging actions' }
SindarinDebugSession >> triggerEvent: anEventSelector [

triggerEventOn ifTrue: [
110 changes: 56 additions & 54 deletions src/Sindarin/SindarinDebugger.class.st

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/Sindarin/SindarinSkippingReturnWarning.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Class {
#name : #SindarinSkippingReturnWarning,
#superclass : #Warning,
#category : #'Sindarin-Exceptions'
#name : 'SindarinSkippingReturnWarning',
#superclass : 'Warning',
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}
8 changes: 5 additions & 3 deletions src/Sindarin/SteppingATerminatingProcess.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Class {
#name : #SteppingATerminatingProcess,
#superclass : #Error,
#category : #'Sindarin-Exceptions'
#name : 'SteppingATerminatingProcess',
#superclass : 'Error',
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}
80 changes: 41 additions & 39 deletions src/Sindarin/TSindarin.trait.st
Original file line number Diff line number Diff line change
@@ -2,50 +2,52 @@
I am a trait that contains the core API that a scriptable debugger should use
"
Trait {
#name : #TSindarin,
#name : 'TSindarin',
#instVars : [
'process',
'sindarinSession',
'blockToDebug'
],
#category : #'Sindarin-Core'
#category : 'Sindarin-Core',
#package : 'Sindarin',
#tag : 'Core'
}

{ #category : #start }
{ #category : 'start' }
TSindarin classSide >> attachTo: aDebugSession [
"Returns a new instance of ScriptableDebugger attached to aDebugSession"

^ self new attachTo: aDebugSession
]

{ #category : #actions }
{ #category : 'actions' }
TSindarin classSide >> closeAllDebuggers [
<script>

self allInstances do: [ :dbg | dbg terminate ]
]

{ #category : #start }
{ #category : 'start' }
TSindarin classSide >> debug: aBlock [
"Creates an execution of aBlock and returns an instance of ScriptableDebugger attached to this execution"

^ self new debug: aBlock
]

{ #category : #'instance creation' }
{ #category : 'instance creation' }
TSindarin classSide >> debugSession: aDebugSession [

^ self attachTo: aDebugSession
]

{ #category : #'stack access - helpers' }
{ #category : 'stack access - helpers' }
TSindarin >> arguments [
"Returns the arguments of the current stack-frame."

^ self context arguments
]

{ #category : #start }
{ #category : 'start' }
TSindarin >> attachTo: aDebugSession [
"Attaches this scriptable debugger to an already existing instance of DebugSession or SindarinDebugSession"

@@ -54,51 +56,51 @@ TSindarin >> attachTo: aDebugSession [
sindarinSession deactivateEventTriggering
]

{ #category : #'debug - stepping' }
{ #category : 'debug - stepping' }
TSindarin >> basicStep [

self debugSession stepInto
]

{ #category : #'debug - stepping' }
{ #category : 'debug - stepping' }
TSindarin >> basicStepOver [

^ self debugSession stepOver
]

{ #category : #'debug - stepping' }
{ #category : 'debug - stepping' }
TSindarin >> basicStepThrough [

self debugSession stepThrough
]

{ #category : #cleaning }
{ #category : 'cleaning' }
TSindarin >> cleanStack [

[ self context stackPtr > self context numTemps ] whileTrue: [
self context pop ]
]

{ #category : #'stack access' }
{ #category : 'stack access' }
TSindarin >> context [
"Returns a reification of the current stack-frame."

^ self debugSession interruptedContext
]

{ #category : #private }
{ #category : 'private' }
TSindarin >> currentContextStackSize [

^ self context basicSize
]

{ #category : #process }
{ #category : 'process' }
TSindarin >> currentProcess [

^ process
]

{ #category : #start }
{ #category : 'start' }
TSindarin >> debug: aBlock [

blockToDebug := aBlock.
@@ -112,14 +114,14 @@ TSindarin >> debug: aBlock [
[ self context closure == blockToDebug ] whileFalse: [ self step ]
]

{ #category : #accessing }
{ #category : 'accessing' }
TSindarin >> debugSession [
"Returns the DebugSession representing the execution this ScriptableDebugger is debugging"

^ sindarinSession debugSession
]

{ #category : #private }
{ #category : 'private' }
TSindarin >> instanceCreationPrimitives [
"* 70 */ primitiveNew,
/* 71 */ primitiveNewWithArg,
@@ -131,30 +133,30 @@ TSindarin >> instanceCreationPrimitives [
^ #( 70 71 79 148 160 )
]

{ #category : #accessing }
{ #category : 'accessing' }
TSindarin >> instructionStream [

^ self context instructionStream
]

{ #category : #'stack access - testing' }
{ #category : 'stack access - testing' }
TSindarin >> isAssignment [
^self node isAssignment
]

{ #category : #'stack access' }
{ #category : 'stack access' }
TSindarin >> isExecutionFinished [
"Returns whether the debugged execution is finished"

^ process isTerminated
]

{ #category : #'stack access - testing' }
{ #category : 'stack access - testing' }
TSindarin >> isMessageSend [
^self node isMessage
]

{ #category : #'stack access - helpers' }
{ #category : 'stack access - helpers' }
TSindarin >> method [
"Returns the method of the current stack-frame."

@@ -163,29 +165,29 @@ TSindarin >> method [
^ self context method
]

{ #category : #accessing }
{ #category : 'accessing' }
TSindarin >> methodNode [

self flag:
'There is something bad here. This method returns the node of the compiled code (so a block node for a block). We should distinguish methodNode and methodOrBlockNode. See flag in #method'.
^ self method ast
]

{ #category : #astAndAstMapping }
{ #category : 'astAndAstMapping' }
TSindarin >> node [
"Returns the AST node about to be executed by the top context of the execution"

^ self nodeForContext: self context
]

{ #category : #astAndAstMapping }
{ #category : 'astAndAstMapping' }
TSindarin >> nodeForContext: aContext [
"Returns the AST node about to be executed by the top context of the execution"

^ self method sourceNodeForPC: aContext pc
]

{ #category : #'accessing - context' }
{ #category : 'accessing - context' }
TSindarin >> outerMostContextOf: aContext [

| currentContext oldContext |
@@ -197,80 +199,80 @@ TSindarin >> outerMostContextOf: aContext [
^ currentContext
]

{ #category : #accessing }
{ #category : 'accessing' }
TSindarin >> pc [

^ self context pc
]

{ #category : #'stack access - helpers' }
{ #category : 'stack access - helpers' }
TSindarin >> readVariableNamed: aSymbol [

^ self context readVariableNamed: aSymbol
]

{ #category : #'stack access - helpers' }
{ #category : 'stack access - helpers' }
TSindarin >> receiver [
"Returns the receiver of the current stack-frame."

^ self context receiver
]

{ #category : #start }
{ #category : 'start' }
TSindarin >> restart [
"Resets this debugger on a new execution of the block passed as argument to the initial call to #debug:"

self initialize.
self debug: blockToDebug
]

{ #category : #'stepping - auto' }
{ #category : 'stepping - auto' }
TSindarin >> resume [

sindarinSession resumeAndClear
]

{ #category : #'stack access - helpers' }
{ #category : 'stack access - helpers' }
TSindarin >> selector [
"Returns the selector of the current stack-frame."

^ self context selector
]

{ #category : #accessing }
{ #category : 'accessing' }
TSindarin >> sindarinSession: aSindarinDebugSession [

sindarinSession := aSindarinDebugSession
]

{ #category : #'stepping - skip' }
{ #category : 'stepping - skip' }
TSindarin >> skipPcToNextBytecode [

| currentBytecode |
currentBytecode := self nextBytecode.
self context pc: self context pc + currentBytecode bytes size
]

{ #category : #'stack access' }
{ #category : 'stack access' }
TSindarin >> stack [
"Returns a list of context objects representing the current call stack."

^ self debugSession stack
]

{ #category : #accessing }
{ #category : 'accessing' }
TSindarin >> symbolicBytecodesForCurrent [

^ self method symbolicBytecodes
]

{ #category : #process }
{ #category : 'process' }
TSindarin >> terminate [

sindarinSession terminate
]

{ #category : #'stack access - helpers' }
{ #category : 'stack access - helpers' }
TSindarin >> topStack [

^ self context top
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Class {
#name : #UnhandledExceptionSignalledByADebuggedExecution,
#superclass : #DebuggedExecutionException,
#name : 'UnhandledExceptionSignalledByADebuggedExecution',
#superclass : 'DebuggedExecutionException',
#instVars : [
'unhandledException'
],
#category : #'Sindarin-Exceptions'
#category : 'Sindarin-Exceptions',
#package : 'Sindarin',
#tag : 'Exceptions'
}

{ #category : #signalling }
{ #category : 'signalling' }
UnhandledExceptionSignalledByADebuggedExecution class >> signalWithException: anException [

self new
@@ -16,13 +18,13 @@ UnhandledExceptionSignalledByADebuggedExecution class >> signalWithException: an
'An execution debugged by a scriptable debugger signalled an exception that it did not handle itself. You can find this exception is in the #unhandledException instance variable of this object.'
]

{ #category : #accessing }
{ #category : 'accessing' }
UnhandledExceptionSignalledByADebuggedExecution >> unhandledException [

^ unhandledException
]

{ #category : #accessing }
{ #category : 'accessing' }
UnhandledExceptionSignalledByADebuggedExecution >> unhandledException: anException [

unhandledException := anException
2 changes: 1 addition & 1 deletion src/Sindarin/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #Sindarin }
Package { #name : 'Sindarin' }