From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 808C5388CC18; Thu, 3 Sep 2020 10:30:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 808C5388CC18 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/26546] [pie] Setting breakpoint on missing label sets breakpoint at offset 0 in NULL section Date: Thu, 03 Sep 2020 10:30:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints 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: Thu, 03 Sep 2020 10:30:14 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26546 --- Comment #2 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=3D8f5c6526ebbd= 8b5749dd2f348796b53f3e2b25ee commit 8f5c6526ebbd8b5749dd2f348796b53f3e2b25ee Author: Tom de Vries Date: Thu Sep 3 12:30:10 2020 +0200 [gdb/breakpoint, PIE] Handle setting breakpoint on label without address When adding: ... if ![runto_main] then { fail "can't run to main" return 0 } ... to test-case gdb.base/label-without-address.exp and running it with tar= get board unix/-fPIE/-pie, we run into: ... (gdb) break main:L1^M Breakpoint 2 at 0x555555554000: file label-without-address.c, line 22.^M ... That is, for a label with optimized-out address, we set a breakpoint at= the relocation base. The root cause is that the dwarf reader, despite finding that attribute DW_AT_low_pc is missing, still tags the L1 symbol as having LOC_LABEL, which means it has a valid address, which defaults to 0. Fix this by instead tagging the L1 symbol with LOC_OPTIMIZED_OUT. Tested on x86_64-linux. gdb/ChangeLog: 2020-09-03 Tom de Vries PR breakpoint/26546 * dwarf2/read.c (new_symbol): Tag label symbol without DW_AT_lo= w_pc as LOC_OPTIMIZED_OUT instead of LOC_LABEL. gdb/testsuite/ChangeLog: 2020-09-03 Tom de Vries PR breakpoint/26546 * gdb.base/label-without-address.exp: Runto main first. --=20 You are receiving this mail because: You are on the CC list for the bug.=