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

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