On-Target Debugging

This document describes how to build a device driver to enable stop mode debugging.

On-target debugging

Device Driver debugging is similar to kernel-mode debugging, as drivers run as part of the Kernel. Debug versions of the drivers can be debugged using debug tools such as Lauterbach through a JTAG interface or an IDE. Other debug tools such as Metro TRK can also be used.

Most of the hardware platforms supported by Symbian platform are ICE-enabled. Kernel developers and those porting the operating system to new hardware often have access to development boards exposing the JTAG interface, which allows the use of CPU-level debuggers. Using a host PC debugger, such as Carbide.c++ or CodeWarrior configured for remote debugging, a debug ROM image (including drivers) can be downloaded to the target and debugged over a JTAG interface.

For debugging, debug versions drivers are built, and the ROM image is built to include the kernel debug DLL, which enables kernel-side (stop mode) debugging. This is done by using the STOP_MODE_DEBUGGING flag while building the ROM image. For example:

rom –v=h4hrp –I=armv5 –define=STOP_MODE_DEBUGGING

This includes the kernel extension kdebug.dll in the ROM image, which provides a stop mode debugger API.

When the ROM image is downloaded to the target, the system boots up and the Kernel or driver can be debugged using the host based IDE interface. Code can be stepped through and halted, and memory on the target can be viewed.

Symbian also provide a debug monitor (sometimes called the crash debugger) to provide information on Kernel crashes. See Debug Monitor Tool for more details.