Skip to content

Commit

Permalink
reformatting correctly captions of figures in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
adri09070 committed Jun 19, 2024
1 parent f41e707 commit 7eb4b9e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 53 deletions.
32 changes: 16 additions & 16 deletions chapters/advanced/advanced-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After clicking the _Next instance creation_ button (referred as 1 in Figure *@fig:before-step-creation@*) from the first assignment of `a` (code location referred as 2 in Figure *@fig:before-step-creation@*),

![Step to next instance creation](graphics/before-step-next-creation.png width=70&label=fig:before-step-creation)
![Before stepping to next instance creation.](graphics/before-step-next-creation.png width=70&label=fig:before-step-creation)


we get to the next instruction that creates an instance (`#basicNew`), called inside `SindarinDebugger class>>#debug:` (Figure *@fig:after-step-creation@*).

![Step to next instance creation](graphics/after-step-next-creation.png width=90&label=fig:after-step-creation)
![After stepping to next instance creation.](graphics/after-step-next-creation.png width=90&label=fig:after-step-creation)

* **Next call in receiver:** Steps the execution until a message is sent to the current context's receiver.

Expand All @@ -45,12 +45,12 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After clicking the _Next call in receiver_ button (referred as 1 in Figure *@fig:before-next-receiver@*) from the instruction `oc add: 1` (code location referred as 2 in Figure *@fig:before-next-receiver@*),

![Step to next call in receiver](graphics/before-next-call-receiver.png width=90&label=fig:before-next-receiver)
![Before stepping to next call in receiver.](graphics/before-next-call-receiver.png width=90&label=fig:before-next-receiver)

we get to the next message send `#add:` to the object `oc` with `2` as argument.
We don't stop on the message `#beginsWithAnyOf:` sent to the object `la` because `la` is a different object from `oc` (Figure *@fig:after-next-receiver@*).

![Step to next call in receiver](graphics/after-next-call-receiver.png width=90&label=fig:after-next-receiver)
![After stepping to next call in receiver.](graphics/after-next-call-receiver.png width=90&label=fig:after-next-receiver)

* **Next call in class:** Steps the execution until a message is sent to any instance of the class of the current context's receiver.

Expand All @@ -65,11 +65,11 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After clicking the _Next call in receiver_ button (referred as 1 in Figure *@fig:before-next-class@*) from the instruction `oc add: 1` (code location referred as 2 in the Figure *@fig:before-next-class@*),

![Step to next call in class](graphics/before-next-call-class.png width=90&label=fig:before-next-class)
![Before stepping to next call in class.](graphics/before-next-call-class.png width=90&label=fig:before-next-class)

We stop on the message `#beginsWithAnyOf:` sent to the object `la` because `la` is an instance from the same class as `oc` (Figure *@fig:after-next-class@*).

![Step to next call in class](graphics/after-next-call-class.png width=90&label=fig:after-next-class)
![After stepping to next call in class.](graphics/after-next-call-class.png width=90&label=fig:after-next-class)


* **To return:** Steps the execution until the current context is about to return, whether this is via a normal return, a non-local return or an implicit return, or until an unhandled exception is raised.
Expand All @@ -79,23 +79,23 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After clicking the _To return_ button (referred as 1 in Figure *@fig:before-return@*) from the bloc creation `[ ^ 42]` (code location referred as 2 in Figure *@fig:before-return@*),

![Step to return](graphics/before-step-to-return.png width=90&label=fig:before-return)
![Before stepping to return.](graphics/before-step-to-return.png width=90&label=fig:before-return)

We stop inside the block because the block evaluation is going to perform a non-local return `^ 42` (Figure *@fig:after-return@*).

![Step to return](graphics/after-step-to-return.png width=90&label=fig:after-return)
![After stepping to return.](graphics/after-step-to-return.png width=90&label=fig:after-return)


* **To method entry:** Steps the execution until a method is called, to stop at the start of its execution.

**Example:**
After clicking the _To method entry_ button (referred as 1 in Figure *@fig:before-method@*) from the start of the execution of the method `testBeginsWithAnyOf2` (code location referred as 2 in Figure *@fig:before-method@*),

![Step to method entry](graphics/before-step-method-entry.png width=90&label=fig:before-method)
![Before stepping to method entry.](graphics/before-step-method-entry.png width=90&label=fig:before-method)

We stop at the beginning of the method `new` because this is the next message that is sent during the execution (Figure *@fig:after-method@*).

![Step to method entry](graphics/after-step-method-entry.png width=90&label=fig:after-method)
![After stepping to method entry.](graphics/after-step-method-entry.png width=90&label=fig:after-method)

* **Skip:** Skips an instruction without executing it.

Expand All @@ -117,11 +117,11 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After clicking the _Skip_ button (referred as 1 in Figure *@fig:before-skip@*) when the message `unkownMessage` is going to be sent to `1` (referred as 2 in Figure *@fig:before-skip@*),

![Skip a message send](graphics/before-skip.png width=70&label=fig:before-skip)
![Before skipping a message send.](graphics/before-skip.png width=70&label=fig:before-skip)

Instead of sending the message that would raise a `MessageNotUnderstood` exception, it simulates as if the message send had returned `1` and stops on the expression `+ 42` (Figure *@fig:after-skip@*)

![Skip a message send](graphics/after-skip.png width=70&label=fig:after-skip)
![After skipping a message send.](graphics/after-skip.png width=70&label=fig:after-skip)

So, stepping this expression will return `43`, as `1 + 42` is evaluated.

Expand All @@ -136,11 +136,11 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After setting the caret to the instruction `a + 2` (code location referred as 3 in Figure *@fig:before-skip-caret@*) and clicking the _Skip up to_ button (referred as 1 in *@fig:before-skip-caret@*), from the block creation `[ a := a + 1]` (code location referred as 2 in Figure *@fig:before-skip-caret@*),

![Skip up to caret](graphics/before-skip-up-to.png width=70&label=fig:before-skip-caret)
![Before skipping up to caret.](graphics/before-skip-up-to.png width=70&label=fig:before-skip-caret)

The block creation is skipped, which returns `nil` instead, and the assignment of the variable `block` is also skipped. As a result, the variable `block` is still `nil` after skipping the code (Figure *@fig:after-skip-caret@*).

![Skip up to caret](graphics/after-skip-up-to.png width=70&label=fig:after-skip-caret)
![After skipping up to caret.](graphics/after-skip-up-to.png width=70&label=fig:after-skip-caret)

* **JumpToCaret:** jumps to the instruction under caret that can be anywhere in the home context, without changing the state of the program.

Expand All @@ -155,11 +155,11 @@ The debugging commands offered by the StDebugger in the "Advanced step" toolbar
**Example:**
After setting the caret to the instruction `a + 1` inside the embedded block (code location referred as 3 in Figure *@fig:before-jump@*) and clicking the _Jump to caret_ button (referred as 1 in Figure *@fig:before-jump@*), from the instruction `a * 42`located further in the method (referred as 2 in Figure *@fig:before-jump@*),

![Jump to caret](graphics/before-jump-to-caret.png width=70&label=fig:before-jump)
![Before jumping to caret.](graphics/before-jump-to-caret.png width=70&label=fig:before-jump)

We have now entered the embeddded block and stopped on the target instruction. The state of the program has not changed, so the value of `a` is still `3` (Figure *@fig:after-jump@*).

![Jump to caret](graphics/after-jump-to-caret.png width=70&label=fig:after-jump)
![After jumping to caret.](graphics/after-jump-to-caret.png width=70&label=fig:after-jump)



18 changes: 9 additions & 9 deletions chapters/advanced/debug-points-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Full details on the new debug points model are [described here](../basics/debug-

The tool can be opened via the `Debug > Debug Point Browser` world menu and is shown in Figure *@fig:dp-browser@*.

![Opening Debug Point Browser via the World menu](./graphics/debug-points-browser.png width=70&label=fig:dp-browser)
![Debug Point Browser, opened via the World menu.](./graphics/debug-points-browser.png width=70&label=fig:dp-browser)

On the top-left (referred as 1 in Figure *@fig:dp-browser@*), a table allows to visualize all debug points (breakpoints/watchpoints/basic debug points/etc.)
Each debug point has a name, which we could assimilate to a tag, that can be edited directly in this table.
Expand All @@ -17,45 +17,45 @@ When a debug point is selected, according to the target of the debug point, diff
If the target is an AST node, the code of the concerned method is displayed (referred as 3 in Figure *@fig:dp-browser@*), while highlighting the code corresponding to the target node.
If the target is an instance variable, all concerned methods (referred as 1 in Figure *@fig:dp-browser-variable@*) are listed and selecting a method displays the corresponding code (referred as 2 in Figure *@fig:dp-browser-variable@*) and highlights the correct variable accesses.

![Debug Point Browser with a selected debug point set on an instance variable](./graphics/debug-points-browser-variable.png width=70&label=fig:dp-browser-variable)
![Debug Point Browser with a selected debug point set on an instance variable.](./graphics/debug-points-browser-variable.png width=70&label=fig:dp-browser-variable)

Also, if the target is an instance variable, it is possible to configure the accesss strategy on which the debug point should be hit (referred as 3 in Figure *@fig:dp-browser-variable@*).

It is possible to filter the displayed debug points by name, thanks to an input field at the top (referred as 4 in Figure *@fig:dp-browser-filter@*). Validating the input field will filter so that all the remaining debug points contain the entered sequence of characters in their name.

![Filtering the displayed debug points by name, thanks to an input field](./graphics/debug-points-browser-filter-by-name.png width=70&label=fig:dp-browser-filter)
![Filtering the displayed debug points by name, thanks to an input field.](./graphics/debug-points-browser-filter-by-name.png width=70&label=fig:dp-browser-filter)

#### Object-centric debug points

To set object-centric debug points, the second button in the inspector toolbar, with the `objects` icon, allows to do the same thing in the same way as former object-centric breakpoints So, this is possible to set object-centric breakpoints and watchpoints on all variables of a target for this object (Figure *@fig:dp-oc-popover@*).

![Popover button menu, suggesting to insall object-centric debug points for an object on all instance variables](./graphics/debug-points-object-centric-popover-button.png width=75&label=fig:dp-oc-popover)
![Popover button menu, suggesting to insall object-centric debug points for an object on all instance variables.](./graphics/debug-points-object-centric-popover-button.png width=75&label=fig:dp-oc-popover)

Just as it was possible before debug points existed, it is still possible to set debug points on only some instance variables of the objects.
To do that, from the raw view in the inspector, select the variables you want to watch/break on and right-click to open a context menu to install breakpoints/watchpoints on them (Figure *@fig:dp-raw-inspector-context-menu@*).

![Context menu on an instance variable in the raw inspector, suggesting to install object-centric debug points for the selected variable only](./graphics/debug-points-object-centric-raw-context-menu.png width=35&label=fig:dp-raw-inspector-context-menu)
![Context menu on an instance variable in the raw inspector, suggesting to install object-centric debug points for the selected variable only.](./graphics/debug-points-object-centric-raw-context-menu.png width=35&label=fig:dp-raw-inspector-context-menu)

Moreover, you can set object-centric breakpoints from the meta view in the inspector. Right-click on the method on which you want to break and select **Break on call** or **Break once on call** (Figure *@fig:dp-meta-context-menu@*).

![Context menu on a method in the meta tab of the inspector, suggesting to install objec-centric debug points for the selected method](./graphics/debug-points-object-centric-break-on-call.png width=35&label=fig:dp-meta-context-menu)
![Context menu on a method in the meta tab of the inspector, suggesting to install objec-centric debug points for the selected method.](./graphics/debug-points-object-centric-break-on-call.png width=35&label=fig:dp-meta-context-menu)

Last but not least, it is also possible to change the scope of an existing debug point to an object, which was not possible before.
The third button in the inspector toolbar, with the `debug` icon, allows to do that and opens a modal to choose a debug point whose scope should be changed to the inspected object (Figure *@fig:dp-inspector-set-scope@*).

![Modal opened to choose a debug point whose scope should be changed to the inspected object](./graphics/debug-points-set-object-centric-scope-modal.png width=70&label=fig:dp-inspector-set-scope)
![Modal opened to choose a debug point whose scope should be changed to the inspected object.](./graphics/debug-points-set-object-centric-scope-modal.png width=70&label=fig:dp-inspector-set-scope)

#### UI to Create Debug Point Chains in Debug Points Browser

As [described here](../basics/debug-points.md), it is possible to add `Chain` behaviors to debug points in order to create debug point chains.

To create such a chain, you can drag a debug point and drop it on a second debug point (Figure *@fig:drag-drop@*).

![Drag and drop of debug points to create a debug point chain](./graphics/debug-points-drag-drop.png width=70&label=fig:dp-drag-drop)
![Drag and drop of debug points to create a debug point chain.](./graphics/debug-points-drag-drop.png width=70&label=fig:dp-drag-drop)

In this case, the dragged debug point becomes the child in a chain of a debug point on which it is dropped (Figure *@fig:dp-created-chain@*).

![Created debug point chain via drag and drop](./graphics/debug-points-created-chain.png width=70&label=fig:dp-created-chain)
![Created debug point chain via drag and drop.](./graphics/debug-points-created-chain.png width=70&label=fig:dp-created-chain)

Please note that this is not possible to create circular debug point chains. So, if A is child of B, B cannot be child of A.

Expand Down
Loading

0 comments on commit 7eb4b9e

Please sign in to comment.