From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25767 invoked by alias); 7 Sep 2009 11:17:11 -0000 Received: (qmail 25758 invoked by uid 22791); 7 Sep 2009 11:17:10 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_28,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f185.google.com (HELO mail-pz0-f185.google.com) (209.85.222.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Sep 2009 11:17:00 +0000 Received: by pzk15 with SMTP id 15so2452574pzk.24 for ; Mon, 07 Sep 2009 04:16:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.250.26 with SMTP id x26mr520676wfh.159.1252322218400; Mon, 07 Sep 2009 04:16:58 -0700 (PDT) In-Reply-To: <4AA44E82.80207@vmware.com> References: <4A999BC3.5020606@vmware.com> <4AA1CFD1.4000502@vmware.com> <200909050814.n858EvHR016392@brahms.sibelius.xs4all.nl> <4AA44E82.80207@vmware.com> From: Hui Zhu Date: Mon, 07 Sep 2009 11:17:00 -0000 Message-ID: Subject: Re: [RFA/prec] Make i386 handle segment register better To: Michael Snyder Cc: Mark Kettenis , "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: 2009-09/txt/msg00155.txt.bz2 On Mon, Sep 7, 2009 at 08:06, Michael Snyder wrote: > Hui Zhu wrote: >> >> On Sun, Sep 6, 2009 at 14:52, Hui Zhu wrote: >>> >>> Hi guys, >>> >>> Sorry I didn't do more test for this patch on amd64 before I check it i= n. >>> >>> But this patch really work not very good in amd64. >>> > [...] >>> >>> I think remove this patch from gdb-cvs-head before 7.0 branch =A0and >>> make the segment reg clear is better. >>> >>> What =A0do you think about it? >>> >>> Thanks, >>> Hui >>> >> >> I make a patch for it. =A0Please help me review it. >> >> Thanks, >> Hui >> >> 2009-09-06 =A0Hui Zhu =A0 >> >> =A0 =A0 =A0 =A0* i386-tdep.c (i386_record_check_override): Deleted. >> =A0 =A0 =A0 =A0(i386_record_lea_modrm): Ditto. >> =A0 =A0 =A0 =A0(i386_process_record): Ditto. > > =A0 =A0 =A0 =A0(i386_process_record): Revert the use of deleted > =A0 =A0 =A0 =A0function 'i386_record_check_override'. > =A0 =A0 =A0 =A0(i386_record_lea_modrm): Ditto. > > Looks to me like you've preserved what you could > of the change, and removed the minimum. =A0Good. > > This looks ok to commit. > > Thanks. Checked in. Hui > >> >> --- >> =A0i386-tdep.c | =A0 37 +++++++++++-------------------------- >> =A01 file changed, 11 insertions(+), 26 deletions(-) >> >> --- a/i386-tdep.c >> +++ b/i386-tdep.c >> @@ -3148,26 +3148,6 @@ no_rm: >> =A0 return 0; >> =A0} >> >> -static int >> -i386_record_check_override (struct i386_record_s *irp) >> -{ >> - =A0if (irp->override >=3D 0 && irp->override !=3D X86_RECORD_DS_REGNUM) >> - =A0 =A0{ >> - =A0 =A0 =A0ULONGEST orv, ds; >> - >> - =A0 =A0 =A0regcache_raw_read_unsigned (irp->regcache, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irp= ->regmap[irp->override], >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&or= v); >> - =A0 =A0 =A0regcache_raw_read_unsigned (irp->regcache, >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irp= ->regmap[X86_RECORD_DS_REGNUM], >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&ds= ); >> - =A0 =A0 =A0if (orv !=3D ds) >> - =A0 =A0 =A0 =A0return 1; >> - =A0 =A0} >> - >> - =A0return 0; >> -} >> - >> =A0/* Record the value of the memory that willbe changed in current >> instruction >> =A0 =A0to "record_arch_list". >> =A0 =A0Return -1 if something wrong. */ >> @@ -3178,7 +3158,7 @@ i386_record_lea_modrm (struct i386_recor >> =A0 struct gdbarch *gdbarch =3D irp->gdbarch; >> =A0 uint64_t addr; >> >> - =A0if (i386_record_check_override (irp)) >> + =A0if (irp->override >=3D 0) >> =A0 =A0 { >> =A0 =A0 =A0 warning (_("Process record ignores the memory change " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"of instruction at address %s because= it " >> @@ -4060,7 +4040,7 @@ reswitch: >> =A0 =A0 =A0 /* mov EAX */ >> =A0 =A0 case 0xa2: >> =A0 =A0 case 0xa3: >> - =A0 =A0 =A0if (i386_record_check_override (&ir)) >> + =A0 =A0 =A0if (ir.override >=3D 0) >> =A0 =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 =A0warning (_("Process record ignores the memory change " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"of instruction at address 0x= %s because " >> @@ -4478,8 +4458,13 @@ reswitch: >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 ir.regmap[X86_RECORD_REDI_REGNUM], >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 &tmpulongest); >> >> - =A0 =A0 =A0 =A0 =A0ir.override =3D X86_RECORD_ES_REGNUM; >> - =A0 =A0 =A0 =A0 =A0if (ir.aflag && i386_record_check_override (&ir)) >> + =A0 =A0 =A0 =A0 =A0regcache_raw_read_unsigned (ir.regcache, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0ir.regmap[X86_RECORD_ES_REGNUM], >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0&es); >> + =A0 =A0 =A0 =A0 =A0regcache_raw_read_unsigned (ir.regcache, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0ir.regmap[X86_RECORD_DS_REGNUM], >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0&ds); >> + =A0 =A0 =A0 =A0 =A0if (ir.aflag && (es !=3D ds)) >> =A0 =A0 =A0 =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* addr +=3D ((uint32_t) read_register (I386= _ES_REGNUM)) << 4; >> */ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 warning (_("Process record ignores the memor= y " >> @@ -5103,7 +5088,7 @@ reswitch: >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0opcode =3D opcode << 8 | ir.modrm; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto no_support; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0} >> - =A0 =A0 =A0 =A0 =A0 if (i386_record_check_override (&ir)) >> + =A0 =A0 =A0 =A0 =A0 if (ir.override >=3D 0) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warning (_("Process record ignores the me= mory " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"change of instru= ction at " >> @@ -5154,7 +5139,7 @@ reswitch: >> =A0 =A0 =A0 =A0 =A0else >> =A0 =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0/* sidt */ >> - =A0 =A0 =A0 =A0 =A0 =A0 if (i386_record_check_override (&ir)) >> + =A0 =A0 =A0 =A0 =A0 =A0 if (ir.override >=3D 0) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0warning (_("Process record ignores th= e memory " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"change of in= struction at " >> > >