Blame SOURCES/gdb-6.3-rh-testversion-20041202.patch

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