+2010-04-20 Joel Brobecker <brobecker@adacore.com>
+
+ * 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.
+
2010-04-20 Joel Brobecker <brobecker@adacore.com>
* procfs.c (procfs_address_to_host_pointer): Only define when used.
ada_printstr, /* Function to print string constant */
emit_char, /* Function to print single char (not used) */
ada_print_type, /* Print a type using appropriate syntax */
- default_print_typedef, /* Print a typedef using appropriate syntax */
+ ada_print_typedef, /* Print a typedef using appropriate syntax */
ada_val_print, /* Print a value using appropriate syntax */
ada_value_print, /* Print a top-level value */
NULL, /* Language specific skip_trampoline */
extern void ada_print_type (struct type *, char *, struct ui_file *, int,
int);
+extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
+ struct ui_file *stream);
+
extern int ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
struct ui_file *, int,
const struct value_print_options *);
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");
+}
+2010-04-20 Joel Brobecker <brobecker@adacore.com>
+
+ * info_types.c, info_types.exp: New files.
+
2010-04-20 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/dyn_loc: New testcase.
--- /dev/null
+/* This test program is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+typedef int new_integer_type;
+
+void
+do_something (int *val)
+{
+ *val = *val + 1;
+}
+
+int
+main (void)
+{
+ new_integer_type toto = 30;
+
+ do_something(&toto);
+ return 0;
+}
+
--- /dev/null
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile info_types
+set srcfile ${testfile}.c
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } {
+ return -1
+}
+
+# Force the language to Ada. We used a C program because it was trivial
+# to get a typedef type, but the situation we are trying to reproduce is
+# when the Ada language is being used.
+gdb_test "set lang ada" ""
+
+set eol "\[\r\n\]+"
+
+gdb_test "info types new_integer_type" \
+ "All types matching regular expression \"new_integer_type\":${eol}File .*info_types.c:${eol}int"
+