Debugging C # to Intel C ++ in different projects
Similar to this problem:
Old question about C # debugging
I am trying to debug a library that is used in multiple projects and compiles using the Intel C ++ v 11 compiler (i.e. not the standard compiler) in Visual Studio 2008. The current platform I am using for debugging is C # which calls C ++ method using ap / invoke.
Is there a way to debug C ++ code (which was compiled in debug mode) without doing something like starting a huge loop in C ++ code and attaching the debugger to the process? Right now, the C # code just steps right over the C ++ call.
I set it up so that I can debug managed and unmanaged / native code, and debug "not my code", but these settings don't seem to matter.
I really really want to avoid adding a C ++ project to a C # project; as I said, this is a library that is called by several programs, so it can have serious implications for those other programs and services.
a source to share
Answer: set the debug executable and running directory for dll and then try to debug from dll as a separate project. That is, load the intel project into one sln file and then execute the C # project in another sln file.
Then, when you try to debug the DLL via the f5 / debug button, the executable will run and the code will be executed, up to whatever breakpoints you set.
Make sure you have a post-build step to place the dll in the same directory as your C # executable; otherwise, the dll will be out of sync with the actual running code, and the results will be strange (i.e. breakpoints are not lining up, etc.).
Also, with this approach, you lose editing and continue (or if there is a way to save it, I don't know about it), but at least you can debug.
(answer posted for @Dmitri Nesteruk)
a source to share