Need to debug ESP32 WiFi code

I am trying to debug an Arduino ESP32 Wi-Fi sketch and I would like to be able to debug the Wi-Fi library. However, when I go to the Definition or Declaration of one of the Wi-Fi functions, I only see the esp_wifi.h file.

How can I get PlatformIO (VSCode) to allow me to debug the source?
Sid

Arduino-ESP32 includes the WiFi stack as a precompiled binary and not in source form, so the fun stops there.

You would need to go the ESP-IDF and Arduino as a component route per platform-espressif32/examples/espidf-arduino-wifiscan at develop · platformio/platform-espressif32 · GitHub to go into their sources.

Even there there might be a point where ESP-IDF calls into a proprietary WiFi stack, but I’m not sure. I have however never seen a microcontroller company open-sourcing their WiFi stack in full.

Thank you for confirming my suspicion. I will try to figure out what I need by looking at the calling code.