From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24430 invoked by alias); 8 Dec 2013 20:15:58 -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 24382 invoked by uid 89); 8 Dec 2013 20:15:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,MISSING_HEADERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f178.google.com Received: from Unknown (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 08 Dec 2013 20:15:56 +0000 Received: by mail-ob0-f178.google.com with SMTP id uz6so2860924obc.37 for ; Sun, 08 Dec 2013 12:15:48 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.49.166 with SMTP id v6mr10391258obn.13.1386533748832; Sun, 08 Dec 2013 12:15:48 -0800 (PST) Received: by 10.76.105.174 with HTTP; Sun, 8 Dec 2013 12:15:48 -0800 (PST) In-Reply-To: References: <20131208194352.GA10094@intel.com> Date: Sun, 08 Dec 2013 20:15:00 -0000 Message-ID: Subject: Re: [PATCH 1/3] PR gdb/16304: Properly decode MODRM byte for 64-bit From: "H.J. Lu" Cc: GDB Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00310.txt.bz2 On Sun, Dec 8, 2013 at 11:56 AM, H.J. Lu wrote: > On Sun, Dec 8, 2013 at 11:43 AM, H.J. Lu wrote: >> 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) >> { > > We seem to check ir.regmap[X86_RECORD_R8_REGNUM] for > 64-bit target. I will try that. > This works. OK to install? Thanks. -- 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..fee58c3 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 || irp->regmap[X86_RECORD_R8_REGNUM]) { - /* 32 bits */ + /* 32/64 bits */ int havesib = 0; uint8_t scale = 0; uint8_t byte;