|Non-Confidential||PDF version||ARM 100953_0527_00_en|
|Home > Debugging Embedded Systems > About OS awareness > About debugging PikeOS|
DS-5 supports source level debugging of PikeOS.
From a debugging perspective, PikeOS consists of mainly these parts:
All these parts have separate symbol files and you must ensure that the symbols for the relevant parts are loaded at the correct address spaces.
This step is not required or used by the OS awareness, but improves your experience if you plan to debug either of these components.
The initial enablement of the MMU is done by the Platform Support Package (PSP) during its early initialization. The point at which the MMU is enabled differs by platform. Some PSPs provide explicit symbols to mark the first virtual instructions, while others do not. To find the first point at which the MMU is enabled, inspection of the specific platform's PSP is required.
The MMU is enabled by the time the PSP starts the kernel and the kernel entry point
P4Main is passed. When the MMU is enabled, it is safe to enable
The kernel debug image contains debug symbols for both the kernel and the PSP. All symbols have virtual addresses and require the MMU to be enabled. The early PSP initialization occurs before the MMU is enabled. To debug the early PSP initialization, load the kernel symbols with an offset so that their offset virtual addresses align with their physical counterparts.
Since the MMU is currently off, DS-5 Debugger's OS support must be disabled before the kernel debug symbols are loaded. This is to avoid the debugger from trying to read the kernel structures before they are set up (and possibly resulting in Data Aborts). To disable OS awareness, enter set os enabled off in the DS-5 Command view and click Submit or press Enter.
To calculate the required load offset, calculate the difference (
P-V) between the physical start address of the boot
P) and the virtual start address of the
kernel image (
For example, if the kernel is linked at virtual address
and is loaded at physical address
0x20000000, the offset is
-0x60000000, which is
0x20000000 - 0x80000000
See About loading debug information into the debugger for information on loading debug symbols into the debugger. Also, see the documentation for the DS-5 add-symbol-file command for information about loading the debug symbols into the debugger from the command line.
When the MMU is enabled, the previously loaded debug information must be reloaded at the unadjusted virtual addresses. To reload the debug information, first, enter file in the DS-5 Command view to discard currently loaded symbols. Then, use the add-symbol-file command to load the kernel debug information into the debugger, but this time with zero offset.