From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27076 invoked by alias); 16 Oct 2010 20:16:45 -0000 Received: (qmail 27068 invoked by uid 22791); 16 Oct 2010 20:16:44 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_EG X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Oct 2010 20:16:39 +0000 Received: by vws19 with SMTP id 19so1106434vws.0 for ; Sat, 16 Oct 2010 13:16:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.187.75 with SMTP id cv11mr466055vcb.169.1287260198004; Sat, 16 Oct 2010 13:16:38 -0700 (PDT) Received: by 10.220.181.138 with HTTP; Sat, 16 Oct 2010 13:16:37 -0700 (PDT) In-Reply-To: <201010162100.47407.pedro@codesourcery.com> References: <20100203174414.GA29948@lucon.org> <201009282123.29913.pedro@codesourcery.com> <201010162100.47407.pedro@codesourcery.com> Date: Sat, 16 Oct 2010 20:16:00 -0000 Message-ID: Subject: Re: PATCH: gdbserver: Clear regcache if buf is NULL From: "H.J. Lu" To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=windows-1252 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: 2010-10/txt/msg00266.txt.bz2 On Sat, Oct 16, 2010 at 1:00 PM, Pedro Alves wrote: > On Friday 01 October 2010 02:51:07, H.J. Lu wrote: >> On Tue, Sep 28, 2010 at 1:23 PM, Pedro Alves wr= ote: > >> > Hi H.J.. =A0I'm looking at where in the current sources this >> > ended up being used, and not finding it. =A0Am I right in thinking >> > that the need for this was obsoleted when you later tought >> > gdbserver x86-linux about xml descriptions? >> > >> >> i387-fp.c has >> >> =A0 if ((x86_xcr0 & I386_XSTATE_SSE)) >> =A0 =A0 { >> =A0 =A0 =A0 int xmm0_regnum =3D find_regno ("xmm0"); >> >> =A0 =A0 =A0 if ((clear_bv & I386_XSTATE_SSE)) >> =A0 =A0 =A0 =A0 p =3D NULL; >> =A0 =A0 =A0 else >> =A0 =A0 =A0 =A0 p =3D (char *) buf; >> >> =A0 =A0 =A0 for (i =3D 0; i < num_xmm_registers; i++) >> =A0 =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 =A0 if (p) >> =A0 =A0 =A0 =A0 =A0 =A0 p =3D ((char *) &fp->xmm_space[0]) + i * 16; >> =A0 =A0 =A0 =A0 =A0 supply_register (regcache, i + xmm0_regnum, p); >> =A0 =A0 =A0 =A0 } >> =A0 =A0 } >> > > Thanks, and sorry as for not coming back to this promptly. > Hmm, I don't think I have a way to trigger that. > So is the registers' value really zero, or should gdb > ideally present them as not available (and zero is just a > hack)? > You will see it only on machines with XSAVE and enabled in OS. Please see 13.6 XSAVE/XRSTOR AND PROCESSOR EXTENDED STATE MANAGEMENT in Intel=AE 64 and IA-32 Architectures Software Developer=92s Manual Volume 3A: System Programming Guide, Part 1 Basically values in vector registers may not be valid, depending on vector state. --=20 H.J.