PATCH: gdbserver: Clear regcache if buf is NULL

Mark Kettenis mark.kettenis@xs4all.nl
Sun Oct 31 13:25:00 GMT 2010


> From: Pedro Alves <pedro@codesourcery.com>
> Date: Sat, 16 Oct 2010 21:49:36 +0100
> 
> 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® 64 and IA-32 Architectures Software Developer’s Manual
> > Volume 3A: System Programming Guide, Part 1
> > 
> > Basically values in vector registers may not be valid, depending
> > on vector state.
> 
> Okay, thanks.  The changes I'm working on would make gdb print
> for such registers:
> 
>  (gdb) info registers
>  ...
>  foo-register             *value not available*
>  ...
> 
> rather than:
> 
>  (gdb) info registers
>  ...
>  foo-register             0x0    0
>  ...
> 
> Trying to print the register's value will show something
> like "$1 = <unavailable>", and using it's value in expression
> evaluation to determine a computed expression value, an error
> will be reported.
> 
> Does that sound good?  Or do you think keep using 0 would
> be better in this case?

I think that sounds good.



More information about the Gdb-patches mailing list