summaryrefslogtreecommitdiff
path: root/gdb/ada-typeprint.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-04-20 22:38:01 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-04-20 22:38:01 +0000
commit0df8296ccbe06c092d21cf9e808d4f634ca1a6c2 (patch)
tree88094fe000c1a7ac8aa6bef3c1fe5dbcc8f80b24 /gdb/ada-typeprint.c
parent949ed6ecaacec61013e66818f1f1d0c17369b185 (diff)
downloadgdb-0df8296ccbe06c092d21cf9e808d4f634ca1a6c2.tar.gz
"unsupported language" error in info types when using Ada.
This implements a rudimentary version of the la_print_typedef method for Ada. Ada usually does not use typedefs, but there is one exception: pointers to unconstrained arrays. Without this patch, we sometimes get an error in the "info types" output: (gdb) info types new_integer_type All types matching regular expression "new_integer_type": File foo.adb: Language not supported. For now, we treat the typedef as if it did not exist - using the underlying type instead. This is the right thing to do for most cases, the only exception being access to array types. Since we already have a general issue in handling these pointers (we confuse them with fat pointers), we will enhance ada_print_typedef to handle these pointers at the same time we address the general issue. gdb/ChangeLog: * ada-typeprint.c (ada_print_typedef): New function. * ada-lang.h (ada_print_typedef): Add declaration. * ada-lang.c (ada_language_defn): set la_print_typdef field to ada_print_typedef. gdb/testsuite/ChangeLog: * info_types.c, info_types.exp: New files. Tested on x86_64-linux.
Diffstat (limited to 'gdb/ada-typeprint.c')
-rw-r--r--gdb/ada-typeprint.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 74eaabf2afb..17d3594250d 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -828,3 +828,14 @@ ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
break;
}
}
+
+/* Implement the la_print_typedef language method for Ada. */
+
+void
+ada_print_typedef (struct type *type, struct symbol *new_symbol,
+ struct ui_file *stream)
+{
+ type = ada_check_typedef (type);
+ ada_print_type (type, "", stream, 0, 0);
+ fprintf_filtered (stream, "\n");
+}