public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/105088] New: Small DWARF 5 spec violation in line table when passing an absolute path
@ 2022-03-28 17:38 simon.marchi at polymtl dot ca
  2022-03-28 17:48 ` [Bug debug/105088] " simon.marchi at polymtl dot ca
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: simon.marchi at polymtl dot ca @ 2022-03-28 17:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105088

            Bug ID: 105088
           Summary: Small DWARF 5 spec violation in line table when
                    passing an absolute path
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: simon.marchi at polymtl dot ca
  Target Milestone: ---

With:

$ gcc --version
gcc (GCC) 11.2.0
$ as --version
GNU assembler (GNU Binutils) 2.38


I have a source file at /tmp/cwd/test.c and compile it with:

$ gcc /tmp/cwd/test.c -g3 -O0 -gdwarf-5

The DW_AT_name of the CU is "/tmp/cwd/test.c":

    <12>   DW_AT_name        : (line_strp) (offset: 0xd): /tmp/cwd/test.c

The entry at index 0 in the file names table, in the line table header, is
"test.c":

0       (udata) 1       (line_strp)     (offset: 0x16): test.c

In section 6.2.4 (The Line Number Program Header), bullet 20 (file_names),
DWARF5.pdf says:

> The first entry in the sequence is the primary source file whose file name
exactly matches that given in the DW_AT_name attribute in the compilation
unit debugging information entry.

The debug info produced by the toolchain therefore seems to not respect the
spec: the name of the primary source file in the line table header ("test.c")
does not match the DW_AT_name attribute in the compilation unit DIE
("/tmp/cwd/test.c").

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-03-29 12:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 17:38 [Bug debug/105088] New: Small DWARF 5 spec violation in line table when passing an absolute path simon.marchi at polymtl dot ca
2022-03-28 17:48 ` [Bug debug/105088] " simon.marchi at polymtl dot ca
2022-03-29  7:37 ` rguenth at gcc dot gnu.org
2022-03-29  8:33 ` marxin at gcc dot gnu.org
2022-03-29  8:35 ` jakub at gcc dot gnu.org
2022-03-29  8:39 ` jakub at gcc dot gnu.org
2022-03-29  8:48 ` ebotcazou at gcc dot gnu.org
2022-03-29  8:52 ` jakub at gcc dot gnu.org
2022-03-29  8:57 ` jakub at gcc dot gnu.org
2022-03-29  9:19 ` ebotcazou at gcc dot gnu.org
2022-03-29  9:24 ` jakub at gcc dot gnu.org
2022-03-29 12:24 ` mark at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).