From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11390 invoked by alias); 26 Jan 2006 19:55:38 -0000 Received: (qmail 11382 invoked by uid 22791); 26 Jan 2006 19:55:38 -0000 X-Spam-Check-By: sourceware.org Received: from mail.emacinc.com (HELO mail.emacinc.com) (208.248.202.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jan 2006 19:55:37 +0000 Received: from emac77.emacinc.com ([208.248.202.77] helo=eng011.emacinc.com) by mail.emacinc.com with esmtp (Exim 4.50) id 1F2DDA-00071K-DX; Thu, 26 Jan 2006 13:55:22 -0600 From: NZG To: gdb-patches@sourceware.org Date: Thu, 26 Jan 2006 19:55:00 -0000 User-Agent: KMail/1.8.2 Cc: Daniel Jacobowitz , Jim Blandy References: <200601231438.26040.ngustavson@emacinc.com> <200601261017.41108.ngustavson@emacinc.com> <20060126164315.GA7821@nevyn.them.org> In-Reply-To: <20060126164315.GA7821@nevyn.them.org> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200601261354.12256.ngustavson@emacinc.com> X-SA-Exim-Connect-IP: 208.248.202.77 X-SA-Exim-Mail-From: ngustavson@emacinc.com Subject: frame theory, was pointer madness Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Relay: X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00428.txt.bz2 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. 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. When frame 0 is the highest and lowest real level it will "unwind" frame zero by accessing -1. which should in turn actually read the registers from remote device. Then ->black magic - black magic -> gdb realizes there is no higher level frame and caches a NULL there. Now the magic. NZG