This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Understanding GDB frames
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Maxim Grigoriev <maxim at tensilica dot com>
- Cc: gdb at sourceware dot org, Marc Gauthier <marc at tensilica dot com>, Pete MacLiesh <pmac at tensilica dot com>, Ross Morley <ross at tensilica dot com>
- Date: Mon, 21 May 2007 18:40:44 -0700
- Subject: Re: Understanding GDB frames
- References: <46521C04.7040405@hq.tensilica.com>
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