
On 07/29/2012 09:38 AM, Hartmut Kaiser wrote:
I wanted to share with you something I've found very useful for tracing/debugging macro metaprograms: the Eclipse CDT IDE has a "macro stepper" that allows you to step through the expansion of a macro step-by-step from the initial invocation to the final expansion. (This feature can be accessed by using the "Explore Macro Expansion" context menu item on a macro invocation.)
This seems very nice, and probably can help especially when debugging deferred expressions. However, will it show when a macro is painted blue? That is really important to knowing why it didn't expand.
Unfortunately it does not show that. That would be a nice addition.
Wouldn't it be possible to build something really useful on top of the Wave library?
The Wave tool ($BOOST_ROOT/tools/wave) allows generating traces for the expansion of macros. See the docs for it's done (http://www.boost.org/doc/libs/1_50_0/libs/wave/doc/tracing_facility.html). Macro tracing in Wave does not show when a macro has been painted blue, however it allows following in detail what happens during the expansion of a particular macro. The information about a macro being painted is available and could be added to the tracing facility easily.
I have always found the Wave trace facility to be amazingly helpful in discovering how a macro should be expanded correctly. Just want to say thanks for this ability. Any further information that can be shown when expanding a macro, perhaps as a Wave trace option, is always welcome and appreciated by this programmer. Maybe something like a --verbose option.