This is a Pharo project which launches projects, collect the execution trace and then returns this trace. Note that it only supports launching of Python projects for now.
In a Pharo 13 image, launch the following code in a Playground
Metacello new
baseline: 'StackCollector';
repository: 'github://Divergence-Driven-Debugging/D3-StackCollector';
onConflictUseIncoming;
loadThe Python trace collector relies on a local Python virtual environment and the debugpy DAP adapter.
From the root directory of your Pharo image, create a virtual environment named venv and install debugpy:
python3 -m venv venv
source venv/bin/activate
pip install -r pharo-local/iceberg/Divergence-Driven-Debugging/D3-StackCollector/requirements.txtThe trace collector expects the following structure:
<image-directory>/
├── venv/
│ ├── bin/
│ │ └── python3
├── Pharo.image
└── pharo-local/
You also have to install external tools for other langages (Java, JavaScript, ...) and add their path to the .env file:
- java-debug adapter from Microsoft (
JAVA_DEBUGin.env); - java language serveur (
JDTLSin.emv); - vscode-js-debug (
JS_DEBUGin.env).
Once you've install the requierements, you can use the trace collector by doing in your Pharo Playground:
result := TraceCollector new
collectWithoutAssignmentFor: ProjectLangage
onProject: 'my/project/directory'
withEntryPoint: '/my/project/directory/entrypoint'Where:
ProjectLangageis a subclass ofSupportedLanguagecorresponding to your project langage (ex:PythonLanguage,JSLanguage,JavaLanguage, ...)'my/project/directory'is the path to your project directory'/my/project/directory/entrypoint'is the path to the entry point of your project (ex: amain.pyfile in a python project)
Then you will get an array corresponding to the execution trace in result variable.