+2013-11-19 Joel Brobecker <brobecker@adacore.com>
+
+ * python/py-value.c (is_intlike): Add TYPE_CODE_RANGE handling.
+
2013-11-19 Joel Brobecker <brobecker@adacore.com>
* contrib/ari/gdb_ari.sh: Remove checks for "dirent.h" and
|| TYPE_CODE (type) == TYPE_CODE_ENUM
|| TYPE_CODE (type) == TYPE_CODE_BOOL
|| TYPE_CODE (type) == TYPE_CODE_CHAR
+ || TYPE_CODE (type) == TYPE_CODE_RANGE
|| (ptr_ok && TYPE_CODE (type) == TYPE_CODE_PTR));
}
+2013-11-19 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/py_range: New testcase.
+
2013-11-18 Joel Brobecker <brobecker@adacore.com>
* mi-language.exp: Add "-list-features" test verifying that
--- /dev/null
+# Copyright 2013 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"
+load_lib gdb-python.exp
+
+standard_ada_testfile foo
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+# Skip this testcase if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
+
+set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
+runto "foo.adb:$bp_location"
+
+gdb_test "python print int(gdb.parse_and_eval('sr'))" \
+ "48"
+
+gdb_test "python print int(gdb.parse_and_eval('si'))" \
+ "740804"
+
+gdb_test "python print int(gdb.parse_and_eval('ir'))" \
+ "974"
--- /dev/null
+-- Copyright 2013 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/>.
+
+with Pck; use Pck;
+
+procedure Foo is
+ type Small is range -128 .. 127;
+ SR : Small := 48;
+
+ type Small_Integer is range -2 ** 31 .. 2 ** 31 - 1;
+ SI : Small_Integer := 740804;
+
+ type Integer4_T is range -2 ** 31 .. 2 ** 31 - 1;
+ for Integer4_T'Size use 32;
+ IR : Integer4_T := 974;
+begin
+ Do_Nothing (SR'Address); -- STOP
+ Do_Nothing (SI'Address);
+ Do_Nothing (IR'Address);
+end Foo;
--- /dev/null
+-- Copyright 2007-2013 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/>.
+
+package body Pck is
+
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+
+end Pck;
--- /dev/null
+-- Copyright 2007-2013 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/>.
+
+with System;
+
+package Pck is
+
+ procedure Do_Nothing (A : System.Address);
+
+end Pck;