[PATCH] Allow DW_OP_GNU_uninit in dwarf_expr_require_composition
Andreas Arnez
arnez@linux.vnet.ibm.com
Mon Oct 10 12:24:00 GMT 2016
On Sun, Oct 09 2016, Tom Tromey wrote:
>>>>>> "Andreas" == Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
> Andreas> This patch allows DW_OP_GNU_uninit after all operators
> Andreas> requiring a composition, to simplify the code and make it more
> Andreas> consistent. This policy may be more permissive than necessary,
> Andreas> but in the worst case just leads to a DWARF location
> Andreas> description resulting in an uninitialized value instead of an
> Andreas> error message.
>
> I think it would be best to allow DW_OP_GNU_uninit to terminate any
> piece, rather than require it to be at the end of the expression. This
> seems compatible and clearly more consistent with other DWARF
> operations.
You mean to allow DW_OP_GNU_uninit to terminate any simple location
description? Right, this would allow marking individual structure
members as uninitialized, for instance.
> That is, assuming DW_OP_GNU_uninit is useful at all.
> Another option would be to deprecate it.
Right, I wonder about its usefulness as well. For a variable with fixed
location it may cover a small window where the compiler can be certain
that the variable is uninitialized. I guess this *might* be useful
sometimes?
Is there even a DWARF issue for this? Or a formal specification?
--
Andreas
More information about the Gdb-patches
mailing list