Skip to content

Commit

Permalink
Makefile - use -gddb2, not -gddb3 due to issues with GDB crashing. (b…
Browse files Browse the repository at this point in the history
…etaflight#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
* microsoft/vscode-cpptools#9219 (comment)

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
  • Loading branch information
hydra authored and davidbitton committed Feb 5, 2024
1 parent 56862fe commit 8f50df7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -145,10 +145,10 @@ ifeq ($(DEBUG),GDB)
OPTIMISE_DEFAULT := -Og

LTO_FLAGS := $(OPTIMISE_DEFAULT)
DEBUG_FLAGS = -ggdb3 -gdwarf-5 -DDEBUG
DEBUG_FLAGS = -ggdb2 -gdwarf-5 -DDEBUG
else
ifeq ($(DEBUG),INFO)
DEBUG_FLAGS = -ggdb3
DEBUG_FLAGS = -ggdb2
endif
OPTIMISATION_BASE := -flto -fuse-linker-plugin -ffast-math -fmerge-all-constants
OPTIMISE_DEFAULT := -O2
Expand Down

0 comments on commit 8f50df7

Please sign in to comment.