Re: Understanding GDB frames

Joel Brobecker
2007-05-22T01:40:29Z

If my understanding of the frame code is correct, then the only
thing that is really guaranteed is that the frame ID remains
constant throughout the lifetime of its associated frame, or
function call. The rest is implementation-dependent.

In practice, I think most targets implement the frame ID as a tuple
that contains one stack address (usually the address on the stack
of the function frame), and one code address (usually the address
of the first instruction for that function). So two consecutive
calls to the same function from the same caller would usually
result in the same frame ID being computed for these two calls.
But this is not guaranteed, for instance if the compiler elected
to adjust the stack for whatever reason between the two function
calls.

IA64 is slighly more complicated, because it also has to take
into account the fact that it has a register stack. So the frame
ID tuple also includes a non-zero "special addr".

Hope this helps. Others will correct me if I'm wrong.

--
Joel