From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29718 invoked by alias); 17 Apr 2012 14:33:52 -0000 Received: (qmail 29704 invoked by uid 22791); 17 Apr 2012 14:33:51 -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,TW_OV 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; Tue, 17 Apr 2012 14:33:18 +0000 Received: by qcsd16 with SMTP id d16so4459338qcs.0 for ; Tue, 17 Apr 2012 07:33:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.86.208 with SMTP id t16mr21188279qal.16.1334673198235; Tue, 17 Apr 2012 07:33:18 -0700 (PDT) Received: by 10.229.136.69 with HTTP; Tue, 17 Apr 2012 07:33:18 -0700 (PDT) In-Reply-To: <4F8D4AC8.6010402@codesourcery.com> References: <20120410202953.GA23862@intel.com> <4F8D4AC8.6010402@codesourcery.com> Date: Tue, 17 Apr 2012 14:41:00 -0000 Message-ID: Subject: Re: PATCH: Also check for `movl %esp, %ebp' for x32 From: "H.J. Lu" To: Yao Qi Cc: GDB 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-04/txt/msg00481.txt.bz2 On Tue, Apr 17, 2012 at 3:49 AM, Yao Qi wrote: > On 04/11/2012 04:29 AM, H.J. Lu wrote: >> - =A0 =A0 =A0 && memcmp (buf, mov_rsp_rbp_2, 3) !=3D 0) >> + =A0 =A0 =A0 && memcmp (buf, mov_rsp_rbp_2, 3) !=3D 0 >> + =A0 =A0 =A0 && (gdbarch_ptr_bit (gdbarch) =3D=3D 64 >> + =A0 =A0 =A0 =A0 =A0 || (memcmp (buf, mov_rsp_rbp_1 + 1, 2) !=3D 0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0^^ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 && memcmp (buf, mov_rsp_rbp_2 + 1, 2) !=3D= 0))) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^ > > I don't understand these two constants "2" here. =A0Does this mean the > encoding of `movl %esp, %ebp' is { 0x48, 0x89 } and { 0x48, 0x8b }? =A0If movl %esp, %ebp is 0x89, 0xe5 or 0x8b, 0xec. > my understand is correct, why don't we define two new array > "movl_esp_ebp_1" and "movl_esp_ebp_2"? which is easier to read/understand. > I don't see it is necessary since the difference of movl and movq is the 0x48 REX prefix. --=20 H.J.