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

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