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

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