From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C3589388883D; Tue, 29 Mar 2022 12:24:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3589388883D From: "mark at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/105088] Small DWARF 5 spec violation in line table when passing an absolute path Date: Tue, 29 Mar 2022 12:24:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2022 12:24:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105088 --- Comment #11 from Mark Wielaard --- I believe the intention of the DWARF5 spec as that dir entry zero would be equal to the comp_dir attribute of the CU and file entry zero would be equa= l to the name attribute of the CU. Also, although the spec does not explicitly seem to say so, consumers take = an absolute source path to mean that the file isn't relative to the compilation dir. So if the current working directory is my home dir and I compile a source f= ile /tmp/test.c then I would expect the Compile Unit DIE to have the following = two attributes: name (line_strp) "/tmp/test.c" comp_dir (line_strp) "/home/mark" And the dir/line table to match with: Directory table: [path(line_strp)] 0 /home/mark (23) File name table: [path(line_strp), directory_index(udata)] 0 /tmp/test.c (52), 0 gcc tries to make that happen using the following .file 0 entry: .file 0 "/home/mark" "/tmp/test.c" So if that is no longer the case, then I think binutils gas is getting this wrong now.=