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

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