views:

45

answers:

2

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?

+3  A: 

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.

sharptooth
A: 

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