Skip to content

Commit 2fe2aa0

Browse files
committed
cmd/compile: avoid compressed dwarf when testing for gdb on OSX
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>
1 parent d278f09 commit 2fe2aa0

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/cmd/compile/internal/ssa/debug_test.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,21 @@ func TestNexting(t *testing.T) {
143143
optFlags += " -l"
144144
}
145145

146-
subTest(t, debugger+"-dbg", "hist", dbgFlags)
147-
subTest(t, debugger+"-dbg", "scopes", dbgFlags)
148-
subTest(t, debugger+"-dbg", "i22558", dbgFlags)
146+
moreargs := []string{}
147+
if !*useDelve && (runtime.GOOS == "darwin" || runtime.GOOS == "windows") {
148+
// gdb and lldb on Darwin do not deal with compressed dwarf.
149+
// also, Windows.
150+
moreargs = append(moreargs, "-ldflags=-compressdwarf=false")
151+
}
152+
153+
subTest(t, debugger+"-dbg", "hist", dbgFlags, moreargs...)
154+
subTest(t, debugger+"-dbg", "scopes", dbgFlags, moreargs...)
155+
subTest(t, debugger+"-dbg", "i22558", dbgFlags, moreargs...)
149156

150-
subTest(t, debugger+"-dbg-race", "i22600", dbgFlags, "-race")
157+
subTest(t, debugger+"-dbg-race", "i22600", dbgFlags, append(moreargs, "-race")...)
151158

152-
optSubTest(t, debugger+"-opt", "hist", optFlags)
153-
optSubTest(t, debugger+"-opt", "scopes", optFlags)
159+
optSubTest(t, debugger+"-opt", "hist", optFlags, moreargs...)
160+
optSubTest(t, debugger+"-opt", "scopes", optFlags, moreargs...)
154161
}
155162

156163
// subTest creates a subtest that compiles basename.go with the specified gcflags and additional compiler arguments,

0 commit comments

Comments
 (0)