This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Also check for `movl %esp, %ebp' for x32
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 2 May 2012 15:14:18 -0700
- Subject: Re: PATCH: Also check for `movl %esp, %ebp' for x32
- References: <20120410202953.GA23862@intel.com> <201204171143.q3HBh9LV021759@glazunov.sibelius.xs4all.nl> <CAMe9rOoYnD4vBUobYp7xom=bK2APTBpaqSgdPQYsM0eBJG+Axw@mail.gmail.com> <CAMe9rOpvcXA4_WSTUbWNUK76CdLuZXydzjzh5iUuOvPmzPvSEA@mail.gmail.com> <CAMe9rOqmjGGqDzF+FZh292S72tyJk_Bw0GWpmrr4YHqCBu=YVw@mail.gmail.com> <201205022143.q42Lhd3G018067@glazunov.sibelius.xs4all.nl>
On Wed, May 2, 2012 at 2:43 PM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> Date: Sun, 29 Apr 2012 11:37:49 -0700
>> From: "H.J. Lu" <hjl.tools@gmail.com>
>>
>> On Tue, Apr 24, 2012 at 9:27 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> > On Tue, Apr 17, 2012 at 7:30 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> >> On Tue, Apr 17, 2012 at 4:43 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> >>>> Date: Tue, 10 Apr 2012 13:29:53 -0700
>> >>>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>> >>>>
>> >>>> Hi,
>> >>>>
>> >>>> X32 may use `movl %esp, %ebp' in prologue. ?This patch checks it for
>> >>>> x32. ?Tested on Linux/x86-64. ?OK for trunk?
>> >>>
>> >>> Sorry, but I'm not sure it is a good idea to mix ABIs in the code like
>> >>> that. ?Up until now, I've made a conscious attempt to keep the i386
>> >>> and amd64 ABIs seperated out as much as possible. ?Can you post a
>> >>> complete diff of the -tdep.c related changes to support x32 in GDB,
>> >>> such that I can judge where this is heading?
>> >>
>> >> Here is the complete x32 GDB patch:
>> >>
>> >> http://sourceware.org/ml/gdb-patches/2012-04/msg00476.html
>> >>
>> >
>> > Hi Mark,
>> >
>> > Have you looked at my change?
>> >
>> > Thanks.
>>
>> Ping.
>
> Sorry; been travelling too much lately...
>
> I did have a look at it, but still have some questions.
>
>> Hi,
>>
>> X32 may use `movl %esp, %ebp' in prologue. ?This patch checks it for
>> x32. ?Tested on Linux/x86-64. ?OK for trunk?
>
> But the prologues generated by various compilers are expected to be
> otherwise the same for both the x32 ABI and the normal 64-bit ABI? ?I
> guess x32 has to use "pushq %rbp" as "pushl %ebp" isn't available.
> And I guess you want to keep the stack 16-byte aligned anyway. ?I
> suppose that "movq %rsp, %rbp" is still ok for x32, but "movl %esp,
> %ebp" can be encoded in less bytes, so it might be a bit more
> efficient for x32.
That is correct.
> But what about the stack align code that we check for in
> amd64_analyze_stack_align()? ?Wouldn't that be different for x32 as
> well?
That is true. I will submit a separate patch for it.
Thanks.
--
H.J.