https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101575
--- Comment #11 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- (In reply to Eric Botcazou from comment #10) > > 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. > > But that's not the original design, which is that a DECL_IGNORED_P function > does not have .loc directives, like any other debugging information. Yes, indeed. DECL_IGNORED_P functions do also not have a block-structure and many other sophisticated features like variable locations. That does not change. The intended change is just that if a DECL_SOURCE_LOCATION is available it is shown in the debugger, and if there is no DECL_SOURCE_LOCATION, really no line number shall be shown. The motivation for this patch is the following: Unfortunately some non-DECL_IGNORED_P functions decay to DECL_IGNORED_P as shown in PR97937. While the test case there is written in "C", it is certainly also an issue for Ada. All that is left over from the original debug info is the DECL_SOURCE_LOCATION. Therefore the desire to at least show this source location, because previously a completely wrong line info from the preceding function was shown. And on the other hand, we have DECL_IGNORED_P functions that do not have any DECL_SOURCE_LOCATION right from the beginning. Therefore the patch does a lot to prevent line number info from the previous functions to extend to the following function where it will be misleading. But it will need some adjustments to also address DECL_IGNORED_P functions directly at the beginning of the CU, when dwarf-4 is used as in this PR.