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?
            Asked
            
        
        
            Active
            
        
            Viewed 1,413 times
        
    2 Answers
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
        
- 167,383
 - 100
 - 513
 - 979
 
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,729
 - 5
 - 57
 - 110