From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4338A3888C57; Fri, 23 Jul 2021 12:22:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4338A3888C57 From: "bernd.edlinger at hotmail dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/101575] [gcc-11, -gdwarf-4] Missing .file directive causes invalid line info Date: Fri, 23 Jul 2021 12:22:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 11.1.1 X-Bugzilla-Keywords: wrong-debug X-Bugzilla-Severity: normal X-Bugzilla-Who: bernd.edlinger at hotmail dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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: Fri, 23 Jul 2021 12:22:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101575 --- Comment #8 from Bernd Edlinger --- 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 :=3D 13; Y : Integer :=3D 19; end record;=