4a80f0
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
4a80f0
From: Elena Zannoni <ezannoni@redhat.com>
4a80f0
Date: Fri, 27 Oct 2017 21:07:50 +0200
4a80f0
Subject: gdb-6.3-rh-testversion-20041202.patch
4a80f0
4a80f0
;; Match the Fedora's version info.
4a80f0
;;=fedora
4a80f0
4a80f0
2003-02-24  Elena Zannoni  <ezannoni@redhat.com>
4a80f0
4a80f0
        * gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
4a80f0
        string.
4a80f0
4a80f0
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
4a80f0
--- a/gdb/testsuite/gdb.gdb/selftest.exp
4a80f0
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
4a80f0
@@ -53,6 +53,9 @@ proc test_with_self { } {
4a80f0
 	-re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
4a80f0
 	    pass "printed version with cast"
4a80f0
 	}
4a80f0
+	-re ".\[0-9\]+ = .(Fedora|Red Hat Enterprise Linux) \[\\(\\)0-9.a-z\\-\]+.*$gdb_prompt $" {
4a80f0
+	    pass "printed version Fedora or Red Hat Enterprise Linux only"
4a80f0
+	}
4a80f0
     }
4a80f0
 
4a80f0
     # start the "xgdb" process
4a80f0
diff --git a/gdb/top.c b/gdb/top.c
4a80f0
--- a/gdb/top.c
4a80f0
+++ b/gdb/top.c
4a80f0
@@ -2163,7 +2163,7 @@ init_gdb_version_vars (void)
4a80f0
   struct internalvar *major_version_var = create_internalvar ("_gdb_major");
4a80f0
   struct internalvar *minor_version_var = create_internalvar ("_gdb_minor");
4a80f0
   int vmajor = 0, vminor = 0, vrevision = 0;
4a80f0
-  sscanf (version, "%d.%d.%d", &vmajor, &vminor, &vrevision);
4a80f0
+  sscanf (version, "Red Hat Enterprise Linux %d.%d.%d", &vmajor, &vminor, &vrevision);
4a80f0
   set_internalvar_integer (major_version_var, vmajor);
4a80f0
   set_internalvar_integer (minor_version_var, vminor + (vrevision > 0));
4a80f0
 }