summaryrefslogtreecommitdiff
path: root/gdb/ada-typeprint.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-01-04 20:45:05 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-01-04 20:45:05 +0000
commit1cba28549c159ef7b212fcfc68d3b27ebceadfd8 (patch)
tree95e27e0a8620031cc28277d18e241fadc2382dd4 /gdb/ada-typeprint.c
parentf3674928a9ba6f3449e2b52feaa481bfed5a0300 (diff)
downloadgdb-1cba28549c159ef7b212fcfc68d3b27ebceadfd8.tar.gz
* 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.
Diffstat (limited to 'gdb/ada-typeprint.c')
-rw-r--r--gdb/ada-typeprint.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 7bfb001b7bc..4b1f9ffc90d 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -366,6 +366,9 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
int bitsize;
int n_indices;
+ if (ada_is_packed_array_type (type))
+ type = ada_coerce_to_simple_array_type (type);
+
bitsize = 0;
fprintf_filtered (stream, "array (");
@@ -374,8 +377,6 @@ print_array_type (struct type *type, struct ui_file *stream, int show,
fprintf_filtered (stream, "...");
else
{
- if (ada_is_packed_array_type (type))
- type = ada_coerce_to_simple_array_type (type);
if (type == NULL)
{
fprintf_filtered (stream, _("<undecipherable array type>"));
@@ -782,7 +783,17 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
if (ada_is_aligner_type (type))
ada_print_type (ada_aligned_type (type), "", stream, show, level);
else if (ada_is_packed_array_type (type))
- print_array_type (type, stream, show, level);
+ {
+ if (TYPE_CODE (type) == TYPE_CODE_PTR)
+ {
+ fprintf_filtered (stream, "access ");
+ print_array_type (TYPE_TARGET_TYPE (type), stream, show, level);
+ }
+ else
+ {
+ print_array_type (type, stream, show, level);
+ }
+ }
else
switch (TYPE_CODE (type))
{