Skip to content

Commit

Permalink
Merge pull request #842 from StevenCostiou/16566-Fix-Vocabulary-In-De…
Browse files Browse the repository at this point in the history
…bugger-Commands

16566 fix vocabulary in debugger commands
  • Loading branch information
jecisc authored Sep 20, 2024
2 parents f48e8f6 + 3a97a04 commit 7dd5048
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ SindarinCommandsTest >> testStepToNextCallInClass [

debugger session stepIntoUntil: [ :currentContext |
currentContext method == (visitor class >> #visit:) ].
command := SindarinStepToNextCallInClassCommand forContext: debugger.
command := SindarinStepToNextExecutionInClassCommand forContext: debugger.
self
assert: debugger session context method
identicalTo: visitor class >> #visit:.
Expand All @@ -121,7 +121,7 @@ SindarinCommandsTest >> testStepToNextCallInClassFailure [

debugger session stepIntoUntil: [ :currentContext |
currentContext method == (visitor class >> #doNotVisit:) ].
command := SindarinStepToNextCallInClassCommand forContext: debugger.
command := SindarinStepToNextExecutionInClassCommand forContext: debugger.
self
assert: debugger session context method
identicalTo: visitor class >> #doNotVisit:.
Expand All @@ -143,7 +143,7 @@ SindarinCommandsTest >> testStepToNextCallInClassNeverFinishes [

debugger session stepIntoUntil: [ :currentContext |
currentContext method == (visitor class >> #visitNeverFinish:) ].
command := SindarinStepToNextCallInClassCommand forContext: debugger.
command := SindarinStepToNextExecutionInClassCommand forContext: debugger.
self
assert: debugger session context method
identicalTo: visitor class >> #visitNeverFinish:.
Expand All @@ -168,7 +168,7 @@ SindarinCommandsTest >> testStepToNextCallInClassWithError [

debugger session stepIntoUntil: [ :currentContext |
currentContext method == (visitor class >> #visitWithError:) ].
command := SindarinStepToNextCallInClassCommand forContext: debugger.
command := SindarinStepToNextExecutionInClassCommand forContext: debugger.
self
assert: debugger session context method
identicalTo: visitor class >> #visitWithError:.
Expand All @@ -191,7 +191,7 @@ SindarinCommandsTest >> testStepToNextCallInObject [

debugger session stepIntoUntil: [ :currentContext |
currentContext method == (visitor class >> #visitMultipleObjects:) ].
command := SindarinStepToNextCallInObjectCommand forContext: debugger.
command := SindarinStepToNextExecutionInObjectCommand forContext: debugger.
self
assert: debugger session context method
identicalTo: visitor class >> #visitMultipleObjects:.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Class {

{ #category : 'accessing - defaults' }
SindarinJumpToCaretCommand class >> defaultDescription [
^ 'Jump to caret so that the next instruction that will be executed is the instruction associated to the node associated to the caret. All necessary arguments are pushed on the stack but everything else is skipped and the program state (e.g : variable bindings) stay the same.'
^ 'Move the execution to the caret position without executing any code but preserving current state. Execution resumes from this position.'
]

{ #category : 'initialization' }
Expand All @@ -36,7 +36,7 @@ SindarinJumpToCaretCommand class >> defaultIconName [
SindarinJumpToCaretCommand class >> defaultName [
<toolbarExtensionDebugCommand: 50>
<codeExtensionDebugCommand:1>
^ '[Exp.] Jump to caret'
^ 'Jump to caret'
]

{ #category : 'execution' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ Class {
#package : 'NewTools-Sindarin-Commands'
}

{ #category : 'accessing' }
SindarinSkipAllToSelectionCommand class >> debuggerExtensionGroup [
"Pragma to find the method. This method should build and return a customize command groups for the debugger"

]

{ #category : 'accesing - defaults' }
SindarinSkipAllToSelectionCommand class >> defaultIconName [
^ #glamorousRightSide
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ Known issue:
- It is not possible yet to skip a return node, which could be problematic if we want to skip a return node in an ifTrue: block for instance, to see what happens when an ifFalse: block is executed
"
Class {
#name : 'SindarinSkipUpToSelectionCommand',
#name : 'SindarinSkipUpToCommand',
#superclass : 'SindarinSkipAllToSelectionCommand',
#category : 'NewTools-Sindarin-Commands',
#package : 'NewTools-Sindarin-Commands'
}

{ #category : 'accessing - defaults' }
SindarinSkipUpToSelectionCommand class >> defaultDescription [
^ 'Skips execution and stops before the selected instruction (or the instruction preceding the cursor), then returns debugger control.'
SindarinSkipUpToCommand class >> defaultDescription [
^ 'Skips execution and stops before the selected instruction (or the instruction preceding the cursor).'
]

{ #category : 'accessing - defaults' }
SindarinSkipUpToSelectionCommand class >> defaultName [
SindarinSkipUpToCommand class >> defaultName [
<toolbarExtensionDebugCommand: 50>
<codeExtensionDebugCommand: 50>
^ '[Exp.] Skip up to (stop before)'
^ 'Skip up to'
]

{ #category : 'hooks' }
SindarinSkipUpToSelectionCommand >> execute [
SindarinSkipUpToCommand >> execute [
| targetNode |

self flag: 'Context should actually be a debugger or a sindarin debugger'.
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : 'SindarinStepToNextCallCommand',
#name : 'SindarinStepToNextExecutionCommand',
#superclass : 'SindarinCommand',
#instVars : [
'debugger',
Expand All @@ -10,12 +10,12 @@ Class {
}

{ #category : 'accessing - defaults' }
SindarinStepToNextCallCommand class >> defaultIconName [
SindarinStepToNextExecutionCommand class >> defaultIconName [
^ #glamorousInto
]

{ #category : 'hooks' }
SindarinStepToNextCallCommand >> execute [
SindarinStepToNextExecutionCommand >> execute [

| callingMethod maxDepth depth |
self debuggerPresenter debuggerActionModel preventUpdatesDuring: [
Expand All @@ -28,20 +28,20 @@ SindarinStepToNextCallCommand >> execute [
depth := 0.
[
debugger method ~= callingMethod and: [
depth < maxDepth and: [ self targetCondition ] ] ] whileTrue: [
depth < maxDepth and: [ self targetCondition not] ] ] whileTrue: [
debugger step.
depth := depth + 1.
debugger hasSignalledUnhandledException ifTrue: [ depth := 1000 ] ] ].
]

{ #category : 'hooks' }
SindarinStepToNextCallCommand >> setConditionValue [
SindarinStepToNextExecutionCommand >> setConditionValue [

^ self subclassResponsibility
]

{ #category : 'hooks' }
SindarinStepToNextCallCommand >> targetCondition [
SindarinStepToNextExecutionCommand >> targetCondition [

^ self subclassResponsibility
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"
I step the execution from a starting context until the execution comes back to code that executes in the same class as the starting context's receiver's class.
"
Class {
#name : 'SindarinStepToNextExecutionInClassCommand',
#superclass : 'SindarinStepToNextExecutionCommand',
#category : 'NewTools-Sindarin-Commands',
#package : 'NewTools-Sindarin-Commands'
}

{ #category : 'accessing - defaults' }
SindarinStepToNextExecutionInClassCommand class >> defaultDescription [
^ 'Steps until the execution comes back to code executing in the current class.'
]

{ #category : 'accessing - defaults' }
SindarinStepToNextExecutionInClassCommand class >> defaultName [
<toolbarExtensionDebugCommand: 50>
<codeExtensionDebugCommand: 50>
^ 'To next execution in class'
]

{ #category : 'predicates' }
SindarinStepToNextExecutionInClassCommand >> setConditionValue [

conditionValue := debugger receiver class
]

{ #category : 'predicates' }
SindarinStepToNextExecutionInClassCommand >> targetCondition [
^debugger receiver class == conditionValue
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"
I step the execution from a starting context until the execution comes back to code that executes in a context having the same receiver as the starting context's receiver.
"
Class {
#name : 'SindarinStepToNextExecutionInObjectCommand',
#superclass : 'SindarinStepToNextExecutionCommand',
#category : 'NewTools-Sindarin-Commands',
#package : 'NewTools-Sindarin-Commands'
}

{ #category : 'accessing - defaults' }
SindarinStepToNextExecutionInObjectCommand class >> defaultDescription [
^ 'Steps until the execution comes back to code executing in the current receiver.'
]

{ #category : 'accessing - defaults' }
SindarinStepToNextExecutionInObjectCommand class >> defaultName [
<toolbarExtensionDebugCommand: 50>
<codeExtensionDebugCommand: 50>
^ 'To next execution in receiver'
]

{ #category : 'predicates' }
SindarinStepToNextExecutionInObjectCommand >> setConditionValue [

conditionValue := debugger receiver
]

{ #category : 'predicates' }
SindarinStepToNextExecutionInObjectCommand >> targetCondition [
^debugger receiver == conditionValue
]

0 comments on commit 7dd5048

Please sign in to comment.