This is the mail archive of the gdb-patches@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]

[commit/Ada] fix handling of references to packed array types


We have noticed that the handling of expressions that contain a
reference to a packed array causes a lot of trouble:

    (gdb) ptype &piti
    [1]    31696 segmentation fault  ../obj/gdb/gdb.ref foo

And also:

    (gdb) p &piti
    $1 = (array (...) of 
    ../../src-public/gdb/gdbtypes.c:1376: internal-error: check_typedef: Assertion `type' failed.

The attached patch fixes the problem.

2008-01-04  Jerome Guitton  <guitton@adacore.com>

        * ada-lang.c (decode_packed_array_type): Avoid a seg fault
        when the type is an anonymous pointer type.
        (ada_check_typedef): Avoid a seg fault when the type is null.
        * ada-typeprint.c (print_array_type): Add support for pointer
        to packed arrays.

Credits to Paul Hilfinger for reviewing the patch.

I manged to reproduce the problem inside one of the testcase that
we have already contributed.

2008-01-04  Joel Brobecker  <brobecker@adacore.com>

        * gdb.ada/packed_array.exp: Add testing of references to
        a packed array.

Tested on x86-linux, no regression. Checked in.

-- 
Joel

Attachment: packed.diff
Description: Text document

Attachment: packed-tc.diff
Description: Text document


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