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



> I admit that I don't have enough insight into how the lazy flag is
> used in GDB to suggest a solution.  But if you have further ideas for
> testing, I will try them.

Normally, a `struct value' holds the value in a little buffer,
value->aligner.contents, usually accessed by writing
VALUE_CONTENTS(value).  The value is stored in target byte order,
according to the target ABI.  A `struct value' can be a single
character, an integer, or a full structure.  If the value is a memory
lvalue, the structure also records the address it came from.  An
operator like + would use the contents; an operator like & would use
the address.  If the value is a register lvalue, the structure also
records the register it came from.

If a value is marked as "lazy", that means its value hasn't actually
been read yet --- value->aligner.contents is garbage.  But calling
VALUE_CONTENTS(v) checks v's lazy flag, and if necessary, does the
read and clears v's lazy flag.  So as long as you always use
VALUE_CONTENTS to examine values, the value will always spring into
memory just when you need it --- and only if you need it.

What expressions did you try to watch?  What chains of values did they
produce?  Which ones are lazy, and which ones aren't?

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