I have an assignment to write a fuction that returns the stack frame in c99. I have look at some libarys on how they did it such as https://github.com/Nanolat/c-callstack. However, i am not explicitly allowed to use a libary.
I also found this similar question on Stackoverflow, How to access multiple instances of stack frame in C however this is mostly left unanswerd and i did not find much help from it. If i have over looked another place on stackoverflow with this answer then please do link it.
EDIT: just to clarify i need the call stack
I tried this method
void view_stack_frame(void){
printf("%s from (%s:%d)\n", __FUNCTION__, __FILE__, __LINE__);
}
This returns
view_stack_frame from (main.c:423)
which is partialy what i need it to do. However, i can not think of a way to display the full stack and not just this part of the stack.