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

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