This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: gdbserver: Clear regcache if buf is NULL


On Sat, Oct 16, 2010 at 1:49 PM, Pedro Alves <pedro@codesourcery.com> 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® 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?
>

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.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]