This is the mail archive of the 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. 005e2509a167c05719df3a3edd966865110a5052

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  005e2509a167c05719df3a3edd966865110a5052 (commit)
      from  9274e9de160a98d737bb2bd068c22d37ec66d98d (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 -----------------------------------------------------------------;h=005e2509a167c05719df3a3edd966865110a5052

commit 005e2509a167c05719df3a3edd966865110a5052
Author: Joel Brobecker <>
Date:   Thu Nov 20 12:10:41 2014 +0400

    [Ada] XA type is not redundant if the ranges' subtypes do not match
    Jan noticed that gdb.ada/arrayidx.exp regressed after I applied
    the following patch:
        commit 8908fca5772fcff9f7766158ba2aa59f5a2b1f68
        Author: Joel Brobecker <>
        Date:   Sat Sep 27 09:09:34 2014 -0700
        Subject: [Ada] Ignore __XA types when redundant.
    What happens is that we're trying to print the value of
    r_two_three, which is defined as follow:
       type Index is (One, Two, Three);
       type RTable is array (Index range Two .. Three) of Integer;
       R_Two_Three : RTable := (2, 3);
    The expected output is:
        (gdb) p r_two_three
        $1 = (two => 2, 3)
    But after the patch above was applied, with the program program
    compiled using gcc-gnat-4.9.2-1.fc21.x86_64 (x86_64-linux),
    the output becomes:
        (gdb) p r_two_three
        $1 = (2, 3)
    (the name of the first bound is missing). The problem comes from
    the fact that the compiler described the array's index type as
    a plain base type, instead of as a subrange of the enumerated type.
    More particularly, this is what gcc-gnat-4.9.2-1.fc21.x86_64
     <3><7ce>: Abbrev Number: 9 (DW_TAG_array_type)
        <7cf>   DW_AT_name        : (indirect string, offset: 0xc13): p__rtable
        <7d7>   DW_AT_GNAT_descriptive_type: <0x98a>
     <4><7df>: Abbrev Number: 8 (DW_TAG_subrange_type)
        <7e0>   DW_AT_type        : <0xa79>
    where DIE 0xa79 is:
     <1><a79>: Abbrev Number: 2 (DW_TAG_base_type)
        <a7a>   DW_AT_byte_size   : 8
        <a7b>   DW_AT_encoding    : 7       (unsigned)
        <a7c>   DW_AT_name        : (indirect string, offset: 0xfc): sizetype
    The actual array subrange type can be found in the array's
    parallel XA type (the DW_AT_GNAT_descriptive_type).
    The recent commit correctly found that that bounds taken from
    the descriptive type are the same as bounds of our array's index
    type. But it failed to notice that ignoring this descriptive
    type would make us lose the actual array index type, making us
    think that we're printing an array indexed by integers.
    I hadn't seen that problem, because the compiler I used produced
    debugging info where the array's index type is correctly described:
     <3><79f>: Abbrev Number: 10 (DW_TAG_array_type)
        <7a0>   DW_AT_name        : (indirect string, offset: 0xb3d): p__rtable
     <4><7b0>: Abbrev Number: 8 (DW_TAG_subrange_type)
        <7b1>   DW_AT_type        : <0x9b2>
        <7b5>   DW_AT_upper_bound : 2
    ... where DIE 0x9b2 leads us to ...
     <3><9b2>: Abbrev Number: 9 (DW_TAG_subrange_type)
        <9b8>   DW_AT_type        : <0x962>
     <2><962>: Abbrev Number: 22 (DW_TAG_enumeration_type)
        <963>   DW_AT_name        : (indirect string, offset: 0xb34): p__index
    This patch fixes the issue by also making sure that the subtype
    of the original range type does match the subtype found in the
    descriptive type.
            * ada-lang.c (ada_is_redundant_range_encoding): Return 0
            if the TYPE_CODE of range_type's base type does not match
            the TYPE_CODE of encoding_type's base type.


Summary of changes:
 gdb/ChangeLog  |    6 ++++++
 gdb/ada-lang.c |   11 +++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

gdb and binutils

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