Hi, can anyone tell me why i never see anything in the call stack window (watches), i expect to see the function calls as i debug and step into functions but nothing is shown. can anyone help?
I know that the call stack is used when running a simulation (no read hardware, all in the computer).
I don't think it's used when doing remote target debugging (serially, with the monitor). I don't see how could the monitor get that information efficiently anyway.
That holds true for code coverage and a few other things as well.
An ICE (in circuit emulator) doesn't have those limitations.
$0.02
The debugger should be able to fetch and decode the stack information just the same as a normal PC debugger does it.
As long as the code doesn't have too high optimization, each function call will produce a normal stack frame that the debugger can walk backwards in. Then it is enough to lookup the return addresses to figure out which function the return addresss points to.
Obviously, a debugger normally don't try to touch the stack of a running target - the target changes the stack much too often for it to be worth it.
each function call will produce a normal stack frame that the debugger can walk backwards in.
That's true only as long as the function performs no PUSHes and POPs while running. Those can make it quite a task to find the return address among all that other stuff on the stack.
Which is also a reason why most processors (with support for a "real" stack) has a link or base-pointer register to allow constant access to its auto variables and to its parameters. The situation is definitely bleak for processors that only has a return stack and have to simulate a parameter stack. Then it is up to the compiler to decide if it will simulate such a register - at least for debug builds.