This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: partially fix empty DW_OP_piece
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 20 May 2010 16:03:26 -0700
- Subject: Re: RFC: partially fix empty DW_OP_piece
- References: <m3vdars0hy.fsf@fleche.redhat.com>
> 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