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

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