User manual

UM0036 Project creation and build
Doc ID 7705 Rev 11 97/385
Debug information
The Debug Info settings allow you to choose the debug information to generate for your
application based on use (for programming or debugging). Including the debug information
will make the application file larger, however debug information is not included in the code
that is loaded in the microcontroller’s memory. This information is used by STVD’s debugger,
only.
When the category is set to General, the standard debug information options are:
None: The resulting file is free of the debug information required for the debugger. This
option should only be used once your application is completely debugged and ready for
programming.
Debugger Compatible (default): Inserts the +debug option in the command line,
which generates the debug information required by STVD for all supported debugging
instruments. Also inserts the -pxp option in the command line to disable the use of
absolute paths in the debug information. In this case, you provide the paths in the
Debug tab of the Project Settings window (see Section 4.5.2: Debug settings tab on
page 86).
On Data Objects Only: Inserts the -pxd option in the command line, causing the
compiler to add the debug information to the object file for data only.
On Any Label: Inserts the -pxx command in the command line, causing the compiler
to add debug information for any label defining code or data to the object file.
Customize: Allows you to choose the options you want for generation of debug
information (Options are summarized in Customizing Cosmic C compiler debug
information settings on page 99).
Optimizations
The Optimization settings allow you to optimize your code once you have finished
debugging your application, in order to make the final version more compact and faster. You
should not optimize your code when debugging because some optimizations will eliminate
or ignore the debug information required by STVD and your debug instrument.
Table 32. Cosmic C compiler memory models for STM8
Memory model
(1)
1. For complete descriptions of memory models, refer to the C Cross Compiler User’s Guide
Stack type and location Location of global variables
(2)
2. Short range means the variable is stored on one byte. Long range means the variable is stored on two
bytes.
Short stack
(+mods0)
Physical stack in Long range
memory for code size under
64Kbytes
Short range memory
Long stack
(+modsl0)
Physical stack in Long range
memory for code size under
64Kbytes
Long range memory
Short stack
(+mods)
Physical stack in Long range
memory
Short range memory
Long stack
(+modsl)
Physical stack in Long range
memory
Long range memory