VS Code has a built-in debugger, its setup documentation is here. Apparently some people use it successfully for Espressif chips (launch.json “type”: “gdb”).
Espressif have a dedicated VS Code extension for debugging which is likely the better choice (launch.json “type”: “espidf”):
Bin icon in bottom blue toolbar.
Barrel icon in bottom blue toolbar.
Or Menu > Terminal > Run Build Task
Visual Studio Code configuration for debugging
The config in this file sets up your debug adapter and what is run when you debug (see https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/DEBUGGING.md )
.vscode/launch.json > “gdbpath” field
.vscode/settings.json > idf.openOCDConfigs