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
Tuesday, October 13, 2009
Post Mortem Debug of Windows Mobile with Visual Studio 2005
Posted by
Nicolas BESSON [MVP]
0
comments
Labels: VS2005, Windows Mobile
Tuesday, April 14, 2009
IE8and Smart Device project issues
The Visual Studio team have blogged about an issue with Visual Studio 2005/2008 after installing IE8 (Here’s a link to the blog article). You can have this issue when creating a Smart Device project in Visual Studio 2008, the fix is very simple, a change to your desktop registry.
- Nicolas
Posted by
Nicolas BESSON [MVP]
0
comments
Labels: Smart Device, VS2005, VS2008
Monday, November 24, 2008
Debugging Windows Mobile devices
Another boring notification while debugging Windows Mobile devices, is linked to the default security level of the OS. On every start of the debugger, VS2005 launch required applications on the device that are not digitally signed, so device warn you.
One solution to disable those warning messages, is to disable and change the security level. Of course this will completely remove all the security on the device... so make sure to revert your changes after debugging process to avoid any damages on your device.
On the device you have to set the following :
[HKEY_LOCAL_MACHINE\Security\Policies\Policies]
"00001001"=dword:1
"0000101a"=dword:1
- Nicolas
Posted by
Nicolas BESSON [MVP]
0
comments
Labels: Debugging, VS2005, Windows Mobile
Tuesday, February 19, 2008
Smart Device deployment and debugging using VS2005
When developing smart device application, in C# or C++ (Win32 or MFC) using Visual Studio 2005, you have different solutions for the deployment and debugging of your application.
ActiveSync :
This is the easiest way as it just required the support of ActiveSync in your Run Time image and a Serial or USB Function interface correctly setup. When connecting the device to you development computer ActiveSync should start and connect to the device. VS2005 is setup to use the ActiveSync link automatically for the deployment and debugging. No particular actions are required for this connection type.
KITL :
If you have the chance to have a KITL connection between the device and Platform Builder, you can directly use this connection with another instance of VS2005.
Before been able to use the KITL connection from VS2005, you have to create and setup a device configuration. To do so you have to open the Connectivity Options window in the VS2005 instance running the Platform Builder plug-in. Use the Create Device button to add a new device to the list of devices identified by Platform Builder. Associate this new device to an SDK if you got one or to the Generic Platform Builder OSDesign in the drop list as shown bellow.
Then select this new device and setup the Transport and Download information as you are usually doing it with your target device. Then attach and download the Runtime image to the target. This VS2005 instance will be use to debug the OS, and not your application. You will be able to add break point in the drivers and/or OAL.
Connect
In the second VS2005’s instance start/load your application solution and go to the Tools menu followed by Options then Device Tools group, select Devices, select the device created previously in the list and edit the Properties. Check that the Transport configuration is KITL. Validate all the open windows and close.
Now your system is ready to deploy and debug your application on the device using the KITL layer.
Corecon :
Corecon use the network interface to communicate with Visual Studio and requires to launch two applications on the device, but before you need least the following files on your device:
- clientshutdown.exe
- CMAccept.exe
- ConmanClient2.exe
- DeviceDMA.dll
- eDbgTL.dll
- TcpConnectionA.dll
Those files can be directly integrated in the nk.bin using the project.bib file or copied on the device at runtime using USB flash key or FTP connection.
Those files are not provided directly with the Windows Embedded CE 5.0/6.0 development environment, but are located in the VS2005 folders in the folder :
c:\Program Files\Microsoft Shared\CoreCon\1.0\Target\wce400\ProcessorType\
Binary versions are available for all processors supported by WinCE (ProcessorType).
Pre-requisite
The two applications, CMAccept and Conmanclient2 have to be launched manually when a connection to VS2005 is required. To do so you have to get a way to launch them, using the explorer window on the device, or using a telnet connection. You will also need the IP address of your device to correctly setup VS2005 connection. Without this IP address VS2005 would not be able to connect to the device.
Launch and connect
Under VS2005 you have to select and edit the device connection property by going to the menu Tools followed by Options then Device Tools group, select Devices, select the device in the list and edit the Properties.
In the Properties window select the Transport as TCP Connect Transport and then Configure. In the Configure window check the Use Specific IP address andx enter the IP address of the device. Validate all the open windows and close.
On the device you have to launch the ConmanClient2 application, followed by CMAccept. At this time you have approximately 3 minutes to connect the VS2005/2008 instance with your target. Elapsing this time you will have to launch the CMAccept application again before trying to connect.
In the VS2005, select the device in the device drop box list and click on Tools followed by Connect To Device. The connection may succeed and you should be able to start the deployment and/or debugging.
Those three configuration are using different communication layers but will provide the same set of functionalities for the deployment and debugging of Smart Device applications.
For the Windows Mobile user, to get all the steps for those platforms, you can check out the article on the Fabien blog.
- Nicolas
Posted by
Nicolas BESSON [MVP]
0
comments
Labels: Smart Device, VS2005, Windows CE 5.0, Windows CE 6.0
Monday, January 14, 2008
Automatically add files to an SDK
The second solution is to automated this mechanism by copying those files to a specific folder that will be used automatically by the wizard during the generation of the SDK.
Identification of the sdk folder :
Add an automated task :
In the sources file add the following lines :
#------------------------------------------------------------------------------
# SDK files
#------------------------------------------------------------------------------
# Enable copy to the SDK directory
WINCETARGETFILES=$(WINCETARGETFILES) CopyFilesToSDK
SDK_FILES=gpio_iocontrol.h driverheadertoshare.h
In association to the sources file you must provide a makefile.inc (located in the same folder), this file is proceeded after your sources files during the build. In this file you must satisfy the dependency list, so it must contain information about the CopyFilesToSDK.
Makefile.inc content will be something like this :
CopyFilesToSDK:
#REM copy the files listed in SDK_FILES to $(_PROJECTSDKROOT)
....
After the build of the driver or the library, you may find all your required files in the $(_PROJECTSDKROOT) folder.
In this article I described only one list of files to be proceeded, but it make sense to have two lists, one for the header files and the sdk\Inc folder and another one for the sdk\Lib folder for the libraries.
-Nicolas
Posted by
Nicolas BESSON [MVP]
1 comments
Labels: SDK, VS2005, Windows CE 6.0
Thursday, December 20, 2007
Error while opening pbxml file

Platform Builder reported an error while trying to load the OS design file:
System.ArgumentException: Invalid characters in path.
The OS design could not be loaded.
Do not move your OSDesign to your desktop, as this one is located in C:\Documents and Settings\user name
- Nicolas
Posted by
Nicolas BESSON [MVP]
1 comments
Labels: VS2005, Windows CE 5.0, Windows CE 6.0
Thursday, December 13, 2007
Monday, September 24, 2007
Windows CE QFE's
Every month the Windows Embedded team is realizing Quick Fix Engineering (QFE) to fix some software issues for Windows CE 5.0 and Windows Embedded CE 6.0.
Those patches have to be installed on your development computer. So you have to regenerate your Windows CE binary image to integrate those new improvements in your device. Every year all the QFE's are grouped into one single MSI file to reduce the time spent to install those QFE's on a clean computer.
So do not forget to update your development computer every month :-)
All QFE are available from the Microsoft website
- Nicolas
Posted by
Nicolas BESSON [MVP]
2
comments
Labels: VS2005, Windows CE 5.0, Windows CE 6.0
Tuesday, August 7, 2007
Windows CE 6.0 and SDKs
The SDK contains all the API enabled by selecting components in the OSDesign for the Common component and specific components (drivers, BSP applications, ...). Those APIs will be available in you VS2005 project, so the compiler will be able to build your application. This protect you on the usage of unsupported API by your Windows CE Image, in that case checking is done a build time and not at runtime.
Under VS2005 development environment they are some restrictions, that will be solved in the future by Microsoft (Hope so !). You must add the following components to your OSDesign, even if you do not need those functionalities :
- AYGShell API Set
- Windows Networking API/Redirector (SMB/CIFS)
fatal error C1083: Cannot open include file: 'winnetwk.h': No such file or directory
-Nicolas
Posted by
Nicolas BESSON [MVP]
1 comments
Labels: VS2005, Windows CE 6.0
Thursday, July 12, 2007
Remote Tools Framework for Windows CE
That Framework also provides tools and facilities to implement your own Remote Tools.
[Update 7/12] : You still need to install Visual Studio 2005 to use the framework
- Nicolas
Posted by
Nicolas BESSON [MVP]
2
comments
Labels: Remote Tools, VS2005, Windows CE 6.0
Thursday, June 28, 2007
Remote Tools, ARM processor and Windows CE 6.0
Then you are reading the right article !
Lots of users want to use Remote Tools using ActiveSync, but the connection always fails. Why ?
Remote Tools launched from Platform Builder 6.0 are using platman (Platform Manager) over ActiveSync to connect your device, when platman starts, it asks Windows CE to return the processor type, through a KernelIoControl, to download the right binary file to the device (client side of the tool). In the case of the ARM processor, Platform Manager do not seem to identify correctly the ARMV4i processor type, but identify ARMv4 instead. Therefore the tool cannot copy the right files to your device. The files used by the remote tools are located in C:\Program Files\Common Files\Microsoft Shared\Windows CE Tools\Platman\target\wce600\. Each sub folders contains the binary version for a specific processor familly (x86, ARMV4i, ....)
As there is no ARMv4 subdirectory, platform manager cannot copy the right file to the platform. The workaround to solve this issue is to duplicate your ARMV4I folder to ARMV4 one, and then, TADAAAA, it works !
- Nicolas
Posted by
Nicolas BESSON [MVP]
13
comments
Labels: Remote Tools, VS2005, Windows CE 6.0
Friday, June 1, 2007
Windows CE 6.0 remote tools over activesync workaround
A lot of Windows CE 6.0 users have troubles with activesync and remote tools, they can't connect to a Windows CE device to use their favorite remote tool.
There are some pre-requirement for using the remote tools.
- Add the 'C++ Runtime Support for Exception Handling and Runtime Type Information' component to your OSdesign
- Use the remote tools not from the VS2005 menu but from the 'Start Menu' in Progams -> Microsoft Visual Studio 2005 -> Visual Studio Remote Tools
- Open your favorite remote tool, and go to the Target -> Connectivity Options ... menu
- Select the Platformbuilder entry and edit the properties
- Set- Transport to TCP Connect Transport - Startup Server to Activesync Startup provider
- Validate and connect to the device using that entry.
Posted by
Nicolas BESSON [MVP]
4
comments
Labels: Remote Tools, VS2005, Windows CE 6.0