Technical requirements
To get the most out of this chapter, I strongly recommend using Compiler Explorer (https://godbolt.org/) as you read through the examples. Add an execution pane with GCC as your compiler for x86 architecture. This will allow you to see standard output and better observe the code’s behavior. As we are using a lot of modern C++ features, make sure to select C++23 standard, by adding -std=c++23
in the compiler options box, and set the optimization level to -O3
. Also, add a compiler pane using ARM gcc 11.2.1 (none)
to inspect the assembly output of the examples.
You can try the examples from this chapter in the Renode simulator in the Docker container you set up in Chapter 4. Make sure that the Docker container is running.
You can find the files for this chapter on GitHub at https://github.com/PacktPublishing/Cpp-in-Embedded-Systems/tree/main/Chapter15/observer.