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

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