I know what the generic stack is, but can anyone describe to me what the call stack is or a general description of how it works??
The pdf file named "Coding idioms for Symbian OS" says:
"Rule 1: All functions that can leave should have an ‘L’ on the end of their name. Leaves propagate back up the call stack though functions named with ‘L’ until they are caught by a trap harness, which is normally provided by your thread’s Active Scheduler."
I'm not really sure what this means because i can't picture it =(. I'm not sure how something can propagate tru a stack?
Is the 'L' at the end of the name necessary for the compiler to recognize it? or is it just for clarity?
1- The Call Stack
The call stack - it's not a different entity to the stack. Methods use the stack to store return address information so that when a method has completed the CPU knows what to execute next.
It's this information (along with some debug info) that allows IDEs to present a 'call stack' window while debugging, so when you breakpoint you can see the stack of methods that got you to your current position.
So when asked to think about the call stack, think about the call stack as it appears in your IDE.
2 - Leave
When epoc32 was created the GCC C++ compiler didn't support exceptions, so they created their own similiar system. So where regular C++ programs would throw, an epoc32 program leaves.
When a method leaves the system searches up the call stack (cleaning up the cleanup stack - which is a different entity to the thread stack) until it finds a TRAP, in a similiar way that C++ exceptions searches the call stack looking for a catch