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

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