+2015-09-03 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * ada-lang.c (ada_language_arch_info): Create a TYPE_CODE_CHAR
+ type instead of a TYPE_CODE_INT one for the string_char_type
+ and the ada_primitive_type_char types.
+
2015-09-03 Yao Qi <yao.qi@linaro.org>
* aarch64-linux-nat.c (aarch64_linux_region_ok_for_hw_watchpoint):
0, "short_integer");
lai->string_char_type
= lai->primitive_type_vector [ada_primitive_type_char]
- = arch_integer_type (gdbarch, TARGET_CHAR_BIT, 0, "character");
+ = arch_character_type (gdbarch, TARGET_CHAR_BIT, 0, "character");
lai->primitive_type_vector [ada_primitive_type_float]
= arch_float_type (gdbarch, gdbarch_float_bit (gdbarch),
"float", NULL);
+2015-09-03 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * gdb.ada/funcall_char.exp: New testcase.
+ * gdb.ada/funcall_char/foo.adb: New file.
+
2015-09-01 Pierre-Marie de Rodat <derodat@adacore.com>
* gdb.ada/complete.exp: Add "pck.ambiguous_func" to the relevant
--- /dev/null
+# Copyright 2015 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/>.
+
+load_lib "ada.exp"
+
+standard_ada_testfile foo
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "BREAK" ${testdir}/foo.adb]
+runto "foo.adb:$bp_location"
+
+# Make sure we can call a function that takes a character with a character
+# literal. If we cannot, then GDB will instead invoke the function that takes
+# an integer and will return a negative number.
+gdb_test "print f('A')" " = 65"
--- /dev/null
+-- Copyright 2015 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/>.
+
+procedure Foo is
+
+ function F (C : Character) return Integer is
+ begin
+ return Character'Pos (C);
+ end F;
+
+ function F (I : Integer) return Integer is
+ begin
+ return -I;
+ end F;
+
+ I1 : constant Integer := F ('A'); -- BREAK
+ I2 : constant Integer := F (1);
+
+begin
+ null;
+end Foo;