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

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