Tutorial Step 5: Debugging the OS on the CEPC Using the Kernel Debugger (Windows CE 5.0)

Windows CE 5.0
Send Feedback

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

  1. 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.

  2. From the File menu, choose Open and do the following:
    1. Browse to %_WINCEROOT%\Public\Common\Oak\DRIVERS\KEYBD\PS2_8042.
    2. Select ps2mouse.cpp.
    3. Choose Open.

    You have opened the Ps2mouse.cpp file, which contains source code for the mouse driver.

  3. From the Edit menu, choose Find.
  4. 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.

  5. 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.

  6. From the Debug menu, choose Go.
  7. Move the mouse for the CEPC.
  8. Switch to the Platform Builder window.

    The breakpoint activates. A yellow instruction point or current instruction arrow appears on the breakpoint symbol.

  9. 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.
  10. 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.

  11. 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.

  12. For the purposes of this tutorial, choose Yes.

    Control returns to Platform Builder.

  13. 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

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show: