Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 用户手册
产品代码
SW006021-1
MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 84
2012 Microchip Technology Inc.
4.5
COMPILER OUTPUT
There are many files created by the compiler during the compilation. A large number of
these are intermediate files and some are deleted after compilation is complete, but
many remain and are used for programming the device, or for debugging purposes.
these are intermediate files and some are deleted after compilation is complete, but
many remain and are used for programming the device, or for debugging purposes.
4.5.1
Output Files
The names of many output files use the same base name as the source file from which
they were derived. For example, the source file input.c will create a p-code file called
input.p1
they were derived. For example, the source file input.c will create a p-code file called
input.p1
.
Some of the output files contain project-wide information and are not directly associ-
ated with any one particular input file, e.g., the map file. If the names of these output
files are not specified by a compiler option, their base name is derived from the first C
source file listed on the command line. If there are no files of this type specified, the
name is based on the first input file (regardless of type) on the command line.
ated with any one particular input file, e.g., the map file. If the names of these output
files are not specified by a compiler option, their base name is derived from the first C
source file listed on the command line. If there are no files of this type specified, the
name is based on the first input file (regardless of type) on the command line.
If you are using an IDE, such as MPLAB X IDE, to specify options to the compiler, there
is typically a project file that is created for each application. The name of this project is
used as the base name for project-wide output files, unless otherwise specified by the
user. However check the manual for the IDE you are using for more details.
is typically a project file that is created for each application. The name of this project is
used as the base name for project-wide output files, unless otherwise specified by the
user. However check the manual for the IDE you are using for more details.
The compiler is able to directly produce a number of the output file formats which are
used by the 8-bit PIC development tools.
used by the 8-bit PIC development tools.
The default behavior of xc8 is to produce a Microchip format COFF and Intel HEX out-
put. Unless changed by a driver option, the base names of these files will be the project
name. The default output file types can be controlled by compiler options, e.g., the
--OUTPUT
put. Unless changed by a driver option, the base names of these files will be the project
name. The default output file types can be controlled by compiler options, e.g., the
--OUTPUT
option. The extensions used by these files are fixed and are listed together
with this option’s description in Section 4.8.44 “--OUTPUT= type: Specify Output
File Type”.
File Type”.
The COFF file is used by debuggers to obtain debugging information about the project.
Table 4-14 shows all output format options available with xc8 using the --OUTPUT
option. The File Type column lists the filename extension which will be used for the
output file.
option. The File Type column lists the filename extension which will be used for the
output file.
4.5.1.1
SYMBOL FILES
xc8
creates two symbol files which are used to generate the debug output files, such
as COFF and ELF files. These are the SYM files (.sym extension) produced by the
linker, and the SDB file (.sdb extension) produced by the code generator.
linker, and the SDB file (.sdb extension) produced by the code generator.
The SDB file contains type information, and the SYM file contains address informa-
tion.These two files, in addition to the HEX file, are combined by the CROMWELL appli-
cation (see Section 8.5 “CROMWELL”) to produce the output debug files, such as the
COFF file.
tion.These two files, in addition to the HEX file, are combined by the CROMWELL appli-
cation (see Section 8.5 “CROMWELL”) to produce the output debug files, such as the
COFF file.
Note:
Throughout this manual, the term project name will refer to either the name
of the project created in the IDE, or the base name (file name without
extension) of the first C source file specified on the command line.
of the project created in the IDE, or the base name (file name without
extension) of the first C source file specified on the command line.