}
func TestCgoCCodeSIGPROF(t *testing.T) {
+ if runtime.GOOS == "aix" {
+ t.Skip("pprof not yet available on AIX (see golang.org/issue/28555)")
+ }
t.Parallel()
got := runTestProg(t, "testprogcgo", "CgoCCodeSIGPROF")
want := "OK\n"
testenv.MustHaveGoRun(t)
testenv.MustHaveCGO(t)
+ if runtime.GOOS == "aix" {
+ t.Skip("pprof not yet available on AIX (see golang.org/issue/28555)")
+ }
+
prog := "./testdata/mappingtest/main.go"
// GoOnly includes only Go symbols that runtime will symbolize.
BL runtime·load_g(SB)
+ CMP $0, g
+ BEQ sigtrampnog // g == nil
+
// Save m->libcall. We need to do this because we
// might get interrupted by a signal in runtime·asmcgocall.
MOVD 120(R1), R8
MOVD R8, 0(R7)
+exit:
// restore registers
MOVD 56(R1),R31
MOVD 64(R1),g
MOVD R0, LR
BR (LR)
+sigtrampnog:
+ // Signal arrived on a non-Go thread.
+ // SIGPROF handler is not yet available so simply call badsignal,
+ // after having created *sigctxt.
+ MOVD R4, 80(R1)
+ MOVD R5, 88(R1)
+ MOVD R1, R4
+ ADD $80, R4
+ MOVD R4, FIXED_FRAME+8(R1)
+ MOVD R3, FIXED_FRAME+0(R1)
+ BL runtime·badsignal(SB)
+ JMP exit
+
// runtime.tstart is a function descriptor to the real tstart.
DATA runtime·tstart+0(SB)/8, $runtime·_tstart(SB)
DATA runtime·tstart+8(SB)/8, $TOC(SB)