[gdb/testsuite] Require gnatmake 8 for gdb.ada/rename_subscript_param.exp
authorTom de Vries <tdevries@suse.de>
Sat, 14 Sep 2019 08:35:48 +0000 (10:35 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 14 Sep 2019 08:35:48 +0000 (10:35 +0200)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/rename_subscript_param.exp
gdb/testsuite/lib/ada.exp

index 395a257102a86216aba5c3af01304b00fb2f1f5b..d04cff15b86eb99ecbe7756d05c948ee19426151 100644 (file)
@@ -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.
 2019-09-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.base/maint.exp: Use exec_has_index_section.
index ffcfa50df33498d0583660a419f492315f9eafda..fd8208825a0712e26615e77f19a77f9af735c747 100644 (file)
 
 load_lib "ada.exp"
 
 
 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]] != "" } {
 standard_ada_testfile pb30_012
 
 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
index 1345c747c5eebc68e183b0251f0a61411004f300..95f0f525b1a75ca3ad02754a680dd1ab88ea3f88 100644 (file)
@@ -105,3 +105,22 @@ proc find_ada_tool {tool} {
 
     return $result
 }
 
     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
+}
This page took 0.042949 seconds and 4 git commands to generate.