From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26040 invoked by alias); 16 Oct 2010 22:02:34 -0000 Received: (qmail 26032 invoked by uid 22791); 16 Oct 2010 22:02:33 -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-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Oct 2010 22:02:29 +0000 Received: by qwb8 with SMTP id 8so1138389qwb.0 for ; Sat, 16 Oct 2010 15:02:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.182.204 with SMTP id cd12mr1228372vcb.3.1287266547220; Sat, 16 Oct 2010 15:02:27 -0700 (PDT) Received: by 10.220.181.138 with HTTP; Sat, 16 Oct 2010 15:02:27 -0700 (PDT) In-Reply-To: <201010162149.36890.pedro@codesourcery.com> References: <20100203174414.GA29948@lucon.org> <201010162100.47407.pedro@codesourcery.com> <201010162149.36890.pedro@codesourcery.com> Date: Sat, 16 Oct 2010 22:02: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/msg00268.txt.bz2 On Sat, Oct 16, 2010 at 1:49 PM, Pedro Alves wrote: > On Saturday 16 October 2010 21:16:37, H.J. Lu wrote: >> > >> > 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. > > Okay, thanks. =A0The changes I'm working on would make gdb print > for such registers: > > =A0(gdb) info registers > =A0... > =A0foo-register =A0 =A0 =A0 =A0 =A0 =A0 *value not available* > =A0... > > rather than: > > =A0(gdb) info registers > =A0... > =A0foo-register =A0 =A0 =A0 =A0 =A0 =A0 0x0 =A0 =A00 > =A0... > > Trying to print the register's value will show something > like "$1 =3D ", and using it's value in expression > evaluation to determine a computed expression value, an error > will be reported. > > Does that sound good? =A0Or do you think keep using 0 would > be better in this case? > Values in vector registers are invalid, not unavailable. OS initializes them to zero when they are set the firs time in a program. I prefer *value not valid". GDB may update vector registers before they are set by program. GDB sets proper bits in XSAVE area to tell OS/hardware that vector registers now have valid values. --=20 H.J.