[PATCH] MI: lvalues and variable_editable
Nick Roberts
nickrob@snap.net.nz
Fri Nov 2 04:23:00 GMT 2007
> On Wed, Oct 31, 2007 at 10:47:40PM +0300, Vladimir Prus wrote:
> > I'm not sure that's possible. If you create varobj for *foo, and foo changes
> > to point to inaccessible memory, then assignment to *foo will fail, but I
> > don't know any mechanism in gdb that will tell you that without actually
> > trying assignment.
>
> Yes, there is no way to be sure without trying to write. Which we
> shouldn't unless the user asked us to, of course.
In that case for such a varobj, var->value == NULL must indicate that the
memory was inaccessible at the _last_ update, or creation, and it may no longer
be inaccessible. Describing it as "noneditable" may then be a bit misleading.
I'm surprised that there is "no way to be sure without trying to write". I
know that 0x0 is inaccessible memory, and presumably the OS has a better idea
about what is and isn't accessible. Are you saying that in some systems, for
example, you could replace a RAM chip with a ROM one, and only way to know
about it is by trying to write to it?
--
Nick http://www.inet.net.nz/~nickrob
More information about the Gdb-patches
mailing list