[Ada] Buffer overflow in ada_unpack_from_contents
This patch fixes a buffer overflow in ada_unpack_from_contents
caused by one of the previous commits. This happens when trying
to print the value of an array of variant records.
The overflow happens while trying to print one element of the array.
Because the size of each element in the array is variable, the array
has a DWARF byte_stride attribute, which makes us treat the array
as if it was packed. And during the extraction of each array element,
we try to unpack an object using the array's byte stride as the size,
into an element whose size is actually less than the stride.
This patch fixes the issue by overriding the byte-stride with
the actual element's length.
gdb/ChangeLog:
* ada-lang.c (ada_value_primitive_packed_val): Move
src_len variable to local block where used. Override
BIT_SIZE if bigger than size of resolved type.