[Ada] Better handling of dynamic types in ada_value_primitive_packed_val
authorJoel Brobecker <brobecker@adacore.com>
Fri, 9 Oct 2015 21:13:49 +0000 (14:13 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Fri, 9 Oct 2015 21:30:38 +0000 (14:30 -0700)
commitd0a9e8108942ebeb68d9b0b39bebb37369e0f701
tree7a8feeb7db1108394f8a97e8a634afb276802bb9
parentf93fca700f0fd70532132ae535f48c1a936abb0a
[Ada] Better handling of dynamic types in ada_value_primitive_packed_val

There is some partial handling for dynamic types in
ada_value_primitive_packed_val, but this support was added
in a fairly ad hoc way, and actually only covered the situation
where OBJ is not NULL and its contents had not been fetched yet.
In addition, even in the cases that it does cover, it doesn't make
much sense. In particular, it was adjusting BIT_SIZE and SRC_LEN,
which are properties of the data to be extracted _from_, based
on TYPE's length once resolved, which is a property of the data
we want to extract _to_.

This patch hopefully adjust this function to handle dynamic types
correctly, and in all cases. It does so by unpacking the data into
a temporary buffer in order to use that buffer to resolve the type.
And _then_ creates the resulting value from that resolved type.

gdb/ChangeLog:

        * ada-lang.c (ada_value_primitive_packed_val): Rework handling
        of case where TYPE is dynamic.
gdb/ChangeLog
gdb/ada-lang.c
This page took 0.037695 seconds and 4 git commands to generate.