Skip to content

Commit c993002

Browse files
committed
runtime: fix lldb test after DWARF compression
Most (all?) released versions of lldb don't support compressed DWARF. For now, skip the test if lldb can't find where to put the breakpoint. This is the best I could think of -- there is no explicit error that I can find that indicates it couldn't load the DWARF. Fixes #25925. Change-Id: Ib8fa486a04940cee5959ba7aab7bdbbaa3b2974e Reviewed-on: https://go-review.googlesource.com/119535 Run-TryBot: Heschi Kreinick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Austin Clements <[email protected]>
1 parent 17a4e04 commit c993002

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/runtime/runtime-lldb_test.go

+10-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os"
1111
"os/exec"
1212
"path/filepath"
13+
"regexp"
1314
"runtime"
1415
"strings"
1516
"testing"
@@ -82,8 +83,12 @@ target = debugger.CreateTargetWithFileAndArch("a.exe", None)
8283
if target:
8384
print "Created target"
8485
main_bp = target.BreakpointCreateByLocation("main.go", 10)
85-
if main_bp:
86+
if main_bp.GetNumLocations() != 0:
8687
print "Created breakpoint"
88+
else:
89+
# This happens if lldb can't read the program's DWARF. See https://golang.org/issue/25925.
90+
print "SKIP: no matching locations for breakpoint"
91+
exit(1)
8792
process = target.LaunchSimple(None, None, os.getcwd())
8893
if process:
8994
print "Process launched"
@@ -98,7 +103,7 @@ if target:
98103
if state in [lldb.eStateUnloaded, lldb.eStateLaunching, lldb.eStateRunning]:
99104
continue
100105
else:
101-
print "Timeout launching"
106+
print "SKIP: Timeout launching"
102107
break
103108
if state == lldb.eStateStopped:
104109
for t in process.threads:
@@ -172,8 +177,9 @@ func TestLldbPython(t *testing.T) {
172177
got, _ := cmd.CombinedOutput()
173178

174179
if string(got) != expectedLldbOutput {
175-
if strings.Contains(string(got), "Timeout launching") {
176-
t.Skip("Timeout launching")
180+
skipReason := regexp.MustCompile("SKIP: .*\n").Find(got)
181+
if skipReason != nil {
182+
t.Skip(string(skipReason))
177183
}
178184
t.Fatalf("Unexpected lldb output:\n%s", got)
179185
}

0 commit comments

Comments
 (0)