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

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