if (pdi->name != NULL || pdi->tag == DW_TAG_namespace
|| pdi->tag == DW_TAG_module || pdi->tag == DW_TAG_enumeration_type
- || pdi->tag == DW_TAG_imported_unit)
+ || pdi->tag == DW_TAG_imported_unit
+ || pdi->tag == DW_TAG_inlined_subroutine)
{
switch (pdi->tag)
{
case DW_TAG_subprogram:
+ case DW_TAG_inlined_subroutine:
add_partial_subprogram (pdi, lowpc, highpc, set_addrmap, cu);
break;
case DW_TAG_constant:
switch (pdi->tag)
{
+ case DW_TAG_inlined_subroutine:
case DW_TAG_subprogram:
addr = gdbarch_adjust_dwarf2_addr (gdbarch, pdi->lowpc + baseaddr);
if (pdi->is_external || cu->language == language_ada)
scan_partial_symbols (pdi->die_child, lowpc, highpc, set_addrmap, cu);
}
-/* Read a partial die corresponding to a subprogram and create a partial
- symbol for that subprogram. When the CU language allows it, this
- routine also defines a partial symbol for each nested subprogram
- that this subprogram contains. If SET_ADDRMAP is true, record the
- covered ranges in the addrmap. Set *LOWPC and *HIGHPC to the lowest
- and highest PC values found in PDI.
+/* Read a partial die corresponding to a subprogram or an inlined
+ subprogram and create a partial symbol for that subprogram.
+ When the CU language allows it, this routine also defines a partial
+ symbol for each nested subprogram that this subprogram contains.
+ If SET_ADDRMAP is true, record the covered ranges in the addrmap.
+ Set *LOWPC and *HIGHPC to the lowest and highest PC values found in PDI.
PDI may also be a lexical block, in which case we simply search
recursively for subprograms defined inside that lexical block.
CORE_ADDR *lowpc, CORE_ADDR *highpc,
int set_addrmap, struct dwarf2_cu *cu)
{
- if (pdi->tag == DW_TAG_subprogram)
+ if (pdi->tag == DW_TAG_subprogram || pdi->tag == DW_TAG_inlined_subroutine)
{
if (pdi->has_pc_info)
{
{
fixup_partial_die (pdi, cu);
if (pdi->tag == DW_TAG_subprogram
+ || pdi->tag == DW_TAG_inlined_subroutine
|| pdi->tag == DW_TAG_lexical_block)
add_partial_subprogram (pdi, lowpc, highpc, set_addrmap, cu);
pdi = pdi->die_sibling;
&& abbrev->tag != DW_TAG_constant
&& abbrev->tag != DW_TAG_enumerator
&& abbrev->tag != DW_TAG_subprogram
+ && abbrev->tag != DW_TAG_inlined_subroutine
&& abbrev->tag != DW_TAG_lexical_block
&& abbrev->tag != DW_TAG_variable
&& abbrev->tag != DW_TAG_namespace
--- /dev/null
+# Copyright 2017-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 foo
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
+ return -1
+}
+
+clean_restart ${testfile}
+
+if ![runto_main] then {
+ fail "Cannot run to main, testcase aborted"
+ return 0
+}
+
+# Check that inserting breakpoint on read_small inlined function inserts
+# 4 breakpoints.
+
+gdb_test "break read_small" \
+ "Breakpoint $decimal at $hex: read_small\\. \\(4 locations\\)" \
+ "set breakpoint at read_small"
+
+# We do not verify each breakpoint info, but use continue commands instead
+# to verify that we properly stop on each expected breakpoint.
+
+gdb_test "continue" \
+ "Breakpoint $decimal, b\\.doit \\(\\).*" \
+ "Hitting first call of read_small"
+
+gdb_test "continue" \
+ "Breakpoint $decimal, foo \\(\\).*" \
+ "Hitting second call of read_small"
+
+gdb_test "continue" \
+ "Breakpoint $decimal, c\\.c_doit \\(\\).*" \
+ "Hitting third call of read_small"
+
+gdb_test "continue" \
+ "Breakpoint $decimal, c\\.c_doit2 \\(\\).*" \
+ "Hitting fourth call of read_small"
+
+gdb_test "continue" \
+ "Continuing\..*$inferior_exited_re.*" \
+ "continuing to program completion"
--- /dev/null
+-- Copyright 2017-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 B is
+ Total : Natural := 0;
+ procedure Read_Small is
+ begin
+ Total := Total + 1; -- BREAK
+ end Read_Small;
+
+ procedure Doit is
+ begin
+ Read_Small;
+ null;
+ end Doit;
+end B;
--- /dev/null
+-- Copyright 2017-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 B is
+ procedure Read_Small with Inline_Always;
+ procedure Doit;
+end B;
--- /dev/null
+-- Copyright 2017-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 B;
+package body C is
+ procedure C_Doit is
+ begin
+ B.Read_Small;
+ C_Doit2;
+ end;
+ procedure C_Doit2 is
+ begin
+ B.Read_Small;
+ end;
+end C;
--- /dev/null
+-- Copyright 2017-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 C is
+ procedure C_Doit;
+ procedure C_Doit2;
+end C;
--- /dev/null
+-- Copyright 2017-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 B; use B;
+with C;
+procedure FOO is
+begin
+ Doit;
+ B.Read_Small;
+ C.C_Doit;
+end FOO;