Visual Studio Code has great C/C++ support and it’s possible to debug a project with it.
Visual Studio Code can use gdb as a debugger.
If you have your project with a binary and you press F5 to launch the debugger, then Visual Studio will prompt you to configure GDB launcher in launch.json.
Here is sample launch.json for binary my_application on Linux:
Just define a path to your binary, save the file and press F5.
Still, it might happen that debugger does not stop at your break point. Why?
There is one very common mistake. People often forget to add -g for gcc parameter when building the project.
GCC without parameter -g will build a release version of the project without debug information. To fix the problem just add -g to your Makefile, clean, and rebuild the project.