From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8482 invoked by alias); 6 May 2012 20:42:55 -0000 Received: (qmail 8473 invoked by uid 22791); 6 May 2012 20:42:54 -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; Sun, 06 May 2012 20:42:39 +0000 Received: by qcsd16 with SMTP id d16so3294949qcs.0 for ; Sun, 06 May 2012 13:42:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.137.18 with SMTP id u18mr6526424qct.87.1336336959157; Sun, 06 May 2012 13:42:39 -0700 (PDT) Received: by 10.229.169.130 with HTTP; Sun, 6 May 2012 13:42:39 -0700 (PDT) In-Reply-To: <201205062031.q46KV8RE000784@glazunov.sibelius.xs4all.nl> References: <20120410202953.GA23862@intel.com> <201204171143.q3HBh9LV021759@glazunov.sibelius.xs4all.nl> <201205022143.q42Lhd3G018067@glazunov.sibelius.xs4all.nl> <201205032150.q43Lo33g014219@glazunov.sibelius.xs4all.nl> <201205062031.q46KV8RE000784@glazunov.sibelius.xs4all.nl> Date: Sun, 06 May 2012 20:42: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/msg00168.txt.bz2 On Sun, May 6, 2012 at 1:31 PM, Mark Kettenis wro= te: >> Date: Thu, 3 May 2012 23:50:03 +0200 (CEST) >> From: Mark Kettenis >> >> > >> 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? >> >> Sorry, no. =A0I'm really unhappy with that multi-line if clause. =A0It >> really is hard to parse. =A0I'm trying to come up with a suggestion to >> make this better, but so far haven't succeeded. > > OK, below is what I'd prefer to check in. =A0No regressions on > OpenBSD/amd64 (which will only ever support the "real" LP64 ABI). > H.J. can you check that this indeed does the right thing for X32? > > > 2012-05-06 =A0Mark Kettenis =A0 > =A0 =A0 =A0 =A0 =A0 =A0H.J. Lu =A0 > > =A0 =A0 =A0 =A0* amd64-tdep.c (amd64_analyze_prologue): Additionally chec= k for > =A0 =A0 =A0 =A0`movl %esp, %ebp' for the X32 ABI. > It works fine for x32. Thanks. --=20 H.J.