]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: avoid compressed dwarf when testing for gdb on OSX
authorDavid Chase <drchase@google.com>
Wed, 18 Jul 2018 15:23:56 +0000 (11:23 -0400)
committerDavid Chase <drchase@google.com>
Thu, 19 Jul 2018 13:58:32 +0000 (13:58 +0000)
Until we figure out how to deal with gdb on Darwin (doesn't
read compressed DWARF from binaries), avoid compressing
DWARF in that case so that the test will still yield meaningful
results.

This is also reported to be a problem for Windows.

Problem also exists for lldb, but this test doesn't check
lldb.

Updates #25925

Change-Id: I85c0e5db75f3329957290500626a3ac7f078f608
Reviewed-on: https://go-review.googlesource.com/124712
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/cmd/compile/internal/ssa/debug_test.go

index d0a7a69db9ad789dd6267e3d555c98d549c01bbc..0a409bec2cda3723f12a0c84d817aa2d31c6950d 100644 (file)
@@ -143,14 +143,21 @@ func TestNexting(t *testing.T) {
                optFlags += " -l"
        }
 
-       subTest(t, debugger+"-dbg", "hist", dbgFlags)
-       subTest(t, debugger+"-dbg", "scopes", dbgFlags)
-       subTest(t, debugger+"-dbg", "i22558", dbgFlags)
+       moreargs := []string{}
+       if !*useDelve && (runtime.GOOS == "darwin" || runtime.GOOS == "windows") {
+               // gdb and lldb on Darwin do not deal with compressed dwarf.
+               // also, Windows.
+               moreargs = append(moreargs, "-ldflags=-compressdwarf=false")
+       }
+
+       subTest(t, debugger+"-dbg", "hist", dbgFlags, moreargs...)
+       subTest(t, debugger+"-dbg", "scopes", dbgFlags, moreargs...)
+       subTest(t, debugger+"-dbg", "i22558", dbgFlags, moreargs...)
 
-       subTest(t, debugger+"-dbg-race", "i22600", dbgFlags, "-race")
+       subTest(t, debugger+"-dbg-race", "i22600", dbgFlags, append(moreargs, "-race")...)
 
-       optSubTest(t, debugger+"-opt", "hist", optFlags)
-       optSubTest(t, debugger+"-opt", "scopes", optFlags)
+       optSubTest(t, debugger+"-opt", "hist", optFlags, moreargs...)
+       optSubTest(t, debugger+"-opt", "scopes", optFlags, moreargs...)
 }
 
 // subTest creates a subtest that compiles basename.go with the specified gcflags and additional compiler arguments,