From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29989 invoked by alias); 8 Dec 2013 19:44:02 -0000 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 Received: (qmail 29979 invoked by uid 89); 8 Dec 2013 19:44:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,NO_DNS_FOR_FROM autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from Unknown (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Dec 2013 19:44:01 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 08 Dec 2013 11:40:10 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga001.jf.intel.com with ESMTP; 08 Dec 2013 11:43:53 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 388A980963; Sun, 8 Dec 2013 11:43:53 -0800 (PST) Date: Sun, 08 Dec 2013 19:44:00 -0000 From: "H.J. Lu" To: GDB Subject: [PATCH 1/3] PR gdb/16304: Properly decode MODRM byte for 64-bit Message-ID: <20131208194352.GA10094@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-12/txt/msg00305.txt.bz2 64-bit mode doesn't have 16-bit address. This patch fixes it. Tested on Linux/x86-64. OK to install? H.J. -- 2013-12-08 H.J. Lu PR gdb/16304 * i386-tdep.c (i386_record_lea_modrm_addr): Don't use 16-bit address in 64-bit mode. --- gdb/i386-tdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 597d672..4a91d80 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -4192,9 +4192,9 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr) ULONGEST offset64; *addr = 0; - if (irp->aflag) + if (irp->aflag || gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64) { - /* 32 bits */ + /* 32/64 bits */ int havesib = 0; uint8_t scale = 0; uint8_t byte; -- 1.8.3.1