From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10654 invoked by alias); 3 May 2012 19:01:08 -0000 Received: (qmail 10644 invoked by uid 22791); 3 May 2012 19:01:07 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 May 2012 19:00:54 +0000 Received: by qcsd16 with SMTP id d16so1677820qcs.0 for ; Thu, 03 May 2012 12:00:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.183.76 with SMTP id cf12mr5671405qab.74.1336071653424; Thu, 03 May 2012 12:00:53 -0700 (PDT) Received: by 10.229.169.130 with HTTP; Thu, 3 May 2012 12:00:53 -0700 (PDT) In-Reply-To: References: <20120410202953.GA23862@intel.com> <201204171143.q3HBh9LV021759@glazunov.sibelius.xs4all.nl> <201205022143.q42Lhd3G018067@glazunov.sibelius.xs4all.nl> Date: Thu, 03 May 2012 19:01:00 -0000 Message-ID: Subject: Re: PATCH: Also check for `movl %esp, %ebp' for x32 From: "H.J. Lu" To: Mark Kettenis Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00098.txt.bz2 On Wed, May 2, 2012 at 3:14 PM, H.J. Lu wrote: > On Wed, May 2, 2012 at 2:43 PM, Mark Kettenis w= rote: >>> Date: Sun, 29 Apr 2012 11:37:49 -0700 >>> From: "H.J. Lu" >>> >>> On Tue, Apr 24, 2012 at 9:27 AM, H.J. Lu wrote: >>> > On Tue, Apr 17, 2012 at 7:30 AM, H.J. Lu wrote: >>> >> On Tue, Apr 17, 2012 at 4:43 AM, Mark Kettenis wrote: >>> >>>> Date: Tue, 10 Apr 2012 13:29:53 -0700 >>> >>>> From: "H.J. Lu" >>> >>>> >>> >>>> Hi, >>> >>>> >>> >>>> X32 may use `movl %esp, %ebp' in prologue. =A0This patch checks it= for >>> >>>> x32. =A0Tested on Linux/x86-64. =A0OK for trunk? >>> >>> >>> >>> Sorry, but I'm not sure it is a good idea to mix ABIs in the code l= ike >>> >>> that. =A0Up until now, I've made a conscious attempt to keep the i3= 86 >>> >>> and amd64 ABIs seperated out as much as possible. =A0Can 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. =A0This patch checks it for >>> x32. =A0Tested on Linux/x86-64. =A0OK 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? =A0I >> 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. =A0I >> 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. Is my patch OK to install? >> But what about the stack align code that we check for in >> amd64_analyze_stack_align()? =A0Wouldn't that be different for x32 as >> well? > > That is true. =A0I will submit a separate patch for it. > The patch to add x32 support to amd64_analyze_stack_align: http://sourceware.org/ml/gdb-patches/2012-05/msg00097.html Thanks. --=20 H.J.