RFC: partially fix empty DW_OP_piece

Joel Brobecker brobecker@adacore.com
Thu May 20 23:04:00 GMT 2010


> This patch "fixes" the problem in a simple way.  Missing pieces are
> filled with zeros, and read_pieced_value emits a warning, so that users
> know not to fully trust the result.
> 
> This is not an excellent fix.  I think it is an improvement, but I can
> understand if people would rather not see it go in.

I also think that this is an improvement, and that it should go in.

> I thought of two ways to implement the val_print part.  One way would be
> to make a temporary 'struct type' instance that encodes the validity in
> the type somehow.  The other way is to simply remove val_print entirely
> and make all of printing work using values.  I think this is the route I
> would prefer.

FWIW:
I think that would be my preference indeed. Generally speaking, it looks
like our struct type is headed for some major upgrades, once we start
thinking about making some elements of a type dynamic (Eg: range type
bounds, array bounds). But using a temporary type to track the validity
of a field for a given entity does not seem to be the right idiom...

-- 
Joel



More information about the Gdb-patches mailing list