Quote:
Originally Posted by johnsfine
I just glanced at that article, but it seems to be on a different topic than your post seems to suggest.
The article title is
Debugging C++ Template Metaprograms
Metaprogramming is a very specialized small subset of C++ template programming.
The debugging needed in metaprogramming (and apparently documented in that article) is for events that occur at compile time, rather than run time.
Compilers (GCC included) tend to be very flawed in the debugging info they generate to support run time debugging of templated code. So your post caused me to guess incorrectly this article was about dealing with those problems.
Debugging compile time events in metaprogramming is an even more interesting topic, but for a much narrower audience. I wasn't aware tools even existed.
|
The template engine in C++ is Turing-complete. The template specialization/instantiation happens at compile time, so debugging it needs to be done at compile time. In other word, that template code implemented in a Turing-complete language is run at compile time.
The article is exactly about it. I.e. about debugging/tracing template code which runs at compile time. And because it happens at compile (and no other) time, I didn't mention compile time in the the thread name. I also think that it's universally known that C++ templates in particular and metaprogramming in general are closely interrelated - the former being a subset/particular realization of the latter.
In more detail, it's about an external to both compiler and the original template containing program tools/code (including a Boost library component) which allow to equivalently modify the original template containing program so that template specialization/instantiation can be traced.
The fundamental idea is to introduce special format warnings which later can be parsed, and as the article says, "visualized".