RFC: partially fix empty DW_OP_piece

Tom Tromey tromey@redhat.com
Fri Jun 4 21:39:00 GMT 2010


>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> OK, that probably means there really must remain a way to convert
Jan> `inferior dependent struct value' into an `inferior independent
Jan> struct value'.

Yeah, at least as far as the bounds are concerned.  IMO.

The current gdb model is sort of mixed.  A struct value is a snapshot of
some bit of state.  But, when printing a value, we might refer to other
state in the target.  For example:

    struct x { char *name; };

If we have a value of that type, gdb will try to dereference the pointer
when printing.  But, we make no attempt to save this memory alongside
the value somewhere.  So, if you have a complicated debug session and
then after many re-runs or whatever do "print $1", you can get weird
answers.

There may be some other odd cases, too.

We could fix this, of course, but it isn't clear that it is worth the
effort.

Tom



More information about the Gdb-patches mailing list