From 828292f27174a8fe1c0fba0d1ba99ca815b3233b Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 1 Jul 2011 18:25:49 +0000 Subject: variables whose type is a typedef to an array pointer If we declare a type as being an access to array type, and then declare a variable of that type, for instance: type Some_Array is array [...]; type Array_Access is access all Some_Array; Table : Array_Access := [...]; The variable "Table" may be defined in the debugging information as being a typedef to the array pointer type. In the past, it was defined directly as the array pointer type, but this has been changed to make sure that the typedef type gets used. If the typedef type wasn't used, it would allow the compiler to stop emitting that typedef type when compiling with -feliminate-unused-debug-types. The removal of this typedef would be a problem, because GDB relies on the typedef to create symbols for pointer types, and without it, we would no longer be able to do "ptype array_access". This patch helps prevent incorrect output or even crashes when that extra typedef layer is used. The testing is already mostly covered by arrayptr.exp, but I still added a 'ptype' test, just for good measure. gdb/ChangeLog: (Eric Botcazou) * ada-lang.c (thin_descriptor_type): Deal with typedefs. (decode_constrained_packed_array): Likewise. (ada_evaluate_subexp) : Likewise. gdb/testsuite/ChangeLog (Joel Brobecker): * gdb.ada/arrayptr.exp: Add ptype test. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.ada/arrayptr.exp | 2 ++ 2 files changed, 6 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a27a8bd..1dc763d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2011-07-01 Joel Brobecker + * gdb.ada/arrayptr.exp: Add ptype test. + +2011-07-01 Joel Brobecker + * gdb.ada/char_enum: New testcase. 2011-07-01 Yao Qi diff --git a/gdb/testsuite/gdb.ada/arrayptr.exp b/gdb/testsuite/gdb.ada/arrayptr.exp index ba30d61..9b06bc1 100644 --- a/gdb/testsuite/gdb.ada/arrayptr.exp +++ b/gdb/testsuite/gdb.ada/arrayptr.exp @@ -51,3 +51,5 @@ gdb_test "print arr_ptr (2)" "= 22" gdb_test "print arr_ptr (3..4)" "= \\(3 => 23, 24\\)" +gdb_test "ptype string_access" "= access array \\(<>\\) of character" + -- cgit v1.1