This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: Hardware watchpoints



> Now for the next problem: hardware watchpoints still don't work, even
> after these changes, for struct members that are bitfields.  As far as
> I could see, the reason for this is that value_primitive_field needs
> to fetch the value of the field in order to unpack it into an int, and
> that causes the lazy flag of the struct itself to be reset.
> 
> It seems that relying on the lazy flag is too fragile: any code that
> needs to fetch the value of the struct, for some purpose, will break
> the ability to watch members of that struct.
> 
> Perhaps we need a special flag for this, which will be set for structs
> and arrays only if they are not the watched expression itself.

I agree that using the value chain is fragile.  It's my impression
that it was never intended for anything more than freeing old values.
Nobody ever promised that it would have any specific semantics.

Instead of adding yet another special flag, we could change
value_primitive_field, or whoever extracts bitfields, to create a new
value object, also on the chain, containing just the words from the
original value that hold the bitfield, and then let that smaller value
become unlazy.  That should yield exactly the words we need to set
hardware watchpoints on.

I'm not sure what type that intermediate value should have.

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