From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B35723887006; Wed, 3 Jun 2020 21:50:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B35723887006 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/26046] Missing breakpoint location without -readnow Date: Wed, 03 Jun 2020 21:50:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2020 21:50:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26046 --- Comment #3 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df9b5d5ea18a3= 878ca48c1b747e35d456133858bc commit f9b5d5ea18a3878ca48c1b747e35d456133858bc Author: Tom de Vries Date: Wed Jun 3 23:50:16 2020 +0200 [gdb/symtab] Fix missing breakpoint location for inlined function Consider the test-case contained in this patch. With -readnow, we have two breakpoint locations: ... $ gdb -readnow -batch breakpoint-locs -ex "b N1::C1::baz" -ex "info bre= ak" Breakpoint 1 at 0x4004cb: N1::C1::baz. (2 locations) Num Type Disp Enb Address What 1 breakpoint keep y 1.1 y 0x00000000004004cb in N1::C1::baz() \ at breakpoint-locs= .h:6 1.2 y 0x00000000004004f0 in N1::C1::baz() \ at breakpoint-locs= .h:6 ... But without -readnow, we have instead only one breakpoint location: ... $ gdb -batch breakpoint-locs -ex "b N1::C1::baz" -ex "info break" Breakpoint 1 at 0x4004f0: file breakpoint-locs.h, line 6. Num Type Disp Enb Address What 1 breakpoint keep y 0x00000000004004f0 in N1::C1::baz() \ at breakpoint-locs= .h:6 ... The relevant dwarf is this bit: ... <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_name : breakpoint-locs.cc <1>: Abbrev Number: 2 (DW_TAG_namespace) DW_AT_name : N1 <2>: Abbrev Number: 3 (DW_TAG_class_type) DW_AT_name : C1 <3><109>: Abbrev Number: 4 (DW_TAG_subprogram) <10a> DW_AT_name : baz <110> DW_AT_linkage_name: _ZN2N12C13bazEv <2><116>: Abbrev Number: 5 (DW_TAG_subprogram) <117> DW_AT_name : foo <11d> DW_AT_linkage_name: _ZN2N13fooEv <1><146>: Abbrev Number: 8 (DW_TAG_subprogram) <147> DW_AT_specification: <0x116> <14b> DW_AT_low_pc : 0x4004c7 <153> DW_AT_high_pc : 0x10 <2><161>: Abbrev Number: 9 (DW_TAG_inlined_subroutine) <162> DW_AT_abstract_origin: <0x194> <166> DW_AT_low_pc : 0x4004cb <16e> DW_AT_high_pc : 0x9 <1><194>: Abbrev Number: 12 (DW_TAG_subprogram) <195> DW_AT_specification: <0x109> <199> DW_AT_inline : 3 (declared as inline and inlined) ... The missing breakpoint location is specified by DIE 0x161, which is ign= ored by the partial DIE reader because it's a child of a DW_TAG_subprogram DIE = (at 0x146, for foo). Fix this by not ignoring the DIE during partial DIE reading. Tested on x86_64-linux. gdb/ChangeLog: 2020-06-03 Tom de Vries PR symtab/26046 * dwarf2/read.c (scan_partial_symbols): Recurse into DW_TAG_subprogram children for C++. (load_partial_dies): Don't skip DW_TAG_inlined_subroutine child= of DW_TAG_subprogram. gdb/testsuite/ChangeLog: 2020-06-03 Tom de Vries PR symtab/26046 * gdb.cp/breakpoint-locs-2.cc: New test. * gdb.cp/breakpoint-locs.cc: New test. * gdb.cp/breakpoint-locs.exp: New file. * gdb.cp/breakpoint-locs.h: New test. --=20 You are receiving this mail because: You are on the CC list for the bug.=