[docs] add notes regarding ELF debug symbols

This commit is contained in:
stnolting 2024-09-08 13:44:09 +02:00
parent 60587b3eef
commit 9c6cd3b3fc
2 changed files with 13 additions and 1 deletions

View file

@ -290,12 +290,18 @@ The makefile's `CC_OPTS` is exported as **define** to be available within a C pr
| `-lc` | Search for the standard C library when linking. | `-lc` | Search for the standard C library when linking.
| `-lgcc` | Make sure we have no unresolved references to internal GCC library subroutines. | `-lgcc` | Make sure we have no unresolved references to internal GCC library subroutines.
| `-mno-fdiv` | Use built-in software functions for floating-point divisions and square roots (since the according instructions are not supported yet). | `-mno-fdiv` | Use built-in software functions for floating-point divisions and square roots (since the according instructions are not supported yet).
| `-g` | Include debugging information/symbols in ELF.
| `-mstrict-align` | Unaligned memory accesses cannot be resolved by the hardware and require emulation. | `-mstrict-align` | Unaligned memory accesses cannot be resolved by the hardware and require emulation.
| `-mbranch-cost=10` | Branching costs a lot of cycles. | `-mbranch-cost=10` | Branching costs a lot of cycles.
| `-ffp-contract=off` | Do not allow contraction of floating-point operations (no fused operations as they are not supported). | `-ffp-contract=off` | Do not allow contraction of floating-point operations (no fused operations as they are not supported).
|======================= |=======================
.Debug Symbols
[IMPORTANT]
By default, no debug symbols are added to the ELF.
You can add them manually (to your local project's makefile) via `USER_FLAGS+=-g`.
Note that other debug flags may be required depending of the GCC/GDB version
(e.g. `USER_FLAGS += -ggdb -gdwarf-3`).
:sectnums: :sectnums:
==== Custom (Compiler) Flags ==== Custom (Compiler) Flags

View file

@ -190,6 +190,12 @@ the required `main.elf` file gets generated instead of _all_ executable files (l
When you start debugging the first time you might need to select the provided debug configuration: When you start debugging the first time you might need to select the provided debug configuration:
**GDB OpenOCD Debugging > eclipse_example Default** **GDB OpenOCD Debugging > eclipse_example Default**
.Debug Symbols
[IMPORTANT]
For debugging the ELF has to compiled to contain according debug symbols.
Debug symbols are enabled by the project's local makefile: `USER_FLAGS += -ggdb -gdwarf-3`
(this configuration seems to work best for Eclipse - at least for me).
If you need to reconfigure OpenOCD binaries and/or paths: If you need to reconfigure OpenOCD binaries and/or paths:
[start=1] [start=1]