Commit fec40bd1 authored by Elias Naur's avatar Elias Naur

Revert "cmd/go, misc: switch from breakpoint to SIGUSR2"

This reverts commit 333f764d.

Replaced by a improved strategy later in the CL relation chain.

Change-Id: I70a1d2f0aa5aa0d3d0ec85b5a956c6fb60d88908
Reviewed-on: https://go-review.googlesource.com/36069
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
parent 03e2a4d1
...@@ -107,7 +107,7 @@ func main() { ...@@ -107,7 +107,7 @@ func main() {
// Approximately 1 in a 100 binaries fail to start. If it happens, // Approximately 1 in a 100 binaries fail to start. If it happens,
// try again. These failures happen for several reasons beyond // try again. These failures happen for several reasons beyond
// our control, but all of them are safe to retry as they happen // our control, but all of them are safe to retry as they happen
// before lldb encounters the initial SIGUSR2 stop. As we // before lldb encounters the initial getwd breakpoint. As we
// know the tests haven't started, we are not hiding flaky tests // know the tests haven't started, we are not hiding flaky tests
// with this retry. // with this retry.
for i := 0; i < 5; i++ { for i := 0; i < 5; i++ {
...@@ -232,7 +232,6 @@ func run(bin string, args []string) (err error) { ...@@ -232,7 +232,6 @@ func run(bin string, args []string) (err error) {
s.do(`process handle SIGHUP --stop false --pass true --notify false`) s.do(`process handle SIGHUP --stop false --pass true --notify false`)
s.do(`process handle SIGPIPE --stop false --pass true --notify false`) s.do(`process handle SIGPIPE --stop false --pass true --notify false`)
s.do(`process handle SIGUSR1 --stop false --pass true --notify false`) s.do(`process handle SIGUSR1 --stop false --pass true --notify false`)
s.do(`process handle SIGUSR2 --stop true --pass false --notify true`) // sent by test harness
s.do(`process handle SIGCONT --stop false --pass true --notify false`) s.do(`process handle SIGCONT --stop false --pass true --notify false`)
s.do(`process handle SIGSEGV --stop false --pass true --notify false`) // does not work s.do(`process handle SIGSEGV --stop false --pass true --notify false`) // does not work
s.do(`process handle SIGBUS --stop false --pass true --notify false`) // does not work s.do(`process handle SIGBUS --stop false --pass true --notify false`) // does not work
...@@ -245,9 +244,11 @@ func run(bin string, args []string) (err error) { ...@@ -245,9 +244,11 @@ func run(bin string, args []string) (err error) {
return nil return nil
} }
s.do(`breakpoint set -n getwd`) // in runtime/cgo/gcc_darwin_arm.go
started = true started = true
s.doCmd("run", "stop reason = signal SIGUSR2", 20*time.Second) s.doCmd("run", "stop reason = breakpoint", 20*time.Second)
// Move the current working directory into the faux gopath. // Move the current working directory into the faux gopath.
if pkgpath != "src" { if pkgpath != "src" {
......
...@@ -907,13 +907,9 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin ...@@ -907,13 +907,9 @@ func builderTest(b *work.Builder, p *load.Package) (buildAction, runAction, prin
if cfg.BuildContext.GOOS == "darwin" { if cfg.BuildContext.GOOS == "darwin" {
if cfg.BuildContext.GOARCH == "arm" || cfg.BuildContext.GOARCH == "arm64" { if cfg.BuildContext.GOARCH == "arm" || cfg.BuildContext.GOARCH == "arm64" {
t.IsIOS = true t.NeedCgo = true
t.NeedOS = true
} }
} }
if t.TestMain == nil {
t.NeedOS = true
}
for _, cp := range pmain.Internal.Imports { for _, cp := range pmain.Internal.Imports {
if len(cp.Internal.CoverVars) > 0 { if len(cp.Internal.CoverVars) > 0 {
...@@ -1360,8 +1356,7 @@ type testFuncs struct { ...@@ -1360,8 +1356,7 @@ type testFuncs struct {
NeedTest bool NeedTest bool
ImportXtest bool ImportXtest bool
NeedXtest bool NeedXtest bool
NeedOS bool NeedCgo bool
IsIOS bool
Cover []coverInfo Cover []coverInfo
} }
...@@ -1475,7 +1470,7 @@ var testmainTmpl = template.Must(template.New("main").Parse(` ...@@ -1475,7 +1470,7 @@ var testmainTmpl = template.Must(template.New("main").Parse(`
package main package main
import ( import (
{{if .NeedOS}} {{if not .TestMain}}
"os" "os"
{{end}} {{end}}
"testing" "testing"
...@@ -1491,10 +1486,8 @@ import ( ...@@ -1491,10 +1486,8 @@ import (
_cover{{$i}} {{$p.Package.ImportPath | printf "%q"}} _cover{{$i}} {{$p.Package.ImportPath | printf "%q"}}
{{end}} {{end}}
{{if .IsIOS}} {{if .NeedCgo}}
"os/signal"
_ "runtime/cgo" _ "runtime/cgo"
"syscall"
{{end}} {{end}}
) )
...@@ -1560,12 +1553,6 @@ func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts ...@@ -1560,12 +1553,6 @@ func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts
{{end}} {{end}}
func main() { func main() {
{{if .IsIOS}}
signal.Notify(make(chan os.Signal), syscall.SIGUSR2)
syscall.Kill(0, syscall.SIGUSR2)
signal.Reset(syscall.SIGUSR2)
{{end}}
{{if .CoverEnabled}} {{if .CoverEnabled}}
testing.RegisterCover(testing.Cover{ testing.RegisterCover(testing.Cover{
Mode: {{printf "%q" .CoverMode}}, Mode: {{printf "%q" .CoverMode}},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment