From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29647 invoked by alias); 5 Jun 2008 20:12:35 -0000 Received: (qmail 29631 invoked by uid 22791); 5 Jun 2008 20:12:34 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 05 Jun 2008 20:12:09 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m55KC0oY018110; Thu, 5 Jun 2008 22:12:01 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m55KC0hi014388; Thu, 5 Jun 2008 22:12:00 +0200 (CEST) Date: Thu, 05 Jun 2008 20:12:00 -0000 Message-Id: <200806052012.m55KC0hi014388@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: aristovski@qnx.com CC: gdb@sources.redhat.com In-reply-to: (message from Aleksandar Ristovski on Wed, 04 Jun 2008 09:12:20 -0400) Subject: Re: Frame lost after 'leave' and before 'ret' instruction on i386? References: <482DA814.7030703@qnx.com> <20080516155828.GA31038@caradoc.them.org> <48358355.7050500@qnx.com> <20080522143936.GA32221@caradoc.them.org> <48358860.5010703@qnx.com> <1211479573.3601.84.camel@localhost.localdomain> <4836E0A7.8050800@qnx.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00034.txt.bz2 > From: Aleksandar Ristovski > Date: Wed, 04 Jun 2008 09:12:20 -0400 > > Any comments on this? Isn't it possible to do this by adding a "normal" unwinder? It should be properly stacked such that it is checked before the dwarf unwinder of course. You can check the frame level to short-circuit things the same way as your diff does. Adding a hook in the sentinel frame stuff feels wrong... > Aleksandar Ristovski wrote: > > Hello, > > The patch is an attempt to solve the issue from the subject. It > > introduces a check for in_function_epilogue_p and introduces > > architecture level prev_register_from_epilogue. > > > > The patch is a draft (works but is not complete). > > Rationale: Dealing with epilogue in frame unwinders needs to be done > > only in sentinel frame (older frames will never be in epilogue). > > Comments appreciated. > > > > > > Thanks, > > > > Aleksandar Ristovski > > QNX Software Systems > > > > > > ChangeLog (for reference only): > > > > * gdbarch.c, gdbarch.h: Regenerated. > > * gdbarch.sh: Introduce gdbarch_prev_frame_from_epilogue and provide > > default_prev_frame_from_epilogue. > > * i386-tdep.c (i386_in_function_epilogue_p, > > i386_prev_register_from_epilogue): New functions. > > (struct frame_unwind_cache): Struct definition. > > (i386_gdbarch_init): Register i386_prev_register_from_epilogue and > > i386_in_function_epilogue_p. > > * sentinel-frame.c (sentinel_frame_prev_register): Check if we are > > in epilogue and if so, call gdbarch provided prev_frame_from_epilogue. > > If this returns NULL do as before. > > > > >