This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Frame lost after 'leave' and before 'ret' instruction on i386?
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: aristovski at qnx dot com
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 5 Jun 2008 22:12:00 +0200 (CEST)
- 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> <g264bk$5bo$1@ger.gmane.org>
> From: Aleksandar Ristovski <aristovski@qnx.com>
> 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.
> >
>
>
>