Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug C++ code in a Windows Phone (8) Runtime Component or C++ DLL in VS 2013

For a solution created using Visual Studio 2013 Pro and containing a Windows Phone App (C#), a Windows Phone Runtime Component (C++) and a Windows Phone Dynamic Link Library (C++), is it possible to debug the C++ code in either the runtime component or the DLL? If so, what must be done to enable it?

I have created such a project - a simple test app, where the app invokes code in the runtime component, which in turn invokes code in the DLL. I can verify that it is working correctly because I can inspect the return value of the C++ function in the DLL after it has been fed back through the runtime component to C# code in the app, but I can't get the debugger to step into the method implemented in the runtime component. Although I can set breakpoints on any of the code (C# or C++), only breakpoints on the C# code ever get hit, and the breakpoints set in C++ code (either runtime component or DLL) show as "no symbols loaded" while the app is active under the debugger (as when sitting on a C# breakpoint).

like image 407
Zenilogix Avatar asked Feb 01 '14 22:02

Zenilogix


1 Answers

It is possible to debug the c++ code. You must enabled native debugging for the project. Open the project properties and click on the Debug tab. On the bottom of the right pane will be a section titled Debugger Type. Change the UI Task and/or the Background Task to be Native Only.

like image 67
Shawn Kendrot Avatar answered Sep 22 '22 14:09

Shawn Kendrot