This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA/i386] 2 more patterns in i386_analyze_stack_align


Hello,

A coworker and I noticed a problem when we tried gdb-6.4 to debug
some code compiled with GCC 4.1: Some stack alignment code was added
at the start of certain functions. I soon found out that this problem
had been reported under breakpoints/2080 and fixed. However, when
I looked at the fix, I noticed that it was incomplete. According
to my collegue (who worked on the compiler part), the register used
during the stack alignment is either ecx, edx, or eax (in this order
of preference).

So I enhanced the function i386_analyze_stack_align to recognize all
three patterns. I also added testing for these cases in i386-prologue.exp.

2006-12-20  Joel Brobecker  <brobecker@adacore.com>

        * i386-tdep.c (i386_analyze_stack_align): Add handling of two
        other possible code sequences that perform a stack realignment.

2006-12-20  Joel Brobecker  <brobecker@adacore.com>

        * gdb.arch/i386-prologue.c (stack_align_ecx): Renamed from stack_align.
        (stack_align_edx): New function.
        (stack_align_eax): New function.
        (main): Add calls to stack_align_edx and stack_align_eax.
        * gdb.arch/i386-prologue.exp: Replace stack_align with stack_align_ecx.
        Add testing for the cases where the register used during a stack
        realignment is edx. Same for eax.

Fix and testsuite modification tested on x86-linux. No regression.
The new tests fail before my change is applied, and pass after.

OK to apply?

Thanks,
-- 
Joel

Attachment: align.diff
Description: Text document

Attachment: test.align.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]