Description
Describe the problem
Selecting the green run button in the debugger view open a launch.json file with the version and configuration tags. If you add in the configuration (e.g. JLink) and save the file. The configuration is not saved. It does not appear in the drop list of configurations and if you hit the green run button again it opens a new blank except for {} launch.json file and a dialog warning asking if you want to overwrite the changes to .theia/launch.json.
To reproduce
- Select File > New Sketch from the Arduino IDE menus.
- Click the debug icon in the "activity bar" on the left side of the Arduino IDE window.
The "DEBUG" view will open in the left side panel.
❗ Do not click the "Start Debugging" button on the Arduino IDE toolbar. - Click the play icon ("Start Debugging") or gear icon ("Open launch.json") in the "DEBUG" view.
A "launch.json" editor tab will open in Arduino IDE. - Hover the mouse pointer over the tab.
After a couple seconds, a tooltip will appear that shows the path of the file, which is in the.theia
subfolder of the sketch folder (the sketch folder will be in a temporary folder since it is a new sketch, but this is not relevant). - Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to Auto save.
ⓘ This is required because there is no way to manually trigger a save of changes to thelaunch.json
file. - Click the "OK" button.
The "Preferences" dialog will close. - Replace the contents of the
launch.json
file with the following:ⓘ The exact content of the configuration doesn't matter for the purposes of this demonstration. It only needs to pass schema validation.{ "version": "0.2.0", "configurations": [ { "name": "My Custom Launch Config", "type": "cortex-debug", "request": "launch", "executable": "" } ] }
- Click the configuration menu in the "DEBUG" view.
🐛 The menu does not contain a "My Custom Launch Config" entry.
Expected behavior
If a launch configuration file is present in the sketch folder, use that file instead of a temporary file.
- OR -
Don't mislead the user by opening an irrelevant .theia/launch.json
file in the IDE editor.
Arduino IDE version
Original report
2.0.0-beta.4
Last verified with
2.3.4
Operating system
- macOS
- Windows
Operating system version
- macOS 11.2.3 (Big Sur)
- macOS 15.3.1 (Sequoia)
- Windows 11
Additional context
It would probably be better to change the folder name from .theia
to something like .arduinoIDE
. The average user is unaware that Arduino IDE is built on the Eclipse Theia Platform, and so the folder name .theia
is likely to be confusing.
Additional reports
- Debugger doesn't see my configurations #594
- "No configurations" for DEBUG after upgrading macOS #2641
- https://forum.arduino.cc/t/diy-arduino-zero/931594/19
- https://forum.arduino.cc/t/debugging-nano-33-ble-with-ide-2-b4-debug-configuration/703789/5
- https://forum.arduino.cc/t/swd-debugging-how-to-specify-the-svd-file/943617
- https://forum.arduino.cc/t/debugging-project-out-of-iot-sktechbook/965173
- https://forum.arduino.cc/t/want-to-debug-but-stuck-on-no-configurations/1040460
- https://forum.arduino.cc/t/arduino-zero-debug-error-with-ide-2-0/1046036/5
Related
- https://forum.arduino.cc/t/starting-debugging-with-zero-and-ide-2-1-1/1148488
- https://forum.arduino.cc/t/debugging-a-rp2040-in-arduino-with-segger-j-link/1183941/3
Workaround
If you want to make persistent customizations to the default launch configuration, use the poorly documented debug_custom.json
file.
If you want to make temporary customizations, initialize the debugger before opening launch.json
:
- Click the "Start Debugging" button on the Arduino IDE toolbar.
Arduino IDE will begin the process of initializing the debugger. - Wait for the debugger to be initialized, as indicated by a change of color of the status bar at the bottom of the Arduino IDE window, and the appearance of the "Debug Console" view in the bottom panel.
ⓘ This can take several seconds to occur. - Click the stop icon in the "DEBUG" view (a debug session is automatically started by clicking the "Start Debugging" button on the Arduino IDE toolbar).
- Click the ⚙ icon ("Open launch.json") in the "DEBUG" view.
A "launch.json" editor tab will open in Arduino IDE. This is the launch configuration file that is actually used by the debugger (stored in a temporary folder separate from the sketch). - Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to Auto save.
ⓘ This is required because there is no way to manually trigger a save of changes to thelaunch.json
file. - Click the "OK" button.
The "Preferences" dialog will close. - Make the desired modifications to
launch.json
. - If you added a new launch configuration, select it from the menu in the "DEBUG" view (it will be automatically added to the menu).
- Click the play icon ("Start Debugging") in the "DEBUG" view.
A debug session will start, configured according to your modified launch configuration.
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the latest nightly build
- My report contains all necessary details