Skip to content

Commit c9ede0e

Browse files
committed
Update breakpoints section of IDE 2.x debugger tutorial to reflect new behavior
The version of the "Cortex-Debug" VS Code extension that provides the integrated sketch debugger for Arduino IDE 2.x was updated for the Arduino IDE 2.0.3 release. This update resulted in some changes in the behavior of the debugger. One of these changes is in how the debugger behaves when it is started: When started, the version of the debugger (0.3.10) used by Arduino IDE 2.0.2 and older would pause at some point at the start of the program (e.g., the `Reset_Handler` function in the cortex_handlers.c file of the "Arduino SAMD Boards (32-bits ARM Cortex-M0+)" platform). When started, the version of the debugger (1.5.1) used by Arduino IDE 2.0.3 and newer simply runs the sketch program, only automatically pausing if it reaches a breakpoint set by the user. The Arduino IDE 2.x debugger tutorial was written based on the previous behavior, and that information is not applicable to Arduino IDE 2.0.3 and newer. So the outdated information is hereby updated to be correct for the current IDE versions. This task was a bit challenging due to the tutorial being vague and inconsistent about the clicking of the "Start Debugging" button. It is not clear exactly when (or if!!!) the user will click this button: If they click it before adding the breakpoints, execution will pause at whichever breakpoint the execution reaches first. That will most likely be line 33, since there is only a 1 s time window when line 35 would be the next breakpoint, but it is not guaranteed. If they click it after adding the breakpoints, execution will pause at the first breakpoint at line 33.
1 parent c99daed commit c9ede0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: content/software/ide-v2/tutorials/ide-v2-debugger/ide-v2-debugger.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ In this example, we are going to set a breakpoint for **line 33** and **line 35*
107107
![Navigating the Debugger.](assets/debugger-img03.png)
108108

109109
We can now go through our code, step by step.
110-
The first (automatic) stop will be triggered by the **Debugger** itself, and it will be a standard entry-point, ignore that for now.
110+
The debugger will automatically stop at the first breakpoint it reached.
111111

112-
Let's continue, by clicking on the **Play/pause** button (**Continue**). The program will now run to the first breakpoint, line 33. If we click it again, it will jump to line 35 (line 34 will still be executed but we won't see that). Clicking the **Play/pause** button again will continue running the program which will pause at its next breakpoint, line 33. We're in the main loop, after all.
112+
Let's continue, by clicking on the **Play/pause** button (**Continue**). The program will now run to the next breakpoint (e.g., line 35). If we click it again, it will jump to line 33 (the other lines in the program sequence will still be executed but we won't see that). Clicking the **Play/pause** button again will continue running the program which will pause at its next breakpoint, line 35. We're in the main loop, after all.
113113

114114
![Going between breakpoints.](assets/playpause.gif)
115115

0 commit comments

Comments
 (0)