From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26477 invoked by alias); 9 Feb 2011 18:36:35 -0000 Received: (qmail 26330 invoked by uid 22791); 9 Feb 2011 18:36:34 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Feb 2011 18:36:29 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 7789E34004; Wed, 9 Feb 2011 10:36:28 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 6A606CD944; Wed, 9 Feb 2011 10:36:28 -0800 (PST) Message-ID: <4D52DEAC.1020607@vmware.com> Date: Wed, 09 Feb 2011 18:36:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , "H.J. Lu" , hongjiu.lu@intel.com Subject: [RFA] fix for intel disassembly, truncated BFD_VMA Content-Type: multipart/mixed; boundary="------------060503060001080001060409" 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/msg00188.txt.bz2 This is a multi-part message in MIME format. --------------060503060001080001060409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 184 This expression needed parentheses. Without them, it was truncating the target address of jumps and calls from BFD_VMA to 32-bits. Disassembly at high addresses is vastly improved. --------------060503060001080001060409 Content-Type: text/plain; name="truncate.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="truncate.txt" Content-length: 1469 2011-02-09 Michael Snyder * i386-dis.c (OP_J): Parenthesize expression to prevent truncated addresses. (print_insn): Fix indentation off-by-one. Index: i386-dis.c =================================================================== 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 18 Jan 2011 17:08:13 -0000 1.257 +++ i386-dis.c 9 Feb 2011 18:28:02 -0000 @@ -1,6 +1,6 @@ /* Print i386 instructions for GDB, the GNU debugger. Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -11702,9 +11702,9 @@ print_insn (bfd_vma pc, disassemble_info modrm.rm = *codep & 7; } - need_vex = 0; - need_vex_reg = 0; - vex_w_done = 0; + need_vex = 0; + need_vex_reg = 0; + vex_w_done = 0; if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE) { @@ -13817,7 +13817,7 @@ OP_J (int bytemode, int sizeflag) oappend (INTERNAL_DISASSEMBLER_ERROR); return; } - disp = ((start_pc + codep - start_codep + disp) & mask) | segment; + disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment; set_op (disp, 0); print_operand_value (scratchbuf, 1, disp); oappend (scratchbuf); --------------060503060001080001060409--