Share via


Set Up JIT Debugging (Compact 2013)

3/26/2014

You use Just-In-Time (JIT) debugging to activate the kernel independent transport layer (KITL) and establish a kernel debugger connection to a stand-alone device at the time of a second-chance exception. If JIT debugging is not enabled, unhandled second-chance exceptions cause the application to terminate.

To set up and use JIT debugging, complete the following steps.

  1. Create a Windows Embedded Compact OS that supports JIT debugging.
  2. Configure the device to support JIT debugging.
  3. Configure Platform Builder to connect to the stand-alone device and receive debug output.
  4. Use JIT debugging when you are debugging your OS.

To create an OS that supports JIT debugging

  1. In Platform Builder, in the OS design project build options, set Enable kernel debugger to Yes and set Enable Kernel Independent Transport Layer (KITL) to Yes. For instructions about setting build options, see Set Build Options for Debugging.

  2. Include the following three files in the OS image:

    • kd.dll
    • osaxst0.dll
    • osaxst1.dll

    These files, which are on the development computer in %_WINCEROOT%\public\COMMON\oak\target\<CPU type>\<build type>, are included automatically in the OS when the kernel debugger is enabled in the build options. For instructions about setting build options, see Set Build Options for Debugging.

To configure a device to support JIT debugging

  1. Set up your device to be stand-alone. The method to do so is device-dependent, but it includes downloading the OS into nonvolatile storage on your device so that it can start without using Platform Builder and then configuring your device to boot from nonvolatile storage.

  2. Configure the device to use passive KITL. The way you enable passive KITL is device-dependent but, for example, may be part of the boot loader configuration menu.

To configure Platform Builder to connect to a stand-alone device to receive JIT debug output

  1. In Platform Builder, with an OS design project open, create a device profile as explained in the procedure "To configure a connection between Platform Builder and the device" in Download the OS to a Target Device for Debugging

  2. In Platform Builder, open the Target Device Connectivity Options dialog box if it is not open already. To open the Target Device Connectivity Options, click Target, and then click Connectivity Options.

  3. In the Target Device Connectivity Options dialog box, click the Target Device box, and then click the device that you created.

  4. In the left pane, click Kernel Service Map.

  5. On the Kernel Service Map page, verify that the Kernel Debugger is set to KdStub.

  6. In the left pane, click Core Service Settings.

  7. Under Download Image, select Never (jump to image only). (The device is stand-alone so it must already contain the run-time image.) Under KITL Settings, select the Enable KITL on device boot check box. For information about these options, see Target Device Connectivity Options: Core Service Settings.

  8. If you changed any settings, click Apply, and then click Close. Otherwise, just click Close.

  9. In Platform Builder, enable JIT debugging by using the Just-In-Time, Debugging, Options Dialog Box.

To use JIT debugging

  1. Start the OS on the device.

  2. If an exception occurs while the OS is running on the device, start Platform Builder on the development computer.

  3. Open the OS design project.

  4. In Platform Builder, on the Target toolbar, click the device profile that you created by using the previous instructions. (If you cannot see the Target toolbar, click View, click Toolbars, and then click Target.)

  5. Connect the development computer to the device by using the connection option that you chose for the device’s Kernel Transport in the Connectivity Settings dialog box on the Kernel Service Map page.

  6. In Platform Builder, click Target, and then click Attach Device.

    In Platform Builder, a dialog box for the exception appears. Handle this as you normally would if you were not doing JIT debugging. For more information, see Handle Exceptions.

See Also

Concepts

Just-In-Time Kernel Debugging
Kernel Debugger
Debugging