Skip to content

Commit

Permalink
chest: writing integration to the debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
adri09070 committed Jun 19, 2024
1 parent 5c37050 commit fba23a1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 7 deletions.
6 changes: 2 additions & 4 deletions chapters/chest/Intro/Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ Instances of `Chest` hold strong references to stored objects, which means that

#### Open Chest

_Chest_'s main _GUI_ can be opened **via an entry in the "Debug" world menu** of Pharo (Figure *@fig:chest-debug-menu@*).

![_Chest_ in _Debug_ World Menu](./figures/chest-debug-menu.png width=70&label=fig:chest-debug-menu)

_Chest_ can also be enabled as a _debugger extension_ in the debugging settings of Pharo (Figure *@fig:chest-extension-settings@*).
_Chest_'s main _GUI_ can be opened **via an entry in the "Debug" world menu** of Pharo (Figure *@fig:chest-debug-menu@*).

![_Chest_ Debugger Extension in the Pharo Settings](./figures/chest-extension-in-settings.png width=90&label=fig:chest-extension-settings)


_Chest_ can also be enabled as a _debugger extension_ in the debugging settings of Pharo (Figure *@fig:chest-extension-settings@*).

29 changes: 26 additions & 3 deletions chapters/chest/chest_integration/chest_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,31 @@ An object copied to the clipboard can be accessed until one of the following con
- the object has been garbage-collected if it is not referenced anywhere else in the system,
- 10 objects have been stored into the clipboard chest after this object has been stored into the clipboard chest.

#### Integration in debugger
#### Integration of Chest to the Debugger

Chest, as a debugger extension, provides a playground. All bindings between this playground and the debugger selected context are shared. So: all variables defined in this playground are recognized by the debugger and all variables from the debugger's selected context or loaded from Chest into the debugger are recognized by the playground.
_Chest_ also provides a _GUI_ that is directly integrated into the debugger as a debugger extension, which provides the same information and actions than the _GUI_ that was described [in the previous section](#chest-graphical-user-interface).

![_Chest_ Debugger Extension Activated from the Debugger Settings](./figures/chest-extension-settings-in-debugger.png width=70&label=fig:chest-extension-settings-in-debugger)

The _Chest_ debugger extension settings can be displayed from the system settings (Figure *@fig:chest-extension-settings@*) or directly from a debugger (Figure *@fig:chest-extension-settings-in-debugger@*).

![_Chest_ Debugger Extension Activated from the Debugger Settings](./figures/chest-debugger-extension.png width=70&label=fig:chest-debugger-extension)

When the _Chest_ debugger extension is activated, it is displayed in the right pane of each debugger extension, as any other debugger extension would (Figure *@fig:chest-debugger-extension@*).

Chest as a debugger extension, just like its main _GUI_, provides a playground to load bindings from chests into it.
However, contrary to its main _GUI_, the debugger extension does not show an inspector and, instead of showing a table for all chests and a table for their content, it shows both chests and their content together in a tree view.
All roots of this tree are the chests, which can be expanded to show the objects they contain.
For each chest and object, their name and value are displayed in the tree view.
A chest can have a different icon according to their type: normal chest, weak chest or clipboard chest.

The _Chest_ debugger extension allows to perform the same actions than the main _GUI_.
When right-clicking on a chest, all actions on this chest can be performed.
When right-clicking on an object in a chest, all actions on this object and all actions on its wrapping chest can be performed.

![Variable From _Chest_ Debugger Extension Playground Evaluated in Debugger](./figures/chest-extension-playground-variable-evaluated-in-debugger.png width=70&label=fig:chest-extension-playground-variable-evaluated-in-debugger)

![Variable From Debugger Evaluated in _Chest_ Debugger Extension Playground](./figures/variable-from-debugger-evaluated-in-chest-extension-playground.png width=70&label=fig:variable-from-debugger-evaluated-in-chest-extension-playground)

A major advantage of the _Chest_ debugger extension is that all bindings from its playground and from the debugger selected context are shared. So: all variables defined in this playground are recognized by the debugger (Figure *@fig:chest-extension-playground-variable-evaluated-in-debugger@*) and all variables from the debugger's selected context or loaded from Chest into the debugger are recognized by the playground. (Figure *@fig:variable-from-debugger-evaluated-in-chest-extension-playground@*).

![Variable from Chest playground, not visible in the debugger inspector](./figures/variable-from-chest-playground-are-not-visible-in-debugger-inspector.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fba23a1

Please sign in to comment.