]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: require gdb version 7.9 for gdb test
authorIan Lance Taylor <iant@golang.org>
Fri, 24 Jul 2015 05:40:30 +0000 (22:40 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 24 Jul 2015 17:15:44 +0000 (17:15 +0000)
Issue 11214 reports problems with older versions of gdb.  It does work
with gdb 7.9 on my Ubuntu Trusty system, so take that as the minimum
required version.

Fixes #11214.

Change-Id: I61b732895506575be7af595f81fc1bcf696f58c2
Reviewed-on: https://go-review.googlesource.com/12626
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/runtime-gdb_test.go

index a1c96bf134e322592a932b1a0718860366a27c23..2843633ee13341d62307abb72d8d9667f1e9c0ff 100644 (file)
@@ -9,6 +9,7 @@ import (
        "path/filepath"
        "regexp"
        "runtime"
+       "strconv"
        "testing"
 )
 
@@ -22,6 +23,23 @@ func checkGdbPython(t *testing.T) {
        if string(out) != "go gdb python support\n" {
                t.Skipf("skipping due to lack of python gdb support: %s", out)
        }
+
+       // Issue 11214 reports various failures with older versions of gdb.
+       out, err = exec.Command("gdb", "--version").CombinedOutput()
+       re := regexp.MustCompile(`([0-9]+)\.([0-9]+)`)
+       matches := re.FindSubmatch(out)
+       if len(matches) < 3 {
+               t.Skipf("skipping: can't determine gdb version from\n%s\n", out)
+       }
+       major, err1 := strconv.Atoi(string(matches[1]))
+       minor, err2 := strconv.Atoi(string(matches[2]))
+       if err1 != nil || err2 != nil {
+               t.Skipf("skipping: can't determine gdb version: %v, %v", err1, err2)
+       }
+       if major < 7 || (major == 7 && minor < 7) {
+               t.Skipf("skipping: gdb version %d.%d too old", major, minor)
+       }
+       t.Logf("gdb version %d.%d", major, minor)
 }
 
 const helloSource = `