Skip to content

Commit e6d5233

Browse files
committed
misc/ios: adjust exec script for iOS 8.3
We no longer need the EXC_BAD_ACCESS watcher as runtime/cgo contains a mach exception handler that catches it. And now lldb only intermittently reports process connection and exiting, so instead just look for the PASS from Go. Change-Id: I403266558f5a900e0b87ec1019d9baec88148d23 Reviewed-on: https://go-review.googlesource.com/8957 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
1 parent 5cc8561 commit e6d5233

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

misc/ios/go_darwin_arm_exec.go

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func run(bin string, args []string) (err error) {
257257
}
258258

259259
// Wait for installation and connection.
260-
if err := waitFor("ios-deploy before run", "(lldb) connect\r\nProcess 0 connected\r\n", 0); err != nil {
260+
if err := waitFor("ios-deploy before run", "(lldb)", 0); err != nil {
261261
// Retry if we see a rare and longstanding ios-deploy bug.
262262
// https://github.com/phonegap/ios-deploy/issues/11
263263
// Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.debugserver"), &gdbfd, NULL) == 0)
@@ -313,20 +313,6 @@ func run(bin string, args []string) (err error) {
313313
do(`call (void)chdir($mem)`)
314314
}
315315

316-
// Watch for SIGSEGV. Ideally lldb would never break on SIGSEGV.
317-
// http://golang.org/issue/10043
318-
go func() {
319-
<-w.find("stop reason = EXC_BAD_ACCESS", 0)
320-
// cannot use do here, as the defer/recover is not available
321-
// on this goroutine.
322-
fmt.Fprintln(lldb, `bt`)
323-
waitFor("finish backtrace", "(lldb)", 0)
324-
w.printBuf()
325-
if p := cmd.Process; p != nil {
326-
p.Kill()
327-
}
328-
}()
329-
330316
// Run the tests.
331317
w.trimSuffix("(lldb) ")
332318
fmt.Fprintln(lldb, `process continue`)
@@ -339,6 +325,13 @@ func run(bin string, args []string) (err error) {
339325
p.Kill()
340326
}
341327
return errors.New("timeout running tests")
328+
case <-w.find("\nPASS", 0):
329+
passed := w.isPass()
330+
w.printBuf()
331+
if passed {
332+
return nil
333+
}
334+
return errors.New("test failure")
342335
case err := <-exited:
343336
// The returned lldb error code is usually non-zero.
344337
// We check for test success by scanning for the final
@@ -371,6 +364,12 @@ func (w *bufWriter) Write(in []byte) (n int, err error) {
371364
n = len(in)
372365
in = bytes.TrimSuffix(in, w.suffix)
373366

367+
if debug {
368+
inTxt := strings.Replace(string(in), "\n", "\\n", -1)
369+
findTxt := strings.Replace(string(w.findTxt), "\n", "\\n", -1)
370+
fmt.Printf("debug --> %s <-- debug (findTxt='%s')\n", inTxt, findTxt)
371+
}
372+
374373
w.buf = append(w.buf, in...)
375374

376375
if len(w.findTxt) > 0 {
@@ -404,9 +403,6 @@ func (w *bufWriter) printBuf() {
404403
func (w *bufWriter) clearTo(i int) {
405404
w.mu.Lock()
406405
defer w.mu.Unlock()
407-
if debug {
408-
fmt.Fprintf(os.Stderr, "--- go_darwin_arm_exec clear ---\n%s\n--- go_darwin_arm_exec clear ---\n", w.buf[:i])
409-
}
410406
w.buf = w.buf[i:]
411407
}
412408

0 commit comments

Comments
 (0)