Compiler Getting Started GuidePreface Getting Started Using Common Compiler Options Mandatory armclang options Common Arm Compiler toolchain options Selecting source language options Selecting optimization options Building to aid debugging Linking object files to produce an executable Linker options for mapping code and data to target Passing options from the compiler to the linker Controlling diagnostic messages Selecting floating-point options Compilation tools command-line option rules Writing Optimized Code Assembling Assembly Code Using Assembly and Intrinsics in C or C++ Code Mapping Code and Data to the Target Overlays Embedded Software Development Building Secure and Non-secure Images Using Armv8‑ Overview of the Linker Getting Image Details SysV Dynamic Linking Overview of the fromelf Image Converter Using fromelf Overview of the Arm Librarian Overview of the armasm Legacy Assembler Supporting reference information
Building to aid debugging
2.5 Building to aid debugging
During application development, you must debug the image that you build. The Arm® Compiler tools have various features that provide good debug view and enable source-level debugging, such as setting breakpoints in C and C++ code. There are also some features you must avoid when building an image for debugging.
Available command-line options
To build an image for debugging, you must compile with the
When linking, there are several armlink options available to help improve the debug view:
Effect of optimizations on the debug view
To build an application that gives the best debug view, it is better to use
options that give the fewest optimizations. Arm recommends using optimization level
Higher optimization levels perform progressively more optimizations with correspondingly poorer debug views.
The compiler attempts to automatically inline functions at optimization levels
Support for debugging overlaid programs
The linker provides various options to support overlay-aware debuggers:
These options permit an overlay-aware debugger to track which overlay is active.
Features to avoid when building an image for debugging
Avoid using the following in your source code:
Avoid using the following features when building an image for debugging:
of your data.