240ac8eb89
Instead of placing the distro name (e.g. 'Fedora Linux') into the version.in file, use the --with-pkgconfig configure option to set the disto name. This does change GDB's version output slightly. Prior to this commit we might expect to see something like this: $ gdb --version GNU gdb (GDB) Fedora Linux 13.1-1-fc38 ... Now we'll see this: $ gdb --version GNU gdb (Fedora Linux) 13.1-1-fc38 ... Notice that 'Fedora Linux' moved inside the parenthesis. There are other benefits to this change, the Python gdb.VERSION string will now contain '13.1-1-fc38' instead of 'Fedora Linux 13.1-1-fc38', this was reported as an issue in this bug: https://bugzilla.redhat.com/show_bug.cgi?id=2179554 I've also removed the change to gdb.gdb/selftest.exp as I don't believe that this was ever being used -- when this test was run we should have hit an earlier case. I have added a brand new test that checks our version string. I've placed this new test into a separate file, so we should (hopefully) not have any issues maintaining this as an out of tree test. For implementation, by default we make use of the %dist_name macro, however, this is not defined on RHEL 9 or earlier, so to support reusing this commit on RHEL systems, I also detect the %rhel macro, and in that case use a hard-coded string.
35 lines
1.4 KiB
Diff
35 lines
1.4 KiB
Diff
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
From: Andrew Burgess <aburgess@redhat.com>
|
|
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
|
Subject: gdb-6.3-rh-testversion-20041202.patch
|
|
|
|
;; Check distro name is included in the version output.
|
|
|
|
diff --git a/gdb/testsuite/gdb.base/fedora-version.exp b/gdb/testsuite/gdb.base/fedora-version.exp
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/gdb/testsuite/gdb.base/fedora-version.exp
|
|
@@ -0,0 +1,22 @@
|
|
+# Copyright 2023 Free Software Foundation, Inc.
|
|
+
|
|
+# This program is free software; you can redistribute it and/or modify
|
|
+# it under the terms of the GNU General Public License as published by
|
|
+# the Free Software Foundation; either version 3 of the License, or
|
|
+# (at your option) any later version.
|
|
+#
|
|
+# This program is distributed in the hope that it will be useful,
|
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
+# GNU General Public License for more details.
|
|
+#
|
|
+# You should have received a copy of the GNU General Public License
|
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
+
|
|
+# Start with a fresh gdb
|
|
+clean_restart
|
|
+
|
|
+# Check the version string contains either the Fedora or RHEL distro
|
|
+# name, and that the version number looks roughly correct in format.
|
|
+gdb_test "show version" \
|
|
+ "GNU gdb \\((Fedora Linux|Red Hat Enterprise Linux)\\) \[0-9\]+\\.\[0-9\]+-\[0-9\]+.*"
|