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

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