From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13617 invoked by alias); 4 Mar 2003 14:28:02 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13607 invoked from network); 4 Mar 2003 14:28:02 -0000 Received: from unknown (HELO localhost.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 4 Mar 2003 14:28:02 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0D47E2A9C; Tue, 4 Mar 2003 09:28:00 -0500 (EST) Message-ID: <3E64B7EF.50803@redhat.com> Date: Tue, 04 Mar 2003 14:28:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: gdb@sources.redhat.com Subject: Re: HEADS UP: converting the i386 to the new frame unwinding stuff References: <200303021731.h22HVsEl019548@elgar.kettenis.dyndns.org> <3E63A2D5.8010007@redhat.com> <200303032130.h23LUm3g002018@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00078.txt.bz2 > Date: Mon, 03 Mar 2003 13:45:41 -0500 > From: Andrew Cagney > > Mark, > > Per several recent discussions, can you create a branch and commit it to > that. That way I can look at it now (regardless of your intended commit > schedule)? > > Brilliant idea. I still have to comment my code a bit better, but > I'll try to create that branch somehwere at the end of the week. > > I've started writing up the doco and in doing it, I suspect I may have > found an `off by one' error with the unwinder cache. Having a second > implementation using the current code should help sort this out. > > The current state of affairs seems to work quite well for the i386. > The only thing that puzzles me is that apparently my > i386_frame_register_unwind gets called without an initialized cache. > I was under the impression that we'd always unwind the pc first, and > since my i386_frame_pc_unwind initialized the cache, I'd always have > an initialized cache with the other unwind functions. I think you just hit my off-by-one bug. While I've got get_prev_frame() doing the sequence: prev_frame->pc = frame_pc_unwind(next_frame) .. prev_frame->id = frame_id_unwind(next_frame) To determine prev_frame's id, prev_frame's prolog needs to have been analyzed. Contrast that to pc-unwind and register-unwind where the unwound register value is determined by analyzing next_frame's prologue. The off by one is that frame id unwind is being handed the wrong cache :-( (in my defence, I've preserved existing behavour just a bit too well - explains why the d10v was to easy to convert :-/) Andrew