frame theory, was pointer madness

Daniel Jacobowitz drow@false.org
Thu Jan 26 19:59:00 GMT 2006


On Thu, Jan 26, 2006 at 01:54:12PM -0600, NZG wrote:
> Lets see if I have this right.
> Assuming a linked list with 5 frames, they should look like this
> 
> level	description
> -1		sentinal frame(virtual)
> 0		youngest frame (the deepest function call and current frame)
> 1		older
> 2		even older
> 3		oldest
> 
> And the list should look like this
> 
> prev->frame->next
> 
> NULL->3->2->1->0->-1->-1->-1........
> 
> I think, and I have yet to successfully verify this, that the highest level 
> frame should have an id of zero, or at least should.

It's important to use consistent terminology when talking about this.
What do you mean by "highest"?

The innermost frame is always #0; it is the first frame "unwound"
from the sentinel frame.  Then the next frame is unwound from frame 0.

The outermost frame should have an invalid frame ID.

> Normal gdb appears to work by caching the frame of the highest level to a NULL 
> prev value, which appears to be happening somewhere when the frame first 
> enters existance. In the case of a gdbremote connection this should be on 
> connection to the remote server.

No, not until someone types "backtrace".

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list