2.3.76. LOAD

The LOAD command loads the specified executable file into the debugger.

Syntax

LOAD [/A] [/C] [/NI] [{/NP|/SP}] [/NS] [/PD] [/R] absolute_filename[,root] [;section [,section]...] [;arg1 ...] [&base_address]

where:

/A

This loads and appends another executable image without deleting any existing one. If the new image file overlaps the addresses of the existing object modules, the load terminates and displays an error message. If you want to replace the current image with a new one, use /R.

This option might be the default option if you are running an operating system extension to RealView Debugger. For more information, consult the manual provided with the extension.

/C

Converts all symbols to lowercase as they are read by the absolute file reader.

/NI

Loads only the symbol table. Overlap of addresses is checked if /A is also used. Does not load the program image code or the data.

/NP

Prevents the command changing the value of the PC.

/NS

Prevents the command loading debug information into the symbol table. Only the program image is loaded. No check for overlapping addresses is made. The /NS option can be used to reload the current program image without affecting the symbol table.

/PD

Pop dialog. Display a dialog for errors and warnings, rather than dumping them to the log.

/R

Replaces the existing program with the program being loaded.

/SP

Sets the PC to the start address specified in the object module. This is the default behavior when symbols are loaded, the image file specifies an entry address and the /A flag is not also specified.

absolute_filename

Specifies the name of the absolute object file to be loaded. Quotation marks are optional, but see Rules for specifying filenames for details on how to specify filenames that include a path. Also, see Rules.

root

Specifies the root associated with the symbols in the program being loaded. The default root is the filename without an extension. See Rules for details on how to specify a root.

section

Lists sections to load when an image is being loaded. The default is to load all sections. This option is commonly used to reload the initialized data area when starting a program.

The section names that are available for a specific image can be listed using the ARM development tools command fromelf or the GNU development tools command objdump. See Rules for details on how to specify sections.

args

Specifies an optional, space-separated, list of arguments to the image.

Note

You can also specify arguments using the ARGUMENTS command. For example, you can might want to modify the arguments without unloading the image.

The case of arguments is preserved. See Rules for details on how to specify arguments.

base_address

Specifies an address offset to be added to all sections when computing the load addresses. For this option to work correctly, the program must have been compiled with Position-Independent Code (PIC) and Position-Independent Data (PID).

Description

The LOAD command loads the specified executable file into the debug target. The file specified must be a format supported by the RealView Debugger.

To reset the initialized values of program variables after entering a RESET or a RESTART command, you must reload your program using the LOAD command. The RELOAD command checks the file date to determine whether program symbols have changed and therefore whether they must be reloaded.

If a load is performed that includes the symbol table, any breakpoints or macros referring to symbols in the previous root are invalidated.

The LOAD command runs synchronously.

Rules

Follow these rules when using LOAD:

  • absolute_filename, root, section, and args must all be placed in the same set of quotes. For example, on Windows:


    load /pd/r ’c:\source\demofile.axf ;ER_RO,ER_ZI ;12345’ &0x8A00

  • If you want to specify arguments, but not a section, you must specify an empty section. All sections are loaded in this case. For example:


    load /pd/r ’c:\source\myfile.axf;;arg1 arg2 arg3’

  • Where an argument includes spaces, additional quotes must be used. Use single quotes around arguments if the outer quotes are double quotes. Use double quotes around arguments if outer quotes are single quotes. For example:


    load /pd/r "myimage.axf ;;12345 ’Argument Two’" &0x8A00

  • base_address must be placed outside the quotes, and must be the last parameter specified.

Examples

The following examples show how to use LOAD:

load ’c:\source\myfile.axf’

Load the executable file myfile.axf to the target.

load /ni/sp ’c:\source\rtos.axf’

Load the symbol table for an image rtos.axf that is also in target ROM, setting the PC to the program start address so that a subsequent GO runs the program.

load /np ’c:\source\mp3.axf’

Load the executable library mp3.axf onto the target so that the preloaded executable can use it. The PC is not modified. Symbol table entries in mp3.axf are added to the existing symbol table.

Note

Ensure that executables you load in this way occupy distinct memory regions. No relocation is performed by RealView Debugger unless you specify a base offset.

load /pd/r ’c:\source\demofile.axf ;ER_RO,ER_ZI’ &0x8A00

Load the executable file demofile.axf to the default target. Specify an offset added to all sections to compute the load addresses. Load only the specified sections ER_RO and ER_ZI.

load /pd/r ’c:\source\myfile.axf;;arg1 arg2 arg3’

Load the executable file myfile.axf to the default target using an arguments list. An empty section list is given so all sections are loaded.

See also

The following commands provide similar or related functionality:

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0175G
Non-Confidential