+2018-01-05 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_to_fixed_value_create): Add handling of
+ the case where VALUE_LVAL (val0) is not lval_memory.
+
2018-01-05 Xavier Roirand <roirand@adacore.com>
* ada-valprint.c (print_optional_low_bound): Handle
if (type == type0 && val0 != NULL)
return val0;
- else
- return value_from_contents_and_address (type, 0, address);
+
+ if (VALUE_LVAL (val0) != lval_memory)
+ {
+ /* Our value does not live in memory; it could be a convenience
+ variable, for instance. Create a not_lval value using val0's
+ contents. */
+ return value_from_contents (type, value_contents (val0));
+ }
+
+ return value_from_contents_and_address (type, 0, address);
}
/* A value representing VAL, but with a standard (static-sized) type
+2018-01-05 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/convvar_comp: New testcase.
+
2018-01-05 Xavier Roirand <roirand@adacore.com>
* testsuite/gdb.ada/array_char_idx/pck.ads (Table): New type.
--- /dev/null
+# Copyright 2018 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 pb16_063
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+if ![runto "break_me" ] then {
+ perror "Couldn't run ${testfile}"
+ return
+}
+
+gdb_test_no_output "set variable \$item := item"
+
+gdb_test "print \$item.started" \
+ " = \\(0, 0, 0\\)"
--- /dev/null
+-- Copyright 2018 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;
+
+procedure PB16_063 is
+ My_Item : Pck.T;
+ Ignored : Boolean;
+begin
+ My_Item := Pck.Null_T;
+ Ignored := Pck.Break_Me (My_Item);
+end PB16_063;
--- /dev/null
+-- Copyright 2018 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
+ function Break_Me (Item : T) return Boolean is
+ begin
+ return False;
+ end Break_Me;
+end Pck;
--- /dev/null
+-- Copyright 2018 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 Pck is
+
+ type Kind_T is (One, Two, Three);
+ -- type Kind_T is new Integer range 1 .. 3;
+ type Time_Set_T is array (Kind_T) of Integer;
+
+ type T is record
+ Started : Time_Set_T;
+ end record;
+
+ Null_T : constant T := (Started => (others => 0));
+
+ function Break_Me (Item : T) return Boolean;
+end Pck;