From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29541 invoked by alias); 27 Jun 2009 21:12:03 -0000 Received: (qmail 29533 invoked by uid 22791); 27 Jun 2009 21:12:02 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 27 Jun 2009 21:11:55 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 87C1510631; Sat, 27 Jun 2009 21:11:53 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 36C22104B5; Sat, 27 Jun 2009 21:11:52 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MKfBf-00019k-C3; Sat, 27 Jun 2009 17:11:51 -0400 Date: Sat, 27 Jun 2009 21:12:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: Pedro Alves , "gdb-patches@sourceware.org" , Hui Zhu Subject: Re: [RFA] Patch to fix reverse return from subroutine error Message-ID: <20090627211150.GA27691@caradoc.them.org> Mail-Followup-To: Michael Snyder , Pedro Alves , "gdb-patches@sourceware.org" , Hui Zhu References: <4A466BAE.2010305@vmware.com> <200906272049.36692.pedro@codesourcery.com> <4A4687B2.2060907@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A4687B2.2060907@vmware.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00775.txt.bz2 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. -- Daniel Jacobowitz CodeSourcery