mirror of
https://github.com/golang/go
synced 2024-11-06 07:26:10 -07:00
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 <heschi@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
17a4e0475d
commit
c99300229d
@ -10,6 +10,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -82,8 +83,12 @@ target = debugger.CreateTargetWithFileAndArch("a.exe", None)
|
|||||||
if target:
|
if target:
|
||||||
print "Created target"
|
print "Created target"
|
||||||
main_bp = target.BreakpointCreateByLocation("main.go", 10)
|
main_bp = target.BreakpointCreateByLocation("main.go", 10)
|
||||||
if main_bp:
|
if main_bp.GetNumLocations() != 0:
|
||||||
print "Created breakpoint"
|
print "Created breakpoint"
|
||||||
|
else:
|
||||||
|
# This happens if lldb can't read the program's DWARF. See https://golang.org/issue/25925.
|
||||||
|
print "SKIP: no matching locations for breakpoint"
|
||||||
|
exit(1)
|
||||||
process = target.LaunchSimple(None, None, os.getcwd())
|
process = target.LaunchSimple(None, None, os.getcwd())
|
||||||
if process:
|
if process:
|
||||||
print "Process launched"
|
print "Process launched"
|
||||||
@ -98,7 +103,7 @@ if target:
|
|||||||
if state in [lldb.eStateUnloaded, lldb.eStateLaunching, lldb.eStateRunning]:
|
if state in [lldb.eStateUnloaded, lldb.eStateLaunching, lldb.eStateRunning]:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
print "Timeout launching"
|
print "SKIP: Timeout launching"
|
||||||
break
|
break
|
||||||
if state == lldb.eStateStopped:
|
if state == lldb.eStateStopped:
|
||||||
for t in process.threads:
|
for t in process.threads:
|
||||||
@ -172,8 +177,9 @@ func TestLldbPython(t *testing.T) {
|
|||||||
got, _ := cmd.CombinedOutput()
|
got, _ := cmd.CombinedOutput()
|
||||||
|
|
||||||
if string(got) != expectedLldbOutput {
|
if string(got) != expectedLldbOutput {
|
||||||
if strings.Contains(string(got), "Timeout launching") {
|
skipReason := regexp.MustCompile("SKIP: .*\n").Find(got)
|
||||||
t.Skip("Timeout launching")
|
if skipReason != nil {
|
||||||
|
t.Skip(string(skipReason))
|
||||||
}
|
}
|
||||||
t.Fatalf("Unexpected lldb output:\n%s", got)
|
t.Fatalf("Unexpected lldb output:\n%s", got)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user