From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 52A343857C72; Thu, 16 Jul 2020 21:18:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52A343857C72 From: "palves at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/26243] Handle line number 0 in line table produced by clang Date: Thu, 16 Jul 2020 21:18:43 +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: palves at redhat dot com 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: Thu, 16 Jul 2020 21:18:43 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26243 --- Comment #11 from Pedro Alves --- I tried my patch against the testcase from Tom's proposed patch on the mail= ing list, and that results in: Running /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.dwarf2/dw2-line-number-z= ero.exp ... FAIL: gdb.dwarf2/dw2-line-number-zero.exp: bar2, 2nd next KPASS: gdb.dwarf2/dw2-line-number-zero.exp: continue to breakpoint: bar1_label_3 (PRMS gdb/nnnnn) KPASS: gdb.dwarf2/dw2-line-number-zero.exp: continue to breakpoint: bar2_label_3 (PRMS gdb/nnnnn) The FAIL is because GDB is not figuring out the length of the "bar2" functi= on correctly: (gdb) disassemble bar2 Dump of assembler code for function bar2: 0x00000000004004c0 <+0>: push %rbp 0x00000000004004c1 <+1>: mov %rsp,%rbp 0x00000000004004c4 <+4>: mov $0x1,%edi 0x00000000004004c9 <+9>: call 0x400487 0x00000000004004ce <+14>: mov $0x2,%edi 0x00000000004004d3 <+19>: call 0x400487 End of assembler dump. (gdb) q So after that "next", the program stops at an address outside of the functi= on, and so the patch's still-in-same-function logic doesn't apply. I.e., seems like either there's a bug elsewhere, where bar2's length is determined, or the testcase has a bug. The other two calls to foo should be part of the function too. Interestingly, if you try to set a breakpoint just by number using Tom's testcase (with or without his proposed fix), GDB crashes...: (gdb) b 54 Aborted (core dumped) Sigh. --=20 You are receiving this mail because: You are on the CC list for the bug.=