This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb and binutils branch master updated. 6908c50982bc70ff9e035028b3bc300f80fed7e4


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  6908c50982bc70ff9e035028b3bc300f80fed7e4 (commit)
      from  53e8f97d571973c3bfb04ef3d9a358ea4a0e8e62 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6908c50982bc70ff9e035028b3bc300f80fed7e4

commit 6908c50982bc70ff9e035028b3bc300f80fed7e4
Author: Joel Brobecker <brobecker@adacore.com>
Date:   Tue Jul 8 08:15:35 2014 -0700

    Handle variable-sized fields in the interior of structure type
    
    In Ada, variable-sized field can be located at any position of
    a structure. Consider for instance the following declarations:
    
       Dyn_Size : Integer := 1;
    
       type Table is array (Positive range <>) of Integer;
    
       type Inner is record
          T1 : Table (1 .. Dyn_Size) := (others => 1);
          T2 : Table (1 .. Dyn_Size) := (others => 2);
       end record;
    
       type Inner_Array is array (1 .. 2) of Inner;
    
       type Outer is
          record
             I0 : Integer := 0;
             A1 : Inner_Array;
             Marker : Integer := 16#01020304#;
          end record;
    
       Rt : Outer;
    
    What this does is declare a variable "Rt" of type Outer, which
    contains 3 fields where the second (A1) is of type Inner_Array.
    type Inner_Array is an array with 2 elements of type Inner.
    Because type Inner contains two arrays whose upper bound depend
    on a variable, the size of the array, and therefore the size of
    type Inner is dynamic, thus making field A1 a dynamically-size
    field.
    
    When trying to print the value of Rt, we hit the following limitation:
    
        (gdb) print rt
        Attempt to resolve a variably-sized type which appears in the interior of
        a structure type
    
    The limitation was somewhat making sense in C, but needs to be lifted
    for Ada. This patch mostly lifts that limitation. As a result of this
    patch, the type length computation had to be reworked a little bit.
    
    gdb/ChangeLog:
    
            * gdbtypes.c (resolve_dynamic_struct): Do not generate an error
            if detecting a variable-sized field that is not the last field.
            Fix struct type length computation.
    
    gdb/testsuite/ChangeLog:
    
            * gdb.base/vla-datatypes.c (vla_factory): Add new variable
            inner_vla_struct_object_size.
            * gdb.base/vla-datatypes.exp: Adjust last test, and mark it
            as xfail.

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog                            |    6 +++
 gdb/gdbtypes.c                           |   54 +++++++++++++++++-------------
 gdb/testsuite/ChangeLog                  |    7 ++++
 gdb/testsuite/gdb.base/vla-datatypes.c   |    1 +
 gdb/testsuite/gdb.base/vla-datatypes.exp |    8 +++--
 5 files changed, 50 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
gdb and binutils


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]