From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8505 invoked by alias); 16 Apr 2012 16:42:52 -0000 Received: (qmail 8435 invoked by uid 22791); 16 Apr 2012 16:42:51 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,NO_DNS_FOR_FROM,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Apr 2012 16:42:37 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 16 Apr 2012 09:42:36 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga001.fm.intel.com with ESMTP; 16 Apr 2012 09:42:36 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 7F7BEC1ECA; Mon, 16 Apr 2012 09:42:36 -0700 (PDT) Date: Mon, 16 Apr 2012 17:54:00 -0000 From: "H.J. Lu" To: GDB Subject: PING: PATCH: Also check for `movl %esp, %ebp' for x32 Message-ID: <20120416164236.GB5180@intel.com> Reply-To: "H.J. Lu" References: <20120410202953.GA23862@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120410202953.GA23862@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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-04/txt/msg00423.txt.bz2 On Tue, Apr 10, 2012 at 01:29:53PM -0700, H.J. Lu wrote: > Hi, > > X32 may use `movl %esp, %ebp' in prologue. This patch checks it for > x32. Tested on Linux/x86-64. OK for trunk? > > Thanks. > > > H.J. > -- > * amd64-tdep.c (amd64_analyze_prologue): Also check for > `movl %esp, %ebp' if it is an x32 target. > > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index d15acea..e64de21 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -1900,10 +1927,14 @@ amd64_analyze_prologue (struct gdbarch *gdbarch, > if (current_pc <= pc + 1) > return current_pc; > > - /* Check for `movq %rsp, %rbp'. */ > + /* Check for `movq %rsp, %rbp'. Also check for `movl %esp, %ebp' > + if it is an x32 target. */ > read_memory (pc + 1, buf, 3); > if (memcmp (buf, mov_rsp_rbp_1, 3) != 0 > - && memcmp (buf, mov_rsp_rbp_2, 3) != 0) > + && memcmp (buf, mov_rsp_rbp_2, 3) != 0 > + && (gdbarch_ptr_bit (gdbarch) == 64 > + || (memcmp (buf, mov_rsp_rbp_1 + 1, 2) != 0 > + && memcmp (buf, mov_rsp_rbp_2 + 1, 2) != 0))) > return pc + 1; > > /* OK, we actually have a frame. */ PING. H.J.