-1

I'm trying to understand how preprocessor magic works and how I can adapt the approach for my needs. I do something wrong and compilation fails. I'd like to know at which expansion step there is a mistake and see expansion step by step. gcc -E works only for valid code, so I'm looking for a side tool to show expansion tree.

Gryphon
  • 549
  • 3
  • 14

1 Answers1

0

I like using Eclipse CDT which has a nice feature allowing to step through Macro expansions.

chtz
  • 17,329
  • 4
  • 26
  • 56
  • Thank you. For some reason I thought Eclipse macro expansion needs fully valid code, now I tested it and it works even when compilation fails. Is it possible to visualize the steps as a tree? If you see EVAL and PROBE macros from link in my question, when MAP is called every input argument triggers full expansion (1024 steps) and most of the expansions produce no output. I'd like to skip (or collapse the brach if viewed in tree view) the steps resulting in no output – Gryphon Apr 22 '17 at 23:38