]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: no-op getwd call as test breakpoint
authorDavid Crawshaw <crawshaw@golang.org>
Sat, 28 Feb 2015 22:06:06 +0000 (17:06 -0500)
committerDavid Crawshaw <crawshaw@golang.org>
Sat, 28 Feb 2015 22:44:10 +0000 (22:44 +0000)
This is to be used by an lldb script inside go_darwin_arm_exec to pause
the execution of tests on iOS so the working directory can be adjusted
into something resembling a GOROOT.

Change-Id: I69ea2d4d871800ae56634b23ffa48583559ddbc6
Reviewed-on: https://go-review.googlesource.com/6363
Reviewed-by: Minux Ma <minux@golang.org>
src/runtime/cgo/gcc_darwin_arm.c

index 7bb7f88a86b83e19e990551f778f2ddf1e2a07eb..aa7f43832a3d4794381f44402c81aec64dac6b74 100644 (file)
@@ -123,6 +123,11 @@ init_working_dir()
        if (chdir(dir) != 0) {
                fprintf(stderr, "runtime/cgo: chdir(%s) failed\n", dir);
        }
+
+       // No-op to set a breakpoint on, immediately after the real chdir.
+       // Gives the test harness in go_darwin_arm_exec (which uses lldb) a
+       // chance to move the working directory.
+       getwd(dir);
 }
 
 void