From 3cec42574e444b7f91e2d887527bea45348ffb79 Mon Sep 17 00:00:00 2001 From: Srikar Dronamraju Date: Tue, 28 Oct 2008 16:13:01 -0400 Subject: PR5274: uretprobe vs. longjmp support --- testsuite/systemtap.base/bz5274.c | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 testsuite/systemtap.base/bz5274.c (limited to 'testsuite/systemtap.base/bz5274.c') diff --git a/testsuite/systemtap.base/bz5274.c b/testsuite/systemtap.base/bz5274.c new file mode 100644 index 00000000..4e4cfb16 --- /dev/null +++ b/testsuite/systemtap.base/bz5274.c @@ -0,0 +1,44 @@ +#include +#include +#include + +void funcd(int i, jmp_buf env) +{ + printf("In %s: %s :%d : i=%d. Calling longjmp\n", "bz5274.c",__func__,__LINE__,i); + longjmp(env, i); +} + +void funcc(int i, jmp_buf env) +{ + printf("In %s: %s :%d : i=%d. Calling funcd\n", "bz5274.c",__func__,__LINE__,i); + funcd(i,env); +} + + +void funcb(int i, jmp_buf env) +{ + printf("In %s: %s :%d : i=%d. Calling funcc\n", "bz5274.c",__func__,__LINE__,i); + funcc(i,env); +} + + +void funca(char *s, jmp_buf env) +{ + int i; + + i = setjmp(env); + if (i == 4) + return; + funcb(++i, env); + return; +} + + + +int main(int argc, char **argv) +{ + jmp_buf env; + + funca("Hello World", env); + exit(0); +} -- cgit