tags:

views:

49

answers:

1

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 same results let me know.

+2  A: 

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.

Jerry Coffin
I am debugging on another machine. I moved the source code to the same path on the test machine and it worked. Is there a way to set the source path?
Carlosfocker