Blame SOURCES/gdb-libexec-add-index.patch

ed07ac
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
ed07ac
From: Fedora GDB patches <invalid@email.com>
ed07ac
Date: Fri, 27 Oct 2017 21:07:50 +0200
ed07ac
Subject: gdb-libexec-add-index.patch
ed07ac
ed07ac
;; Fix gdb-headless /usr/bin/ executables (BZ 1390251).
ed07ac
;;
ed07ac
;; Also, make /usr/bin/gdb.minimal be the default GDB used, if it's
ed07ac
;; present.  For rationale, see:
ed07ac
;;
ed07ac
;;   https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot
ed07ac
;;=fedora
ed07ac
ed07ac
diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
ed07ac
--- a/gdb/contrib/gdb-add-index.sh
ed07ac
+++ b/gdb/contrib/gdb-add-index.sh
ed07ac
@@ -22,6 +22,20 @@ GDB=${GDB:=gdb}
ed07ac
 OBJCOPY=${OBJCOPY:=objcopy}
ed07ac
 READELF=${READELF:=readelf}
ed07ac
 
ed07ac
+GDB2=/usr/libexec/gdb
ed07ac
+if test -x $GDB2 && ! which $GDB &>/dev/null; then
ed07ac
+    GDB=$GDB2
ed07ac
+fi
ed07ac
+
ed07ac
+# We default to using /usr/bin/gdb.minimal if it's present.  See
ed07ac
+# https://bugzilla.redhat.com/show_bug.cgi?id=1695015 and
ed07ac
+# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot for
ed07ac
+# explanations.
ed07ac
+GDB3=/usr/bin/gdb.minimal
ed07ac
+if test -x $GDB3; then
ed07ac
+    GDB=$GDB3
ed07ac
+fi
ed07ac
+
ed07ac
 myname="${0##*/}"
ed07ac
 
ed07ac
 dwarf5=""