+2014-05-05 Pierre-Marie de Rodat <derodat@adacore.com>
+
+ * dwarf2read.c (inherit_abstract_dies): Skip
+ DW_TAG_GNU_call_site dies while inheriting children of an
+ abstract DIE into a scope.
+ (read_lexical_block_scope): Inherit abstract DIE's for
+ lexical scopes.
+
2015-05-05 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (val_print_packed_array_elements): Delete
cleanups = make_cleanup (xfree, offsets);
offsets_end = offsets;
- child_die = die->child;
- while (child_die && child_die->tag)
+ for (child_die = die->child;
+ child_die && child_die->tag;
+ child_die = sibling_die (child_die))
{
+ struct die_info *child_origin_die;
+ struct dwarf2_cu *child_origin_cu;
+
+ /* We are trying to process concrete instance entries:
+ DW_TAG_GNU_call_site DIEs indeed have a DW_AT_abstract_origin tag, but
+ it's not relevant to our analysis here. i.e. detecting DIEs that are
+ present in the abstract instance but not referenced in the concrete
+ one. */
+ if (child_die->tag == DW_TAG_GNU_call_site)
+ continue;
+
/* For each CHILD_DIE, find the corresponding child of
ORIGIN_DIE. If there is more than one layer of
DW_AT_abstract_origin, follow them all; there shouldn't be,
but GCC versions at least through 4.4 generate this (GCC PR
40573). */
- struct die_info *child_origin_die = child_die;
- struct dwarf2_cu *child_origin_cu = cu;
-
+ child_origin_die = child_die;
+ child_origin_cu = cu;
while (1)
{
attr = dwarf2_attr (child_origin_die, DW_AT_abstract_origin,
else
*offsets_end++ = child_origin_die->offset;
}
- child_die = sibling_die (child_die);
}
qsort (offsets, offsets_end - offsets, sizeof (*offsets),
unsigned_int_compar);
child_die = sibling_die (child_die);
}
}
+ inherit_abstract_dies (die, cu);
newobj = pop_context ();
if (local_symbols != NULL || using_directives != NULL)
+2015-05-05 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/out_of_line_in_inlined: New testcase.
+
2015-05-05 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/var_rec_arr: New testcase.
--- /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_o224_021
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug optimize=-O2}] != ""} {
+ return -1
+}
+
+clean_restart ${testfile}
+
+# GCC currently is missing a DW_AT_origin attribute in one of the
+# lexical blocks, preventing GDB from creating a symbol for the
+# subprogram we want to break on.
+setup_xfail "*-*-*"
+gdb_test "break foo_o224_021.child1.child2" \
+ "Breakpoint \[0-9\]+ at.*: file .*foo_o224_021.adb, line \[0-9\]+."
--- /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/>.
+
+package body Bar is
+
+ procedure Do_Nothing (C : Character) is
+ begin
+ null;
+ end Do_Nothing;
+
+ function Get_Str (S1 : String; S2 : String := "") return Object_Type is
+ begin
+ return (Ada.Finalization.Controlled with Value => True);
+ end Get_Str;
+
+end Bar;
--- /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/>.
+
+with Ada.Finalization;
+
+package Bar is
+
+ type Object_Type is new Ada.Finalization.Controlled with record
+ Value : Boolean;
+ end record;
+
+ function Get_Str (S1 : String; S2 : String := "") return Object_Type;
+ procedure Do_Nothing (C : Character);
+
+end Bar;
--- /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/>.
+
+with Bar; use Bar;
+
+procedure Foo_O224_021 is
+ O1 : constant Object_Type := Get_Str ("Foo");
+
+ procedure Child1 is
+ O2 : constant Object_Type := Get_Str ("Foo");
+
+ function Child2 (S : String) return Boolean is -- STOP
+ begin
+ for C of S loop
+ Do_Nothing (C);
+ if C = 'o' then
+ return True;
+ end if;
+ end loop;
+ return False;
+ end Child2;
+
+ R : Boolean;
+
+ begin
+ R := Child2 ("Foo");
+ R := Child2 ("Bar");
+ R := Child2 ("Foobar");
+ end Child1;
+begin
+ Child1;
+end Foo_O224_021;