2.3.41. DELFILE

Removes filenames from the executable file list, provided the specified file is not loaded onto the target.


DELFILE [,auto] {filename | file_num}



Causes the command to remove unloaded files from the file list that were added as a result of the ADDFILE,auto command.


Identifies a file to be removed from the executable file list.

You can include one or more environment variables in the filename. For example, if MYPATH defines the location C:\Myfiles, you can specify:

delfile "$MYPATH\\myimage.axf"


The ADDFILE and the DELFILE commands are used to manipulate the executable image file list. This list is in most cases only one file, the executable you load onto the target using LOAD. There are circumstances where you must load more than one file onto the target at once. In these cases you use ADDFILE to set up the files to load, and RELOAD or LOAD/A to load them onto the target.

You use DELFILE to remove unloaded files that you have added to the executable file list. There are several ways to specify the files to delete:

  • by complete filename, for example C:\Source\dhry\Debug\dhry.axf

  • by short filename, for example dhry.axf

  • by file number, for example 2

  • as the currently unloaded files that were added to the list by ADDFILE,auto

  • as all currently unloaded files.

DELFILE with no arguments deletes all currently unloaded files, and DELFILE,auto deletes any currently unloaded files added as a result of an ADDFILE,auto.

Use DTFILE to display the current file list, including the defined short filenames, file numbers and whether the file is loaded or not.


  • If you use the full filename you must enclose it in double quotation marks. You do not have to quote the short filename in quotation marks, although you can.

Restrictions on the use of DELFILE

The DELFILE command has the following restrictions:

  • The DELFILE command is not allowed in a macro.

  • You cannot delete multiple named or numbered files in a single command. Use multiple DELFILE commands, or delete all files and then use ADDFILE as required.

  • An executable file must be unloaded from the target before its name can be removed from the file list. Use the UNLOAD command to unload a file that is no longer being used by the target.


The following examples show how to use ADDFILE and DELFILE:

> addfile ="C:\Source\helloworld\Debug\helloworld.axf"
> dtfile
File 1 with modid <not loaded>: Symbols not Loaded. 0 Sections.
  'helloworld.axf' As 'C:\Source\helloworld\Debug\helloworld.axf'

A file is added to the executable list, using ADDFILE, and DTFILE shows that it is on the list and has file number, or id, of 1 (the File 1 part of the output from DTFILE).

Because the file has not been loaded, the debugger has not read the symbol table to determine the code, data and Base Stack Segment (BSS) section sizes that a DTFILE following a LOAD displays.

To delete this file, you can use the file ID, reported in the first line of DTFILE output, as follows:

> delfile 1
> dtfile
No files for this process.

The DTFILE output tells you that the deletion was successful. In this particular case, the file id is not required, because a DELFILE with no parameters deletes all unloadable files. For example:

> addfile ="C:\Source\helloworld\Debug\helloworld.axf"
> delfile
> dtfile
No files for this process.

You can name the file to delete, using either the full name of the file or the short name listed in the DTFILE result:

> addfile ="C:\Source\helloworld\Debug\helloworld.axf"
> delfile helloworld.axf
> dtfile
No files for this process.

> addfile ="C:\Source\helloworld\Debug\helloworld.axf"
> delfile "C:\Source\helloworld\Debug\helloworld.axf"
> dtfile
No files for this process.

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N