..  Copyright (c) 2014-present PlatformIO <contact@platformio.org>
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
       http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

.. _projectconf_debug_build_flags:

``debug_build_flags``
---------------------

Type: ``String`` | Multiple: ``Yes`` | Default: ``-Og -g2 -ggdb2``

These flags/options affect the preprocessing, compilation, assembly
and linking processes for C and C++ code.

.. note::
  This option might be helpful to adjust the optimization level if firmware with
  debug information is too big to be uploaded to a target

**Example**

.. code-block:: ini

    [env:debug]
    platform = ...
    board = ...

    ; Set optimization level and amount of debug information generated by the compiler
    debug_build_flags = -O0 -ggdb3 -g3

`Other possible flags  <https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html>`__
that might be useful for debugging your application.
