This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Changing the "enclosing_type" of a value structure
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: Changing the "enclosing_type" of a value structure
- From: Jim Ingham <jingham at apple dot com>
- Date: Tue, 15 Aug 2000 16:08:36 -0700
- Cc: gdb at sources dot redhat dot com
- Reply-To: jingham at apple dot com
On Monday, August 14, 2000, at 11:32 PM, Eli Zaretskii wrote:
> > Date: Mon, 14 Aug 2000 11:32:07 -0700
> > From: Jim Ingham <jingham@apple.com>
> >
> > The sketch I sent in the last note was not right. You have to change the
> > lazy flag
>
> Sorry for jumping in--I wasn't following this thread--but changing the
> way the lazy flag is set might affect the hardware watchpoints, at
> least on x86 targets. The current code which checks whether a given
> value can be watched by hardware watchpoint(s) and the code which
> inserts the watchpoints assume that those parts of the value chain
> which have their lazy flag set don't need to be watched. This allows
> to watch members of large structs and array elements without watching
> the whole struct/array.
>
> If the issue you were discussing has no relation to that problem, I
> apologize.
>
Humm... I have to think about this some more. The comment before the definition of the lazy field in value.h says:
/* If zero, contents of this value are in the contents field.
If nonzero, contents are in inferior memory at address
in the location.address field plus the offset field
(and the lval field should be lval_memory). */
char lazy;
This doesn't sound at first reading like the meaning that it is being given by the watchpoint code, which also doesn't quite jibe with the description of the VALUE_CONTENTS macro. In valops.c & friends, the lazy flag is definitely used to indicate whether the data HAS been read in from inferior memory or not.
I don't yet understand how this all works enough to know whether this seeming overloading is actually a problem or not, though I agree that given how it is used for watchpoints, it is not as simple as I first thought.
Still digging...
Jim
Jim Ingham jingham@apple.com
Apple Computer