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

--- Comment #5 from Mark Wielaard <mark at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> # 82 "s-atocou.adb" 1
> isn't a .file assignment though.
> As I said earlier, if we don't want to revert the r11-3693 change and be
> able to specify -gdwarf-5 etc. to gas even when compiling files that contain
> explicit .debug_info from the compiler, then we need gas to act as if all
> that option affects is the version of the .debug_line emitted for explicit
> .file*/.loc* directives if present and nothing else (whenever the assembly
> contains manual
> .file*/.loc* directives or .debug_{info,line,...} sections).

That is the intention indeed, and I believe that is what binutils gas should be
doing. There used to be a bug where that didn't work for .file 1, but I thought
that was fixed upstream. Is this different from
https://sourceware.org/bugzilla/show_bug.cgi?id=26740

The assembly posted doesn't seem complete, what does ada really pass to gas?

>  So, basically,
> gas can start preparing for generation of its own .debug_* sections but
> should roll all that back when it sees .file/.loc directives or user
> .debug_{info,line} sections (perhaps some others).

Like I said above, that is the intention. So if it doesn't work like that it is
simply a bug in gas. It would be helpful to attach the preprocessed file that
ada generates to investigate what is really going on.

> Or, the other option is not to pass -gdwarf-5 to gas, but pass
> -gdwarf-line-version=5 or whatever other new option, which would only change
> the decision on if gas emits .debug_line section because of .file*/.loc*
> directives (and .debug_line is not present), what version of that to use.

That would be another option. But I like to first understand what is really
going on here.

Reply via email to