×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    318

    Newbie question: What is the call stack?

    Hi all,

    Question 1.
    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??

    Question 2.
    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?

    Thanks in advance...
    -aDvo-

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    UK
    Posts
    159
    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

    As for naming... it's just a convention.

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    393
    Another important stack in Symbian is the Control Stack to which you add your control so that it can receive key events.

    [N]/Forum Nokia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×