aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata/testprogcgo/tracebackctxt_c.c
diff options
context:
space:
mode:
authorGerrit Code Review <noreply-gerritcodereview@google.com>2021-08-12 20:22:27 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-08-12 20:22:27 +0000
commit4d3cc84774549d26e52cbba3a0ffc50d3ede80d5 (patch)
treede3466e3b835e2c18fa03548ddf0619f5555575b /src/runtime/testdata/testprogcgo/tracebackctxt_c.c
parent7e9f911ec4fd08ce9b4296f0aea4864b53064573 (diff)
parenta64ab8d3ecb38e10007e136edc9dc3abde873e1e (diff)
downloadgo-4d3cc84774549d26e52cbba3a0ffc50d3ede80d5.tar.gz
go-4d3cc84774549d26e52cbba3a0ffc50d3ede80d5.zip
Merge "[dev.typeparams] all: merge master (46fd547) into dev.typeparams" into dev.typeparamsdev.typeparams
Diffstat (limited to 'src/runtime/testdata/testprogcgo/tracebackctxt_c.c')
-rw-r--r--src/runtime/testdata/testprogcgo/tracebackctxt_c.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/runtime/testdata/testprogcgo/tracebackctxt_c.c b/src/runtime/testdata/testprogcgo/tracebackctxt_c.c
index 900cada0d3..910cb7b899 100644
--- a/src/runtime/testdata/testprogcgo/tracebackctxt_c.c
+++ b/src/runtime/testdata/testprogcgo/tracebackctxt_c.c
@@ -11,6 +11,7 @@
// Functions exported from Go.
extern void G1(void);
extern void G2(void);
+extern void TracebackContextPreemptionGoFunction(int);
void C1() {
G1();
@@ -62,10 +63,17 @@ void tcContext(void* parg) {
}
}
+void tcContextSimple(void* parg) {
+ struct cgoContextArg* arg = (struct cgoContextArg*)(parg);
+ if (arg->context == 0) {
+ arg->context = 1;
+ }
+}
+
void tcTraceback(void* parg) {
int base, i;
struct cgoTracebackArg* arg = (struct cgoTracebackArg*)(parg);
- if (arg->context == 0) {
+ if (arg->context == 0 && arg->sigContext == 0) {
// This shouldn't happen in this program.
abort();
}
@@ -89,3 +97,7 @@ void tcSymbolizer(void *parg) {
arg->func = "cFunction";
arg->lineno = arg->pc + (arg->more << 16);
}
+
+void TracebackContextPreemptionCallGo(int i) {
+ TracebackContextPreemptionGoFunction(i);
+}