CLion + native + debugging = not working

Hey,

this time I’m trying to set up debugging – native platform for starters.

CLion 2022.3
Build #CL-223.7571.171, built on November 28, 2022
✗ pio --version
PlatformIO Core, version 6.1.5

My code [branch debugging]: GitHub - MacDada/DnWiFiDoorLock at debugging

If I select target PlatformIO Upload, the console output is Hello World! 2 as expected, so it is working.

If I select target PlatformIO Debug, the console output is:

Preparing firmware for debugging...
Processing native (platform: native)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 8 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
========================= [SUCCESS] Took 0.96 seconds =========================

Environment    Status    Duration
-------------  --------  ------------
native         SUCCESS   00:00:00.962
========================= 1 succeeded in 00:00:00.962 =========================
Reading symbols from /Users/dada/Documents/Arduino/DnWiFiDoorLock/.pio/build/native/program...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = None
PlatformIO: Initializing remote target...
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
pio_reset_run_target

That’s all, the debugger does not stop at the start of main nor at my [multiple] breakpoints. Any ideas?

The result after trying CLI:

➜  DnWiFiDoorLock git:(debugging) ✗ pio debug -e native --interface=gdb -x .pioinit
Preparing firmware for debugging...
Processing native (platform: native)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 8 compatible libraries
Scanning dependencies...
No dependencies
Building in debug mode
============================================================================================= [SUCCESS] Took 0.69 seconds =============================================================================================

Environment    Status    Duration
-------------  --------  ------------
native         SUCCESS   00:00:00.693
============================================================================================= 1 succeeded in 00:00:00.693 =============================================================================================
Reading symbols from /Users/dada/Documents/Arduino/DnWiFiDoorLock/.pio/build/native/program...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = None
PlatformIO: Initializing remote target...
Temporary breakpoint 1 at 0x100003f64: file src/native.cpp, line 11.
PlatformIO: Initialization completed
(gdb) PlatformIO: Resume the execution to `debug_init_break = tbreak main`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
Starting program: /Users/dada/Documents/Arduino/DnWiFiDoorLock/.pio/build/native/program 
Unable to find Mach task port for process-id 45518: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
(gdb) 

it appears to be working [?], but I have no idea how to use it, so I’d rather stick to the IDE.