About loading debug information into the debugger

An executable image contains symbolic references, such as function and variable names, in addition to the application code and data. These symbolic references are generally referred to as debug information. Without this information the debugger is unable to debug at the source level.

To debug an application at source level, the image file and shared object files must be compiled with debug information, and a suitable level of optimization. For example, when compiling with either the ARM® or the GNU compiler you can use the following options:

-g -O0

Debug information is not loaded when a file is loaded, but is a separate action. A typical load sequence is:

  1. Load the main application image.

  2. Load any shared objects.

  3. Load the symbols for the main application image

  4. Load the symbols for shared objects on-demand.

Images and shared objects might be preloaded onto the target, such as an image in a ROM device or an OS-aware target. The corresponding image file and any shared object files must contain debug information, and be accessible from your local host workstation. You can then configure a connection to the target loading only the debug information from these files. Use the Load symbols from file option on the debug configuration Files tab as appropriate for the target environment.

After connecting to the target you can also use the view menu entry Load... in the Debug Control view to load files as required. The following options for loading debug information are available:

Add Symbols File

Loads additional debug information into the debugger.

Load Debug Info

Loads debug information into the debugger.

Load Image and Debug Info

Loads the application image on to the target and debug information from the same images into the debugger.

Load Offset

Specifies a decimal or hexadecimal offset that is added to all addresses within the image. A hexadecimal offset must be prefixed with 0x.

Enable on-demand loading

Specifies how you want the debugger to load debug information. Enabling this option can provide a faster load and use less memory but debugging might be slower.

Figure 6. Load additional debug information dialog box

Load additional debug information dialog box

The debug information in an image or shared object also contains the path of the sources used to build it. When execution stops at an address in the image or shared object, the debugger attempts to open the corresponding source file. If this path is not present or the required source file is not found, then you must inform the debugger where the source file is located. You do this by setting up a substitution rule to associate the path obtained from the image with the path to the required source file that is accessible from your local host workstation.

Show/hideSee also

Copyright © 2010, 2011 ARM. All rights reserved.ARM DUI 0446G
Non-ConfidentialID092311