Page 1 of 1

Eclipse Debugging: Step OVER mostly steps INTO function

Posted: Fri Sep 23, 2022 9:42 am
by Supino
Hi everyone,

I have a strange effect when debugging my ESP32-WROOM-32UE project. When step through my code, I press F10 or the button for step over then mostly, but not always, the debugger steps into a function instead of over. I always have the to press Step out to get back to the prevoius level. Any Idea what this is and how to fix it?

My setup:

Operating System: windows 10
Java Runtime Version: 17.0.4+8
Eclipse Version: 4.25.0.v20220831-1800
Eclipse CDT Version: 10.7.1.202208160035
IDF Eclipse Plugin Version: 2.6.0.202208110735
ESP-IDF v4.4.2-dirty
Python set for IDF_PYTHON_ENV: Python 3.10.6

Debugger: ESP-PROG

Compiler Optimization level -0g

Thank you in advance!

Re: Eclipse Debugging: Step OVER mostly steps INTO function

Posted: Mon Sep 26, 2022 6:10 pm
by nwolcott
Hi Supino,
This sounds like the way the debugger behaves when it is out of breakpoints. On most of the ESP32 processors, there are only 2 hardware breakpoints available. When the debugger steps over code, what actually happens behind the scenes is a temporary breakpoint is set on the next line of code, the processor is run, the breakpoint stops at the next line of code, and then the temporary breakpoint is removed. If all of the available breakpoints are already in use, the only thing the debugger can do is step one instruction at a time, which usually ends up stepping into functions.
Basically, in practice you can only have one user breakpoint set at a time if you want the debugger to behave normally.

Re: Eclipse Debugging: Step OVER mostly steps INTO function

Posted: Wed Sep 28, 2022 8:29 pm
by ESP_igrr
The explanation from nwolcott sounds plausible! However please do note that OpenOCD is capable of setting software breakpoints when it runs out of hardware ones. Software breakpoints can be set in IRAM and in Flash. The only case when software breakpoints can't be used is when stepping through the ROM code.
It is possible that OpenOCD wasn't able to set flash breakpoints for some reason. We can try to troubleshoot this using the log produced by OpenOCD.