Debug C program compiled using nmake
I have a program written in c that I compiled (The project structure is not my choice) using make files and the Visual C++ compiler (nmake.exe). I want to debug the application when it is called from a java application. I set debug break calls (__debugbreak()) in the code but when I debug using Visual Studio I only get the disassemble dump. I need to know if I can point the Visual Studio debugger at the original source code? If there is another debugger I can use to accomplish the sa开发者_如何学Gome results let me know.
The debugger will normally show your source code if you've compiled/linked with debugging information. You'll probably need to change your make files to tell the compiler to produce debugging information (e.g., /Zi
) and the linker to produce debugging information (normally /debug
, you might also want to look at /PDB
and/or/PDBSTRIPPED
).
You also need to ensure the source code files are where the debugger can find them. If memory serves, their full path is normally embedded, so as long as you're working on the original machine and don't move them, they'll be found automatically.
精彩评论