# An extensible production-level debugger

Adrien Vanègue, Steven Costiou

► To cite this version:

Adrien Vanègue, Steven Costiou. An extensible production-level debugger. Journées Nationales du GDR-GPL 2023, Jun 2023, Rennes, France. hal-04130163

HAL Id: hal-04130163

https://inria.hal.science/hal-04130163

Submitted on 15 Jun 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# An extensible production-level debugger

Adrien Vanègue

Steven Costiou

<figure><img src="image_2.png" /></figure>

<figure><img src="image_3.png" /></figure>

Groupement
de recherche

GPL Génie de la programmation
et du logiciel

Gt-Debugging

## Problem: building and evaluating new debuggers

Debuggers are difficult to build.

* Huge development costs

* Difficult to reuse: prototypes are often one-shot

* Costly and difficult to maintain

* Difficult to test

<figure><img src="image_4.png" /></figure>

How to make debuggers extensible
to facilitate the construction
and maintenance of new prototypes?

Debuggers are difficult to evaluate.

* Prototypes are often unstable

* Difficult to evaluate on real-world scenarios:
  practitioners need to adopt and use the new debugger

<figure><img src="image_5.png" /></figure>

How to make debuggers solid to make
them usable in practice and
evaluate them?

## Requirements for extensible production-level debugger

<figure><img src="image_6.png" /></figure>

Modular and easy to reuse,
test and maintain

<figure><img src="image_7.png" /></figure>

extensible and easy
to build on top

<figure><img src="image_8.png" /></figure>

<figure><img src="image_9.png" /></figure>

production-level and
regularly maintained

Testing

<figure><img src="image_10.png" /></figure>

Tools resulting from prototypes are
stable, through **testing** and **bug fixes**

<figure><img src="image_11.png" /></figure>

<figure><img src="image_12.png" /></figure>

Easy to adopt: practitioners
use the debugger they know
along with the new tool

## The Pharo debugger design

<figure><img src="image_13.png" /></figure>

## Building new debugging tools: Examples

**CHEST:**
a global
collection
with an API to
access
objects from
everywhere

1. copy `a` from program 1

while debugging code
methodWithTwoAssignments

```ruby
| a |

a := 1.

a := 5.

^ Point x: 5 y: '3' asInteger
```

store `a` in chest

Chest
inChest: 'ClipboardDefault'
at: 'clipboardEntry'
put: a

API Example

<figure><img src="image_14.png" /></figure>

`a` is now in a chest

2. paste `a` from program 1 into program 2

<figure><img src="image_15.png" /></figure>

load `a` from
program 1
into
program 2

<figure><img src="image_16.png" /></figure>

integrated as debugger extension

How to compare
my objects
between program 1 and 2 ?

inside program 2

toto == tata false

**JUMP
TO
CARET:**

<figure><img src="image_17.png" /></figure>

Scenario: we expect our code
to take the `ifFalse:` path
but takes the `ifTrue:` path

The program state is identical before and after having jumped to caret!
We can now debug this branch!

```ruby
a < 100
ifTrue: [ 'doSomeCode' printString ]
ifFalse: [ 'doSomeOtherCode' printString ]
```

We can **jump to caret,**
to see what would happen
if the other branch was executed

we are now there

A production
debugger
integrated
into the
Pharo
language

THALES

<figure><img src="image_18.png" /></figure>

REAL USERS

moldable debugger, possible to add:
- **specific debugging operations**
- **specific debugging tools**

new debugging tools can
be used as **extensions of the
existing debugger**

Concerns are separated as
each composant is independent:
the interpreter, the model, the API,
the UI, the **debugging commands,**
and the **debugger extensions**

3 main contributors,
958 commits

Listening to feedback from users

The debugger is used for empirical
evaluation of research prototypes

Lots of contributions merged
into the Pharo baseline

559 tests

<figure><img src="image_19.png" /></figure>