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

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