public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/101575] [gcc-11, -gdwarf-4] Missing .file <n> directive causes invalid line info
Date: Fri, 23 Jul 2021 12:22:22 +0000	[thread overview]
Message-ID: <bug-101575-4-wr0neB43em@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101575-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
I can of course make the .loc go away. If you really want that.

It is basically the DECL_SOURCE_LOCATION of an
otherwise ignored decl.  If the DECL_SOURCE_LOCATION
is UNKNOWN_LOCATION the function should have no line info,
and gdb should be able not to step into this function.

However the location does not look really wrong to me.
In create_subprog_decl it is taken over from input_location.
I could imagine that this is sometimes a misleading location.
But then in gnat_pushdecl we have
Sloc_to_locus (Sloc (gnat_node), &DECL_SOURCE_LOCATION (decl));
and it is again the same location.

In the test case the location points here:

        +---------------------------- column location
        v
   type Struct1 is limited record  <- line location
      X : Integer := 13;
      Y : Integer := 19;
   end record;

  parent reply	other threads:[~2021-07-23 12:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  9:37 [Bug debug/101575] New: " vries at gcc dot gnu.org
2021-07-22 12:30 ` [Bug debug/101575] " ebotcazou at gcc dot gnu.org
2021-07-22 12:32 ` vries at gcc dot gnu.org
2021-07-22 12:54 ` [Bug ada/101575] " ebotcazou at gcc dot gnu.org
2021-07-22 13:32 ` bernd.edlinger at hotmail dot de
2021-07-22 15:57 ` vries at gcc dot gnu.org
2021-07-22 16:00 ` vries at gcc dot gnu.org
2021-07-22 16:53 ` ebotcazou at gcc dot gnu.org
2021-07-23 12:22 ` bernd.edlinger at hotmail dot de [this message]
2021-07-23 12:36 ` vries at gcc dot gnu.org
2021-07-23 15:14 ` ebotcazou at gcc dot gnu.org
2021-07-24  7:43 ` bernd.edlinger at hotmail dot de
2021-07-24 11:21 ` bernd.edlinger at hotmail dot de
2021-07-24 12:24 ` ebotcazou at gcc dot gnu.org
2021-08-04 14:19 ` cvs-commit 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-101575-4-wr0neB43em@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).