Boost logo

Boost :

Subject: Re: [boost] [preprocessor metaprogramming] tools
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2012-07-30 09:19:44

> >>>>> 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
> >
> (
> .
> > 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.

Well, thinking about it... The trace already (implicitly) has the
information about a macro name being blue painted. The rescanning [...]
output gives you the scope for which the macro under expansion is not
available for further expansion (e.g. it is marked blue).

Regards Hartmut

Boost list run by bdawes at, gregod at, cpdaniel at, john at