Eclipse: Debug image ok, but Step Into and Step over won't work with ESP32 Dev Kit

Hi there,

I’m a greenhorn in using platformio. Think, it’s a very good framework.

I’ve tried to compile an example with VS Code and Eclipse. Debugging with VS Code is fine,
but when I try to debug with Eclipse I cannot perform Step Into (F5) and Step over (F6).
The cursor stays on the temporary break point and nothing happens.

Here my configuration (platformio.ini):

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_speed = 921600
upload_port=COM4
monitor_speed = 115200
monitor_port=COM4
debug_tool = esp-prog
debug_init_break = tbreak setup

I checked out the documentation but I did nor find any hint to resolve that issue, and I like
Eclipse.
I tried ESP32_IDF before and debugging was working, but platformio is much more easier to handle.

I would be very grateful for any hint

Andi

The ESP32 has a general quirk that only 2 breakpoints are allowed. If you step through the code it needs one breakpoint and the one you’re currently halted at also maybe counts (not 100% sure about that).

Can you remove all manually set breakpoints and start debugging again? Does the debugger halt at setup() initially? Does then doing a step over work, executed from the menu item at best and not a keybinding?

Hi Max,

thanks for answer. ESP32 has a lot of benefits but I’m thinking about to move back to STM32.
Yes, I’ve removed all other breakepoints and the debugger halts at setup(). But, as I described,
I cannot move forward with Step Into (F5) or Step Over (F6).
What confuses me is, why does it work with VS Code? I will try to analyse all that scripting handled
by VS Code. Maybe I can adapt it for using with Eclipse. Yes, I know Eclipse is a monster
but simply the best.

Andi

Can you add build_type = debug to the platformio.ini and see if that changes anything?

Do you have a log of openocd output in some terminal within Eclipse?

Nothing changed with build_type = debug
Maybe the reason is that ESP32 has 2 cores.

Here you see the output of the Eclipse Debug Console:

    GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 7.10
    Copyright (C) 2015 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "--host=i686-host_pc-mingw32 --target=xtensa-esp32-elf".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.
    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    Note: automatically using hardware breakpoints for read-only addresses.
    Info : esp32.cpu0: Target halted, PC=0x4008A6CD, debug_reason=00000000
    Info : esp32.cpu0: Detected debug stubs @ 3ffc0ca4
    Info : Set GDB target to 'esp32.cpu0'
    Info : esp32.cpu1: Target halted, PC=0x400D0C00, debug_reason=00000001
    [New Thread 1073464940]
    [New Thread 1073463528]
    [New Thread 1073467632]
    [New Thread 1073455716]
    [New Thread 1073445320]
    [New Thread 1073446424]
    [New Thread 1073462116]
    [Switching to Thread 1073447000]

    Temporary breakpoint 1, setup () at src\Blink.cpp:15
    15	{

and here you see output of Eclipse Console

esp32.cpu0: Target halted, PC=0x4008A6CD, debug_reason=00000000
esp32.cpu0: Detected debug stubs @ 3ffc0ca4
Set GDB target to 'esp32.cpu0'
esp32.cpu1: Target halted, PC=0x400D0C00, debug_reason=00000001

As decribed in the documentation it should work with no additional changes.