From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7396 invoked by alias); 28 Jun 2009 18:46:34 -0000 Received: (qmail 7386 invoked by uid 22791); 28 Jun 2009 18:46:34 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 28 Jun 2009 18:46:28 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 08FF956001; Sun, 28 Jun 2009 11:46:26 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost4.vmware.com (Postfix) with ESMTP id EEC77C9CF2; Sun, 28 Jun 2009 11:46:25 -0700 (PDT) Message-ID: <4A47BA15.6020004@vmware.com> Date: Sun, 28 Jun 2009 18:46:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Michael Snyder , Pedro Alves , "gdb-patches@sourceware.org" , Hui Zhu Subject: Re: [RFA] Patch to fix reverse return from subroutine error References: <4A466BAE.2010305@vmware.com> <200906272049.36692.pedro@codesourcery.com> <4A4687B2.2060907@vmware.com> <20090627211150.GA27691@caradoc.them.org> In-Reply-To: <20090627211150.GA27691@caradoc.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00790.txt.bz2 Daniel Jacobowitz wrote: > On Sat, Jun 27, 2009 at 01:57:22PM -0700, Michael Snyder wrote: >> The problem is that the second "frame_id_eq" test fails in >> the case where we've just stepped backward to the RET instruction >> of a function which, in forward-time, had just returned. >> >> It's possible that what we're trying to do here is work around a >> bug in the i386 implementation of frame_unwind_id. When I look at >> the frame_id that it returns at this point, it does not match either >> the caller or the callee, and its code_addr is particularly wrong. > > I wrote about this problem in my GCC summit paper. All released > versions of GCC generate unwind info that is wrong in epilogues. > I believe it's fixed in trunk GCC, although maybe for specific > platforms only. > > In order to get this to work for my demo I had an epilogue-specific > unwinder for ARM. It detected common epilogue sequences and analyzed > them to find the frame ID, and was installed at higher priority than > the DWARF unwinder. > > I think you're going to need the same thing here, or else use the > existing gdbarch epilogue hook somehow. Great, I looked up your paper, and found it helpful. Are your gdb patches available online? Any head start would be a boon... Michael