mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-24 22:27:21 -04:00
Cleanup debug symbols (#1009)
This commit is contained in:
commit
d8f46ac38b
7 changed files with 34 additions and 4 deletions
|
@ -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.
|
||||
| `-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).
|
||||
| `-g` | Include debugging information/symbols in ELF.
|
||||
| `-mstrict-align` | Unaligned memory accesses cannot be resolved by the hardware and require emulation.
|
||||
| `-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).
|
||||
|=======================
|
||||
|
||||
.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:
|
||||
==== Custom (Compiler) Flags
|
||||
|
||||
|
|
|
@ -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:
|
||||
**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:
|
||||
|
||||
[start=1]
|
||||
|
|
|
@ -106,7 +106,7 @@ IMAGE_GEN = $(NEORV32_EXG_PATH)/image_gen
|
|||
|
||||
# Compiler & linker flags
|
||||
CC_OPTS = -march=$(MARCH) -mabi=$(MABI) $(EFFORT) -Wall -ffunction-sections -fdata-sections -nostartfiles -mno-fdiv
|
||||
CC_OPTS += -mstrict-align -mbranch-cost=10 -g -Wl,--gc-sections -ffp-contract=off
|
||||
CC_OPTS += -mstrict-align -mbranch-cost=10 -Wl,--gc-sections -ffp-contract=off
|
||||
CC_OPTS += $(USER_FLAGS)
|
||||
LD_LIBS = -lm -lc -lgcc
|
||||
LD_LIBS += $(USER_LIBS)
|
||||
|
|
15
sw/example/eclipse/.settings/org.eclipse.cdt.core.prefs
Normal file
15
sw/example/eclipse/.settings/org.eclipse.cdt.core.prefs
Normal file
|
@ -0,0 +1,15 @@
|
|||
eclipse.preferences.version=1
|
||||
indexer/indexAllFiles=true
|
||||
indexer/indexAllHeaderVersions=true
|
||||
indexer/indexAllVersionsSpecificHeaders=
|
||||
indexer/indexOnOpen=true
|
||||
indexer/indexUnusedHeadersWithAlternateLang=true
|
||||
indexer/indexUnusedHeadersWithDefaultLang=true
|
||||
indexer/indexerId=org.eclipse.cdt.core.fastIndexer
|
||||
indexer/skipFilesLargerThanMB=8
|
||||
indexer/skipImplicitReferences=false
|
||||
indexer/skipIncludedFilesLargerThanMB=16
|
||||
indexer/skipMacroReferences=false
|
||||
indexer/skipReferences=false
|
||||
indexer/skipTypeReferences=false
|
||||
indexer/useHeuristicIncludeResolution=true
|
|
@ -1,3 +1,3 @@
|
|||
eclipse.preferences.version=1
|
||||
executable.name=openocd.exe
|
||||
install.folder=C\:\\xpack\\xpack-openocd-0.12.0-3\\bin
|
||||
install.folder=C\:\\xpack\\xpack-openocd-0.12.0-4\\bin
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
toolchain.path.2273142913=C\:\\xpack\\xpack-riscv-none-elf-gcc-14.1.0-1\\bin
|
||||
toolchain.path.2273142913=C\:\\xpack\\xpack-riscv-none-elf-gcc-14.2.0-2\\bin
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
# Override the default RISC-V GCC prefix
|
||||
RISCV_PREFIX = riscv-none-elf-
|
||||
|
||||
# Add debug symbols
|
||||
USER_FLAGS += -ggdb -gdwarf-3
|
||||
|
||||
# Modify this variable to fit your NEORV32 setup (neorv32 home folder)
|
||||
NEORV32_HOME ?= ../../..
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue