Skip to content

Commit

Permalink
makefiles/tools/gdb.inc.mk: prefer $(target)-gdb over gdb-multiarch
Browse files Browse the repository at this point in the history
In an ideal world everyone would just install `gdb-multiarch` and be
happy. However, some MCUs need magic GDB versions sprinkled with
unicorn-stardust-Espressif-patches...

Since there is little reason to have `$(target)-gdb` installed in
addition to `gdb-multiarch` if `gdb-multiarch` would work fine, let's
assume the user wants to use `$(target)-gdb` when present over
`gdb-multiarch`.

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
(cherry picked from commit b9b63da)
  • Loading branch information
maribu committed Dec 5, 2022
1 parent f1873d8 commit 89cded6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions makefiles/tools/gdb.inc.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# new versions of gdb will support all architectures in one binary
ifeq ($(shell gdb-multiarch -v > /dev/null 2>&1; echo $$?),0)
export GDB ?= gdb-multiarch
export GDBPREFIX ?= $(PREFIX)

# If the user installed a magic single target GDB rather than just using
# gdb-multiarch, there typically is a reason for it - e.g. missing support for
# that particular target in gdb-multiarch.
ifeq ($(shell $(GDBPREFIX)gdb -v > /dev/null 2>&1; echo $$?),0)
export GDB ?= $(GDBPREFIX)gdb
else
export GDBPREFIX ?= $(PREFIX)
export GDB ?= $(GDBPREFIX)gdb
# gdb-multiarch is normally
export GDB ?= gdb-multiarch
endif

0 comments on commit 89cded6

Please sign in to comment.