Containerized development environment and Visual Studio Code
To start, install Visual Studio Code (https://code.visualstudio.com/). Once you’ve done this, go to Extensions and search for and install the following extensions:
- C/C++
- Cortex-Debug
- CS 128 Clang-Tidy
- Dev Containers
Once you’ve done this, open View| Command Palette (Ctrl + Shift + P), find Dev Containers: Attach to Running Container, and select dev_env. This should open a new Visual Studio Code window where the container’s name is in the bottom left bar:

Figure 4.4 – Visual Studio Code attached to a running container
Figure 4.4 shows that Visual Studio Code was successfully attached to the running container. Now, let’s open the project folder at /workspace/Cpp-in-Embedded-Systems/Chapter04/bare. Open main.cpp in the EXPLORER view and set a breakpoint on line 23, as shown in the following screenshot:

Figure 4.5 – Setting...