Do not print <synthetic pointer> when piece is optimized out

A user reported a bug where printing a certain array of integer types
would result in the nonsensical:

(gdb) p l_126
$1 = {6639779683436459270, <synthetic pointer>, <synthetic pointer>, <synthetic pointer>}

I tracked this down to some issues in the DWARF expression code.
First, check_pieced_synthetic_pointer did not account for the
situation where a location expression does not describe all the bits
of a value -- in this case it returned true, meaning there is a
synthetic pointer, but in fact these bits are optimized out.  (It
turns out this incorrect output had already been erroneously tested
for as well.)

Next, rw_pieced_value did not mark these bits as optimized-out,
either.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30296



3 files changed