Tutorial Step 5: Debugging the OS on the CEPC Using the Kernel Debugger (Windows CE 5.0)
After you download and boot the run-time image on the CEPC, you can debug the OS.
By default, Platform Builder starts the kernel debugger when the OS boots, and displays the Debug toolbar in Platform Builder.
To debug the run-time image, you must halt the running OS. Breakpoints cannot be set while the OS is still running.
In this step, you use the kernel debugger to debug your custom OS.
To debug the OS on the CEPC using the kernel debugger
On the development workstation, from the Platform Builder Debug menu, choose Break.
This halts the running OS on the CEPC, which does not respond to user input in this state.
From the File menu, choose Open and do the following:
- Browse to %_WINCEROOT%\Public\Common\Oak\DRIVERS\KEYBD\PS2_8042.
- Select ps2mouse.cpp.
- Choose Open.
You have opened the Ps2mouse.cpp file, which contains source code for the mouse driver.
From the Edit menu, choose Find.
In the Find what box, type _move and choose Find Next.
You have jumped to a section of code in the Ps2mouse.cpp file that handles a mouse move event.
At the mouse move event, set a breakpoint in the source code by pressing the F9 key.
The red dot in the margin shows that the breakpoint has been set.
From the Debug menu, choose Go.
Move the mouse for the CEPC.
Switch to the Platform Builder window.
The breakpoint activates. A yellow instruction point or current instruction arrow appears on the breakpoint symbol.
Remove the breakpoint that you set by doing one of the following:
- From the Debug toolbar, choose Breakpoints and then choose Clear All Breakpoints.
- In the source code, right-click the line where you set the breakpoint; then from the context menu, choose Remove Breakpoint.
- Use the ALT+9 keyboard shortcut to access the Breakpoint List window; then choose Clear All Breakpoints.
From the Debug menu, choose Go.
You have halted the OS, set and activated a breakpoint in one of the drivers, and then removed the breakpoint.
Follow the remaining steps to stop debugging the OS.
From the Debug menu, choose Stop Debugging.
A dialog box appears, asking whether you want to stop debugging now without disabling the target-side kernel debugger component KdStub.
For the purposes of this tutorial, choose Yes.
Control returns to Platform Builder.
From the Target menu, choose Detach Device and then choose OK.
After you finish debugging, you can localize your run-time image.
See Also
Tutorial Step 6: Localizing the Run-Time Image for the CEPC | Tutorial Step 4: Setting Up a Connection to the CEPC and Downloading the Run-Time Image | Tutorial: Building a Run-Time Image for a CEPC | Tutorials | Kernel Debugger
Send Feedback on this topic to the authors