|Non-Confidential||PDF version||ARM DUI0446Z|
|Home > Debugging Embedded Systems > About DS-5 Debugger support for overlays|
Overlaying is a programming method that allows applications to share execution regions of memory between different pieces of code at runtime. A piece of code can be transferred to the overlay region to be executed when needed. This piece of code is replaced with another when needed.
Code does not need to be stored in memory and could reside in other storage such as off-chip flash memory. Embedded systems, especially systems without support for virtual memory addressing and systems with limited memory, sometimes use overlays.
An overlaid application consists of:
As a developer, you must decide which functions from your application are used in overlays. You must also decide which functions are used in the same overlay.
You can specify the functions to overlay by annotating the function declarations in your source code. The annotation indicates which overlay each function must be in.
During compilation, the linker assigns overlays to a particular region. When overlays are loaded, it can only be loaded into that region. The linker also detects direct calls between overlays, and between overlays and non-overlaid code. The linker then redirects the calls through veneers, which call the overlay manager to automatically load the target overlay.
DS-5 Debugger automatically enables overlay support on the presence of linker generated tables and functions as described by the following symbols:
After loading your overlay-enabled application in DS-5, you can work with overlays from both the command-line console and from the user interface:
To see detailed information about the currently loaded overlays and the functions within each overlay, use the Overlays view. You can also use the info overlays command to view information about the currently loaded overlays and functions within each overlay.
See the overlay_manager example that is provided with DS-5 for a reference implementation of overlays.