This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-variable-monitor/testcase/userstack.c
2023-11-21 04:43:30 -05:00

35 lines
659 B
C

#include <stdio.h>
#include <unistd.h>
void customFunction1(int n);
void customFunction2(int n);
void customFunction3(int n);
void customFunction1(int n) {
if(n <= 0) {
printf("End of recursion\n");
while (1) {
// sleep(1);
} // never return, keep stack
return;
} else {
printf("Calling customFunction2\n");
customFunction2(n-1);
}
}
void customFunction2(int n) {
printf("Calling customFunction3\n");
customFunction3(n);
}
void customFunction3(int n) {
printf("Calling customFunction1\n");
customFunction1(n);
}
int main() {
customFunction1(10);
return 0;
}