Preprocessing code wmake
Hi everyone, I'm trying to debug buoyantFoam for mesh switching (when the solution is mapped to another mesh it crashes). What I would like to do is observe what is placed inside the file when it is compiled.
Usually if I want to do this with g++ I can give a command like: Code:
g++ -E code.C -o preproces.file and get a pre process file. I'm not sure you can do this with wmake. Does anyone know if it can be done or if there is an alternative way to understand the code? thanks for the replies. |
Not the most convenient, since you have a number of include directories and defines to worry about but you could try doing the following:
Code:
cd your/directory The stderr file will contain the full command-line used to compile. Will "only" need to edit this to add the '-E' option and replace the output name with your prepro.file . This worked OK for me, but even a simple file quickly expands to 150k lines! |
Perfect, thank you so much!, I hadn't thought of that.
I think it worked correctly, I generated a 190k file but having some keywords I hope to get by. It's the only way I could think of to understand what and how it is called within the code, maybe you could recommend some other method? However I only used the first line to fill in the one where the buoyantFoam.o object was created |
Quote:
This benefit of C++ is that you can write code to solve complex problems that you'd mostly not otherwise be able so solve. The downside is that you may not actually understand the code since it becomes so complex. Seems to be normal enough. For what it's worth, expanding code with the pre-processor will not get you very far. You'd also need to trace and understand which inheritances happen where, and which virtual methods are being called etc. Definitely non-trivial. |
Quote:
The only way I see is to study the code, I'll read it during the night, thank you very much. |
All times are GMT -4. The time now is 19:59. |