Search code examples
windowsvisual-c++crash-dumps

Regarding the compiler option "Assembly, Machine Code and Source (/FAcs)"


i am maintaing a legacy application built using VS6.0 but now it is moved to VS2005, during compilation it creates lots of .COD files, and i found that this "Assembly, Machine Code and Source (/FAcs)" compiler switch is responsible for this.

can anyone tell me what is the use of these .COD files, and how can this be used ? does this have any role is crash dump analysis ?

thanks Tom


Solution

  • Generally speaking they're used for inspecting the code generated by the compiler. There are various reasons why you might want to do this. Sometimes you want to see how well the code is optimized. Sometimes you're code isn't behaving the way you expect it to and you want to see if it's a bug in your own code or a bug in the compiler.

    You could potentially use a .COD file in crash dump analysis, but pretty much only as a last resort. Visual Studio 2005 can normally show you the source code and disassembly when working with crash dumps. You'd only need to fall back on the .COD files if you didn't have the PDB (or source files). To use a .COD file with a crash dump, you also need a .MAP file. The addresses in .COD file are only relative to the .OBJ file the compiler created. The .MAP file is necessary to find out where the .OBJ files were linked into the EXE/DLL.

    So if you have the .COD files and corresponding .MAP file you could use them find out what line in your code corresponds to an address in the crash dump. However it's much easier to just use your IDE or maybe Windbg.

    Note that the free Express edition of Visual Studio 2005 doesn't support debugging crash dumps. You'll need to use Windbg instead to analyze crash dumps if you have the Express edition.