Tuesday, October 13, 2009

Post Mortem Debug of Windows Mobile with Visual Studio 2005

We saw on the previous post on Post Mortem debugging, the way to open KDMP files with WinDbg. But those system dump files can also be loaded using Visual Studio 2005 (and higher).

First step : Configure your device
Just follow the instructions in the previous post for the configuration of you Windows Mobile device (registry configuration to specify the location of the kdmp files).

Second step : Locate and copy the kdmp files
Locate the kdmp files on your device and copy it to your Development machine.

Third step : Open the kdmp file and run debugger
From VS2005, go to File -> open project/solution, and select the kdmp file.

Then go to Debug -> Start menu or hit F5 key, this will launch the debugger locally. The exception is then catch, and the assembly source code is shown.

At this time, the debugger is not able to make the link between the binary and the source code, as the symbols are not set. For this show the modules by going in Debug -> Windows -> Modules menu (screen must looks like the screen shot above). Select the module on which the exception occurs in our case it MemException.exe, right click on it and select the "Load Symbols" popup menu.
Provide the path to the pdb files and TAADAAA the source code is displayed.



Have a good debugging then...

- Nicolas

No comments: