diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-01-04 20:45:05 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-01-04 20:45:05 +0000 |
commit | 727e3d2e5ca581e75f2d8707c28c5cbd7ee34bb0 (patch) | |
tree | ad508980930ee4377049060846486a8520f65205 /gdb/ada-typeprint.c | |
parent | ecc7085baf3e1b677cbcaa84989cd3a48f13542d (diff) | |
download | gdb-727e3d2e5ca581e75f2d8707c28c5cbd7ee34bb0.zip gdb-727e3d2e5ca581e75f2d8707c28c5cbd7ee34bb0.tar.gz gdb-727e3d2e5ca581e75f2d8707c28c5cbd7ee34bb0.tar.bz2 |
* 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.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 7bfb001..4b1f9ff 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)) { |