From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6860 invoked by alias); 14 Dec 2013 23:12:10 -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 6839 invoked by uid 89); 14 Dec 2013 23:12:10 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f44.google.com Received: from mail-yh0-f44.google.com (HELO mail-yh0-f44.google.com) (209.85.213.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 14 Dec 2013 23:12:09 +0000 Received: by mail-yh0-f44.google.com with SMTP id f64so2671710yha.31 for ; Sat, 14 Dec 2013 15:12:07 -0800 (PST) X-Received: by 10.236.228.5 with SMTP id e5mr1310290yhq.57.1387062727614; Sat, 14 Dec 2013 15:12:07 -0800 (PST) Received: from gnu-tools-1.localdomain (76-220-57-190.lightspeed.sntcca.sbcglobal.net. [76.220.57.190]) by mx.google.com with ESMTPSA id x9sm10636342yhd.13.2013.12.14.15.12.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Dec 2013 15:12:07 -0800 (PST) Received: by gnu-tools-1.localdomain (Postfix, from userid 1000) id 9176D4045E; Sat, 14 Dec 2013 15:12:05 -0800 (PST) Date: Sat, 14 Dec 2013 23:12:00 -0000 From: "H.J. Lu" To: Mark Kettenis Cc: GDB Subject: Re: [PATCH 1/3] PR gdb/16304: Properly decode MODRM byte for 64-bit Message-ID: <20131214231205.GB3792@gmail.com> References: <20131208194352.GA10094@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00554.txt.bz2 On Sun, Dec 08, 2013 at 12:15:48PM -0800, H.J. Lu wrote: > 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; Hi Mark, Do you get time to review this? Thanks. H.J.