views:

59

answers:

1

I've got as far as telling VC++ to generate ASM files during compilation, which I never really used before. But it seems quite limited, like they are just extra files thrown out during the compilation. I'd thought maybe the ASM/C++ code might be linked, so I can jump from C++ directly to the generated ASM code? Or could set breakpoints in the ASM code? Is this possible and I don't know the tools, or is ASM generation for off-line analysis?

+2  A: 

The assembly language file produced by the compiler is mostly for off-line analysis. If you want to do things like setting a breakpoint in the generated assembly code, you can do that though. When you have the appropriate source file open, right-click and select "Go To disassembly". That will show you the assembly language code with the source statements interleaved as comments (about like the file it generates separately). You can then set breakpoints on individual assembly language statements that were generated from any particular source statement.

Jerry Coffin
This only really works in debug mode though, where the assembly generated is not nearly as educational as in release. http://stackoverflow.com/questions/563000/can-optimizations-affect-the-ability-to-debug-a-vc-app-using-its-pdb
BlueRaja - Danny Pflughoeft
@BlueRaja:Yes and no. As long as you have it generate debugging information in release mode, you can still do roughly the same things. The difference is that global optimization can rearrange the code so you no longer get a 1:1 correspondence between source code and what it generates.
Jerry Coffin