public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/98796] Incorrect .debug_line emitted for DWARF5
Date: Fri, 22 Jan 2021 21:38:05 +0000	[thread overview]
Message-ID: <bug-98796-4-lm9T6pOD6U@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98796-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:b485fa167ef35c8facbd7c21cb86fd1abc77efcf

commit r11-6868-gb485fa167ef35c8facbd7c21cb86fd1abc77efcf
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 22 22:37:36 2021 +0100

    dwarf2out: Always emit required 0 entries for DWARF 5 in *.debug_line
[PR98796]

    When GCC is emitting .debug_line or .gnu.debuglto_.debug_line section by
    itself (happens either with too old or non-GNU assembler, with
    -gno-as-loc-support or with -flto) on empty translation units, it violates
    the DWARF 5 requirements.
    The standard says:
    "The first entry is the current directory of the compilation."
    and a few lines later:
    "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."
    GCC emits 4 zeros (directory entry format count, directories count,
    filename entry format count and filename count), which would be ok if the
    spec said The first entry may be rather than is.

    I had a brief look at whether I could just fall through into the rest of
the
    function, but there are too many assumptions that there is at least one
    normal file that it can't be done that way easily.

    So this patch instead extends the early out code to emit the required
    minimum, which is 15 bytes more than we used to emit before.

    2021-01-22  Jakub Jelinek  <jakub@redhat.com>

            PR debug/98796
            * dwarf2out.c (output_file_names): For -gdwarf-5, if there are no
            filenames to emit, still emit the required 0 index directory and
            filename entries that match DW_AT_comp_dir and DW_AT_name of the
            compilation unit.

  parent reply	other threads:[~2021-01-22 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 14:19 [Bug debug/98796] New: " jakub at gcc dot gnu.org
2021-01-22 14:19 ` [Bug debug/98796] " jakub at gcc dot gnu.org
2021-01-22 14:39 ` jakub at gcc dot gnu.org
2021-01-22 21:38 ` cvs-commit at gcc dot gnu.org [this message]
2021-01-22 21:40 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98796-4-lm9T6pOD6U@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).