1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Makefile - use -gddb2, not -gddb3 due to issues with GDB crashing. (#12971)

Makefile - use gddb2, not gddb3 due to issues with GDB crashing.

The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* https://github.com/microsoft/vscode-cpptools/issues/9219#issuecomment-1118034083

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
This commit is contained in:
Dominic Clifton 2023-07-26 00:53:10 +02:00 committed by GitHub
parent 293e14e8bd
commit 2edc5fb7d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,10 +145,10 @@ ifeq ($(DEBUG),GDB)
OPTIMISE_DEFAULT := -Og OPTIMISE_DEFAULT := -Og
LTO_FLAGS := $(OPTIMISE_DEFAULT) LTO_FLAGS := $(OPTIMISE_DEFAULT)
DEBUG_FLAGS = -ggdb3 -gdwarf-5 -DDEBUG DEBUG_FLAGS = -ggdb2 -gdwarf-5 -DDEBUG
else else
ifeq ($(DEBUG),INFO) ifeq ($(DEBUG),INFO)
DEBUG_FLAGS = -ggdb3 DEBUG_FLAGS = -ggdb2
endif endif
OPTIMISATION_BASE := -flto -fuse-linker-plugin -ffast-math -fmerge-all-constants OPTIMISATION_BASE := -flto -fuse-linker-plugin -ffast-math -fmerge-all-constants
OPTIMISE_DEFAULT := -O2 OPTIMISE_DEFAULT := -O2