This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Update x86 stack align analyzer
> Date: Sat, 9 Aug 2008 07:51:47 -0700
> From: "H.J. Lu" <hjl.tools@gmail.com>
>
> On Sat, Aug 09, 2008 at 02:02:39PM +0200, Mark Kettenis wrote:
> > I feel, rather strongly, that the stack align stuff stuff should only
> > deal with stack alignment done *before* a frame gets setup. I think
> > setting saved_sp_reg to -1, and proceeding as usual if it is still set
> > at that value after the stack alignment analysis, works just fine. I
> > also noticed a problem with your diff in that it doesn't use the
> > proper saved sp value if you do have a frame (not sure GCC actually
> > generates such code).
> >
> > How about the attached diff? Does it work with GCC 4.4?
> >
> >
>
> Yes, it works. OK to install?
Sure, but can you change the ChangeLog to use kettenis@gnu.org as my
mail-address?
> 2008-08-09 Xuepeng Guo <xuepeng.guo@intel.com>
> H.J. Lu <hongjiu.lu@intel.com>
> Mark Kettenis <mark.kettenis@xs4all.nl>
>
> * amd64-tdep.c (amd64_frame_cache): Add saved_sp_reg.
> (amd64_init_frame_cache): Initialize saved_sp_reg.
> (amd64_analyze_stack_align): New.
> (amd64_analyze_prologue): Call it.
> (amd64_frame_cache): Use saved_sp_reg if it is invalid. Don't set
> %rip to 8 when halfway aligning the stack.
>
> * amd64-tdep.h (amd64_regnum): Add AMD64_R9_REGNUM to
> AMD64_R14_REGNUM.
>
> * i386-tdep.c (i386_frame_cache): Remove stack_align. Add
> saved_sp_reg.
> (i386_alloc_frame_cache): Remove stack_align. Initialize
> saved_sp_reg to -1.
> (i386_analyze_stack_align): Rewrite.
> (i386_frame_cache): Use saved_sp_reg if it is valid.