Skip to content

Pharo13 lost changes from master #102

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 15 commits into from
Mar 18, 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
4 changes: 2 additions & 2 deletions .github/workflows/scriptabledebugger-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
smalltalk: [ Pharo64-13 ]
smalltalk: [ Pharo64-alpha ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2 # or 3
- uses: actions/checkout@v3
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scriptabledebugger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
smalltalk: [ Pharo64-13 ]
smalltalk: [ Pharo64-alpha ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2 # or 3
- uses: actions/checkout@v3
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Steven Costiou, Inria <[email protected]>
Adrien Vanègue, Inria <[email protected]>
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Steven Costiou, Adrien Vanègue

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# Sindarin
Instanciate a UI-less debugger on your execution, allowing you to manipulate and inspect it via scripting.
The API is on the `SindarinDebugger` class.
Sindarin is a versatile and interactive debugger scripting API for object-oriented programming languages. Sindarin is designed to help building dedicated debugging tools targeting specific problems or domains.
To do this, Sindarin attaches to a running process then exposes stepping and introspection operations to control, manipulate and observe that process’ execution.
It simplifies the creation of personalized debugging scripts by providing an AST-based API, thus also proposing different stepping granularity over the debugging session.
Once written, scripts are extensible and reusable on other scenario, and can be used to build more complex debugging tools.

**Research paper:** [Sindarin: A Versatile Scripting API for the Pharo Debugger](https://hal.archives-ouvertes.fr/hal-02280915)

### Main authors
- [Steven Costiou](https://github.com/StevenCostiou) (2019 - ...)
- [Adrien Vanègue](https://github.com/adri09070) (2022 - 2024)

- Original author: **Thomas Dupriez** (dupriezt on github)
- Research paper: [Sindarin: A Versatile Scripting API for the Pharo Debugger](https://hal.archives-ouvertes.fr/hal-02280915)
### Original author
- [Thomas Dupriez](https://github.com/dupriezt) (2019 - 2021)

## Usage

Instanciate a UI-less debugger on your execution, allowing you to manipulate and inspect it via scripting.
The API is on the `SindarinDebugger` class.

```Smalltalk
dbg := SindarinDebugger debug: [<your code>].
"Manipulate and inspect the debugged execution by sending messages to dbg"
Expand Down
11 changes: 6 additions & 5 deletions src/BaselineOfSindarin/BaselineOfSindarin.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Class {
#name : #BaselineOfSindarin,
#superclass : #BaselineOf,
#category : #BaselineOfSindarin
#name : 'BaselineOfSindarin',
#superclass : 'BaselineOf',
#category : 'BaselineOfSindarin',
#package : 'BaselineOfSindarin'
}

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfSindarin >> baseline: spec [

<baseline>
Expand All @@ -21,7 +22,7 @@ BaselineOfSindarin >> baseline: spec [
group: 'experiments' with: #( 'default' 'Sindarin-Experiments' )
]

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfSindarin >> postloadWithLoader: loader withPackageSpec: spec [

InstructionStream compiledMethodAt: #willJumpIfFalse ifAbsent: [
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfSindarin/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfSindarin }
Package { #name : 'BaselineOfSindarin' }
17 changes: 9 additions & 8 deletions src/Sindarin-Demo/SindarinDemo.class.st
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
Class {
#name : #SindarinDemo,
#superclass : #Object,
#name : 'SindarinDemo',
#superclass : 'Object',
#instVars : [
'count'
],
#category : #'Sindarin-Demo'
#category : 'Sindarin-Demo',
#package : 'Sindarin-Demo'
}

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo >> doThings1 [
1+1.
ZeroDivide signal.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo >> doThings2 [
Point x: 2 y: 2.
SubscriptOutOfBounds signal.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo >> doThingsAndSignalExceptions [
self doThings1.
Error signal.
self doThings2.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo >> primeCount [
count := 0.
{ 2. 3. 5. 7. 10. 11. 13. 17. 19. 23 } do: [:int | count := count + int ]

]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo >> primeCountHalt [.
count := 0.
self halt.
Expand Down
27 changes: 14 additions & 13 deletions src/Sindarin-Demo/SindarinDemo_GoldDigger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,61 +7,62 @@ dbg step: 3; stepOver: 2; step: 3.

"
Class {
#name : #'SindarinDemo_GoldDigger',
#superclass : #Object,
#category : #'Sindarin-Demo'
#name : 'SindarinDemo_GoldDigger',
#superclass : 'Object',
#category : 'Sindarin-Demo',
#package : 'Sindarin-Demo'
}

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> gold [
^ 42
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> moreRock [
^self
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock [
self halt.
self rock1
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock1 [
self rock2
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock2 [
self rock3
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock3 [
self moreRock.
self moreRock.
self rock4.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock4 [
self rock5.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock5 [
self rock6.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> rock6 [
"Relevant point for the bug you are tracking"
self gold.
]

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
SindarinDemo_GoldDigger >> start [
self rock
]
23 changes: 12 additions & 11 deletions src/Sindarin-Demo/SindarinDemo_SkipNextException.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,50 @@ dbg := SindarinDebugger debug: [ SindarinDemo_SkipNextException new start ].
dbg skip.
"
Class {
#name : #'SindarinDemo_SkipNextException',
#superclass : #Object,
#category : #'Sindarin-Demo'
#name : 'SindarinDemo_SkipNextException',
#superclass : 'Object',
#category : 'Sindarin-Demo',
#package : 'Sindarin-Demo'
}

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method1 [
self halt.
self method2.
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method2 [
self method3.
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method3 [
self method4.
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method4 [
self method5.
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method5 [
Error signal: 'Something truly unexpected happened :)'.
self method6.
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method6 [
self method7.
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> method7 [
^ 42
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_SkipNextException >> start [
self method1
]
11 changes: 6 additions & 5 deletions src/Sindarin-Demo/SindarinDemo_StepToNextIteration.class.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Class {
#name : #'SindarinDemo_StepToNextIteration',
#superclass : #Object,
#category : #'Sindarin-Demo'
#name : 'SindarinDemo_StepToNextIteration',
#superclass : 'Object',
#category : 'Sindarin-Demo',
#package : 'Sindarin-Demo'
}

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_StepToNextIteration >> start [
self sum
]

{ #category : #accessing }
{ #category : 'accessing' }
SindarinDemo_StepToNextIteration >> sum [
| count |
self halt.
Expand Down
2 changes: 1 addition & 1 deletion src/Sindarin-Demo/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Sindarin-Demo' }
Package { #name : 'Sindarin-Demo' }
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
Class {
#name : #'Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass',
#superclass : #TestCase,
#name : 'Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass',
#superclass : 'TestCase',
#instVars : [
'breakpointsBeforeTest'
],
#category : #'Sindarin-Experiments'
#category : 'Sindarin-Experiments',
#package : 'Sindarin-Experiments'
}

{ #category : #tests }
{ #category : 'tests' }
Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass >> helperMethod13 [
| a |
a := 5.
^ Point x: 5 y: '3' asInteger.
]

{ #category : #running }
{ #category : 'running' }
Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass >> runCaseManaged [
"This prevents the TestExecutionEnvironment from trying to kill processes created during the test. Without it, it adds on:do: contexts on the process, and this somehow makes the process answers true to isTerminating, triggering the protection against stepping terminating processes from DebugSessionPlus>>stepInto:
It is not necessary to terminate processes created by ScriptableDebugger because these processes are not scheduled."
Expand All @@ -23,20 +24,20 @@ Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass >> runCaseManaged [
^ self runCase.
]

{ #category : #running }
{ #category : 'running' }
Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass >> setUp [
"Hooks that subclasses may override to define the fixture of test."
breakpointsBeforeTest := VirtualBreakpoint all.
VirtualBreakpoint all removeAll.
]

{ #category : #running }
{ #category : 'running' }
Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass >> tearDown [
VirtualBreakpoint all removeAll.
breakpointsBeforeTest do: [ :brkpt | VirtualBreakpoint all add: brkpt ].
]

{ #category : #tests }
{ #category : 'tests' }
Bug_TestPassesWhenRanAloneButFailsWhenRanFromTheClass >> testStep [
<haltOrBreakpointForTesting>
| node scdbg |
Expand Down
Loading
Loading