From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31911 invoked by alias); 9 Feb 2011 18:42:50 -0000 Received: (qmail 31902 invoked by uid 22791); 9 Feb 2011 18:42:50 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Feb 2011 18:42:45 +0000 Received: by vws10 with SMTP id 10so288945vws.0 for ; Wed, 09 Feb 2011 10:42:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.187.13 with SMTP id cu13mr5014000vcb.172.1297276962737; Wed, 09 Feb 2011 10:42:42 -0800 (PST) Received: by 10.220.184.2 with HTTP; Wed, 9 Feb 2011 10:42:42 -0800 (PST) In-Reply-To: <4D52DEAC.1020607@vmware.com> References: <4D52DEAC.1020607@vmware.com> Date: Wed, 09 Feb 2011 18:42:00 -0000 Message-ID: Subject: Re: [RFA] fix for intel disassembly, truncated BFD_VMA From: "H.J. Lu" To: Michael Snyder 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: 2011-02/txt/msg00189.txt.bz2 On Wed, Feb 9, 2011 at 10:36 AM, Michael Snyder wrote: > This expression needed parentheses. =A0Without them, it was truncating the > target address of jumps and calls from BFD_VMA to 32-bits. > > Disassembly at high addresses is vastly improved. > > > 2011-02-09 =A0Michael Snyder =A0 > > =A0 =A0 =A0 =A0* i386-dis.c (OP_J): Parenthesize expression to prevent > =A0 =A0 =A0 =A0truncated addresses. > =A0 =A0 =A0 =A0(print_insn): Fix indentation off-by-one. > > Index: i386-dis.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/opcodes/i386-dis.c,v > retrieving revision 1.257 > diff -u -p -u -p -r1.257 i386-dis.c > --- i386-dis.c =A018 Jan 2011 17:08:13 -0000 =A0 =A0 =A01.257 > +++ i386-dis.c =A09 Feb 2011 18:28:02 -0000 > @@ -1,6 +1,6 @@ > =A0/* Print i386 instructions for GDB, the GNU debugger. > =A0 =A0Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 19= 99, > - =A0 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 > + =A0 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 > =A0 =A0Free Software Foundation, Inc. > > =A0 =A0This file is part of the GNU opcodes library. > @@ -11702,9 +11702,9 @@ print_insn (bfd_vma pc, disassemble_info > =A0 =A0 =A0 modrm.rm =3D *codep & 7; > =A0 =A0 } > > - =A0 need_vex =3D 0; > - =A0 need_vex_reg =3D 0; > - =A0 vex_w_done =3D 0; > + =A0need_vex =3D 0; > + =A0need_vex_reg =3D 0; > + =A0vex_w_done =3D 0; > > =A0 if (dp->name =3D=3D NULL && dp->op[0].bytemode =3D=3D FLOATCODE) > =A0 =A0 { > @@ -13817,7 +13817,7 @@ OP_J (int bytemode, int sizeflag) > =A0 =A0 =A0 oappend (INTERNAL_DISASSEMBLER_ERROR); > =A0 =A0 =A0 return; > =A0 =A0 } > - =A0disp =3D ((start_pc + codep - start_codep + disp) & mask) | segment; > + =A0disp =3D ((start_pc + (codep - start_codep) + disp) & mask) | segmen= t; > =A0 set_op (disp, 0); > =A0 print_operand_value (scratchbuf, 1, disp); > =A0 oappend (scratchbuf); > > OK. Thanks. --=20 H.J.