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