I need help in the debug the esp32

Are you using Arduino IDE 2.3.0 or 2.3.1? If so, this is the cause of the error. As was mentioned in the 2.3.0 release announcement:

I'll provide instructions you can follow to install Arduino IDE 2.2.1:

  1. Click the following link to open the page for the 2.2.1 release in the Arduino IDE GitHub repository:
    Release 2.2.1 · arduino/arduino-ide · GitHub

  2. From the list of download links under the "Assets" section of the page, click the link with the name:

    • If you want the installer package: arduino-ide_2.2.1_Windows_64bit.exe
    • If you want the "MSI" package: arduino-ide_2.2.1_Windows_64bit.msi
    • If you want the "ZIP" package: arduino-ide_2.2.1_Windows_64bit.zip

    If you aren't sure which one you need, use arduino-ide_2.2.1_Windows_64bit.exe

  3. Wait for the download to finish.

  4. Install Arduino IDE from the downloaded file as you would normally do.

When using Arduino IDE 2.2.1, you will find that Arduino IDE periodically shows an "Update Available" dialog to offer you an update to the newer version of Arduino IDE. You must not accept these updates until after you see that a new version of the "esp32" boards platform has been released.