public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Require gnatmake 8 for gdb.ada/rename_subscript_param.exp
@ 2019-09-14  8:35 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-09-14  8:35 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d1b70248bde3ffe784cd7380de05b86d0b4b901e

commit d1b70248bde3ffe784cd7380de05b86d0b4b901e
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat Sep 14 10:35:48 2019 +0200

    [gdb/testsuite] Require gnatmake 8 for gdb.ada/rename_subscript_param.exp
    
    When running gdb.ada/rename_subscript_param.exp with gnatmake 7.4.1, we get:
    ...
    FAIL: gdb.ada/rename_subscript_param.exp: print rename_subscript_param_b \
      before changing its value
    FAIL: gdb.ada/rename_subscript_param.exp: print rename_subscript_param_b \
      after changing its value
    ...
    
    The commit last touching the test-case (afcfda091e) states:
    ...
        The test still fails with old compilers that do not properly
        generate debug info for this renaming:
    ...
    
    Fix this by requiring at least gnatmake 8 for the test-case.
    
    Tested on x86_64-linux.
    
    gdb/testsuite/ChangeLog:
    
    2019-09-14  Tom de Vries  <tdevries@suse.de>
    
    	PR teststuite/24599
    	* gdb.ada/rename_subscript_param.exp: Require gnatmake 8.
    	* lib/ada.exp (gnatmake_version_at_least): New proc.

Diff:
---
 gdb/testsuite/ChangeLog                          |  6 ++++++
 gdb/testsuite/gdb.ada/rename_subscript_param.exp |  4 ++++
 gdb/testsuite/lib/ada.exp                        | 19 +++++++++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 395a257..d04cff1 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2019-09-14  Tom de Vries  <tdevries@suse.de>
+
+	PR teststuite/24599
+	* gdb.ada/rename_subscript_param.exp: Require gnatmake 8.
+	* lib/ada.exp (gnatmake_version_at_least): New proc.
+
 2019-09-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* gdb.base/maint.exp: Use exec_has_index_section.
diff --git a/gdb/testsuite/gdb.ada/rename_subscript_param.exp b/gdb/testsuite/gdb.ada/rename_subscript_param.exp
index ffcfa50..fd82088 100644
--- a/gdb/testsuite/gdb.ada/rename_subscript_param.exp
+++ b/gdb/testsuite/gdb.ada/rename_subscript_param.exp
@@ -15,6 +15,10 @@
 
 load_lib "ada.exp"
 
+if { ![gnatmake_version_at_least 8] } {
+    return -1
+}
+
 standard_ada_testfile pb30_012
 
 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 1345c74..95f0f52 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -105,3 +105,22 @@ proc find_ada_tool {tool} {
 
     return $result
 }
+
+# Return 1 if gnatmake is at least version $MAJOR.x.x
+
+proc gnatmake_version_at_least { major } {
+    set gnatmake [gdb_find_gnatmake]
+    set gnatmake [lindex [split $gnatmake] 0]
+    set output [exec $gnatmake --version]
+    if { [regexp {GNATMAKE ([^ .]+).([^ .]+).([^ .]+)} $output \
+	      match gnatmake_major gnatmake_minor gnatmake_micro] } {
+	if { $gnatmake_major >= $major } {
+	    return 1
+	} else {
+	    return 0
+	}
+    }
+
+    # Unknown, return 1
+    return 1
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-14  8:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-14  8:35 [binutils-gdb] [gdb/testsuite] Require gnatmake 8 for gdb.ada/rename_subscript_param.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).