# Any plans to document IDE debugger UI usage?

**URL:** <https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970>\
**Category:** IDE 2.x\
**Created:** [September 14, 2023, 2:16pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970 "2023-09-14T14:16:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtone1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dtone1/32/957722_2.png) [@dtone1](https://forum.arduino.cc/u/dtone1)\
**Post date:** [September 14, 2023, 2:16pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/1 "2023-09-14T14:16:34Z")

</div>

Continuing the discussion from [Debugging on the new Nano ESP32](https://forum.arduino.cc/t/debugging-on-the-new-nano-esp32/1153079):

> [@Debugging on the new Nano ESP32](https://forum.arduino.cc/t/debugging-on-the-new-nano-esp32/1153079/39):
>
> Hello, documentation team at your service. I apologize for the confusion in the [Debugging Guide](https://docs.arduino.cc/tutorials/nano-esp32/debugging). I am going through all the feedback and will update the steps to make them more clear.

Are there any plans to document the actual nuts and bolts of the debugging process once you have managed to get it started? I can only find docs about setting it up.

For example(s):

- What is the variables area for? (Nothing ever shows up there for me).

- How do you know when the debugger has stopped thinking (slowly) about what to do next? (The debugging console is no help here when single stepping).

- Why does 'step over' sometimes land in (I think) some RTOS code and how do you get out of it.

- I have found that only the 'Light-high contrast' theme shows the paused line of code clearly enough for me to see without squinting at the screen.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [September 14, 2023, 2:38pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/2 "2023-09-14T14:38:31Z")

</div>

> [@dtone1](#):
>
> What is the variables area for? (Nothing ever shows up there for me).

It shows the value of variables.

> [@dtone1](#):
>
> (Nothing ever shows up there for me).

It only shows when the execution is paused at a breakpoint. For example, here I placed a breakpoint at line 57 of the **File \> Examples \> 02.Digital \> BlinkWithoutDelay** sketch:

![image](https://europe1.discourse-cdn.com/arduino/original/4X/e/2/6/e26af098391117bf54fd35200443febc12795967.png)

> [@dtone1](#):
>
> only the 'Light-high contrast' theme shows the paused line of code clearly enough for me to see without squinting at the screen.

The Arduino IDE developers are tracking something like this here:

> <https://github.com/arduino/arduino-ide/issues/2189>
>
> \### Describe the problem
> 
> The current line in the Arduino IDE editor is indica…ted by a difference in the background color (AKA "highlight") of that line.
> 
> When using the "\*\*Dark\*\*" theme, the contrast between the color of the highlight and the background color of the rest of the editor is very low.
> 
> 🐛 Users may have difficulty distinguishing the background, or not be able to see it at all (especially users with visual impairments).
> 
> \### To reproduce
> 
> 1. Select \*\*File \> Preferences...\*\* (or \*\*Arduino IDE \> Settings...\*\* for macOS users) from the Arduino IDE menus.
> The "\*\*Preferences\*\*" dialog will open.
> 1. Select "\*\*Dark\*\*" from the "\*\*Theme\*\*" menu in the "\*\*Preferences\*\*" dialog.
> 1. Click the "\*\*OK\*\*" button.
> 
> 🐛 The highlight at the current line in the editor has poor contrast against the editor background:
> 
> !\[image\](https://github.com/arduino/arduino-ide/assets/8572152/7fa1698a-5ea3-4f52-a283-f8c65a1743c2)
> 
> (the highlight is on line 2 in the screenshot)
> 
> \### Expected behavior
> 
> The color of the current line highlight has sufficient contrast.
> 
> \### Arduino IDE version
> 
> 5fd02b9
> 
> \### Operating system
> 
> Windows
> 
> \### Operating system version
> 
> 11
> 
> \### Additional context
> 
> The demonstration above uses the highlight as an indication of editing position for the sake of simplicity. However, this is not a very compelling demonstration of the fault because the cursor also usually provides an indication of the current editing position, so the user may not be significantly impacted by the loss of an additional indicator of position.
> 
> A more impactful manifestation of the defect is when using the debugger. In this case, the current line highlight indicates the execution position when stepping. In this case, the cursor will not serve as an additional indicator so the highlight is the sole indicator of this crucial information. The user reports were in the context of using the debugger.
> 
> \---
> 
> The highlight has good contrast when using the other officially supported IDE themes.
> 
> \---
> 
> You must have the \`editor.renderLineHighlight\` \[advanced setting\](https://github.com/arduino/arduino-ide/blob/main/docs/advanced-usage.md#advanced-settings) set to "line" (the default) or "all" in order to reproduce the demonstration.
> 
> \---
> 
> Originally reported by @KurtE at https://forum.arduino.cc/t/adding-debug-support-to-a-non-arm-eabi-board-type/1138076/9
> 
> \#### Additional Reports
> 
> \- https://forum.arduino.cc/t/mkr-zero-atmel-ice-win11-ide-2-1-1-fault/1158711/3
> \- https://forum.arduino.cc/t/debugging-on-the-new-nano-esp32/1153079/43
> 
> \<a name="workaround"\>\</a\>
> 
> \#### Workaround
> 
> 1. Select \*\*File \> Preferences...\*\* (or \*\*Arduino IDE \> Settings...\*\* for macOS users) from the Arduino IDE menus.
> The "\*\*Preferences\*\*" dialog will open.
> 1. Select anything other than "\*\*Dark\*\*" from the "\*\*Theme\*\*" menu in the "\*\*Preferences\*\*" dialog.
> 1. Click the \*\*\<kbd\>OK\</kbd\>\*\* button.
> 
> \### Issue checklist
> 
> \- \[X\] I searched for previous reports in \[the issue tracker\](https://github.com/arduino/arduino-ide/issues?q=)
> \- \[X\] I verified the problem still occurs when using the latest \[nightly build\](https://www.arduino.cc/en/software#nightly-builds)
> \- \[X\] My report contains all necessary details

However, I'm wondering whether you are referring to the same problem. The reason is that I find the contrast of the current line highlight is reasonably good with the themes other than "Dark".

Here I can see the execution point is at line 35 by the gray background color of that line when using the "Light" theme:

![image](https://europe1.discourse-cdn.com/arduino/original/4X/3/a/7/3a7cb045a09d0cdc335bc4429e08b21a38b69be1.png)

It is somewhat subtle, but I personally find it to be sufficient (I understand that it might not be for others, but we provide the "High Contrast" themes to accommodate that).

And here I can see it is at line 35 by the brown outline and line number coloration when using the "Dark High Contrast" theme:

![image](https://europe1.discourse-cdn.com/arduino/original/4X/e/2/7/e2709ee69fbd803c57b685af17f04d122e1a382c.png)

Did I misunderstand what you meant?

---

<div class="post-metadata">

**Author:** ![dtone1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dtone1/32/957722_2.png) [@dtone1](https://forum.arduino.cc/u/dtone1)\
**Post date:** [September 15, 2023, 12:01am UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/3 "2023-09-15T00:01:45Z")

</div>

Thanks for your reply, it was helpful.

However, my real request was not about the specific issues that I raised, and to which you responded, but rather about a need for documentation of the features of how to use the debugger once you do have it set up correctly and are in debug mode.

However, I want to respond to your answers.

1. **Value of variables**. I loaded the BlinkWithoutDelay sketch and, yes, I saw _currentMillis_ showing up as a Local, but I do not see any of the global variables, e.g. _ledState_, showing up as Global. Should they have been there?  
I can put them in the Watch area and they behave as expected there.

2. **Poor contrast**. Yes, that looks like the same issue. It is probably worse on some monitors than on others. I now find the Dark High Contrast theme to be the best (for me) when debugging - actually, it is the only one that is useful.

---

<div class="post-metadata">

**Author:** ![lburelli](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lburelli/32/989898_2.png) [@lburelli](https://forum.arduino.cc/u/lburelli)\
**Post date:** [September 15, 2023, 8:41am UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/4 "2023-09-15T08:41:19Z")

</div>

> [@dtone1](#):
>
> Why does 'step over' sometimes land in (I think) some RTOS code and how do you get out of it.

Does it happen always in the same place or is it a random function? It might be due to how the code is compiled in that exact context, or an interrupt that confused the internal debugger. You should be able to "step out", or just run and hit another breakpoint.

> [@Debugging on the new Nano ESP32](https://forum.arduino.cc/t/debugging-on-the-new-nano-esp32/1153079/45):
>
> **Value of variables**. I loaded the BlinkWithoutDelay sketch and, yes, I saw _currentMillis_ showing up as a Local, but I do not see any of the global variables, e.g. _ledState_, showing up as Global. Should they have been there?  
> I can put them in the Watch area and they behave as expected there.

Thanks for the report, I will flag this for further investigation.

> [@Debugging on the new Nano ESP32](https://forum.arduino.cc/t/debugging-on-the-new-nano-esp32/1153079/45):
>
> [...] documentation of the features of how to use the debugger once you do have it set up correctly and are in debug mode.

Thanks for the suggestion. We will try to improve the [Debugging with IDE 2](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-debugger) tutorial by integrating some more detailed descriptions of the integrated features.

---

<div class="post-metadata">

**Author:** ![dtone1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dtone1/32/957722_2.png) [@dtone1](https://forum.arduino.cc/u/dtone1)\
**Post date:** [September 15, 2023, 2:31pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/5 "2023-09-15T14:31:23Z")

</div>

> [@lburelli](#):
>
> Does it happen always in the same place or is it a random function? It might be due to how the code is compiled in that exact context, or an interrupt that confused the internal debugger. You should be able to "step out", or just run and hit another breakpoint.

Rerunning BlinkWithoutDelay this morning I see that it is stepping into main.cpp, not RTOS as I said earlier:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/9/9/8/998937065f418fa945c487ba027201f4abc1540d.png)

Yes, I can step out of this. I think this behavior should be documented as it is surprising to a newbie like me.

I will shut up if you ask me, but in the meantime I would like to post my user experiences as I try to figure out how to approach debugging an ESP32-S3. Some issues will be errors or misunderstandings on my part and some will be things that I think should be changed or documented. (Full disclosure: right now I am using a knock-off ESP32-S3 devkit v1 from Aliexpress but I am expecting delivery of a Nano ESP next week).

**Issue 1** : Debugging seems to be more reliable when I use 'Sketch-\>Upload using Programmer' instead of pressing the Upload button. Is this to be expected? Perhaps the Start Debugging button should first perform a Compile and Upload using Programmer?

**Issue 2** The output on the Debug Console and gdb-server tabs are massive, continuous and unintelligible. The messages are full of warnings and errors that I have no idea what to do about.

If the debugger seems to be working then I try to ignore them.

The Debug Console looks like it can be used for something as it has an input command line, but I have no idea what the commands might be. It does respond to 'help' with a long list of possible commands.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [February 24, 2024, 5:07pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/6 "2024-02-24T17:07:27Z")

</div>

> [@dtone1](#):
>
> I have no idea what the commands might be

This is the industry standard GDB:

[https://www.sourceware.org/gdb/](https://www.sourceware.org/gdb/)

You can find a lot of information about using it by searching on the Internet. However, we recommend using the GUI interface of the IDE's sketch debugger instead of the command line interface offered in the Debug Console.

Generally you would only use the command line interface for very advanced operations for which there is no GUI interface, if you are familiar with GDB and prefer using it directly instead of a GUI, or when troubleshooting some unexpected behavior of the GUI.

---

<div class="post-metadata">

**Author:** ![dtone1](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/dtone1/32/957722_2.png) [@dtone1](https://forum.arduino.cc/u/dtone1)\
**Post date:** [February 24, 2024, 6:27pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/7 "2024-02-24T18:27:16Z")

</div>

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 22, 2024, 6:27pm UTC](https://forum.arduino.cc/t/any-plans-to-document-ide-debugger-ui-usage/1227970/8 "2024-08-22T18:27:33Z")

</div>

Closed on August 22, 2024, 6:27pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
