6

I am attempting to debug some C code using the visual studio debugger. I seems my choices are to view the source code or view the the disassembly. But what I would really like to view is the source code with all the macro's expended. Is that also possible?

Mick
  • 8,170
  • 22
  • 77
  • 165

2 Answers2

6

In Visual C++ the best you can have is a preprocessed file (C++ ->Preprocessor->Generate preprocessed file). This will give you a huge file of C++ code with all macros expanded. Still macro expansions will be single lines - no line breaks.

This is one of the reasons why macros are very problematic to use for complicated code and should be avoided unless absolutely necessary.

Community
  • 1
  • 1
sharptooth
  • 163,328
  • 92
  • 501
  • 942
0

I don't think an option like that is available in Visual Studio. It would probably be necessary to run the preprocessor on the code first and then compile the pre-processed file and use that as the source.

Mark Wilkins
  • 40,032
  • 5
  • 54
  • 108