Can't debug with esp32

Hi, I’m using esp32-ethernet-kit v1.0 board for developing. When I try to debug it, after compilation is finished a window shows up saying “failed to launch GDB: Error: write EPIPE” and the debug console shows “Could not start debugger process > Error: spawn platformio ENOENT”. Does anyone know how to solve my problem?