Emit .file 0 directive earlier in DWARF 5
commita21dc9d1529b8a8071e36b22b6e8492fc2ce7d5a
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 24 Jun 2021 10:55:27 +0000 (24 12:55 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 24 Jun 2021 12:11:32 +0000 (24 14:11 +0200)
tree829f01cd963c51ac561180550349df52c3d3f7fb
parentaca1213627d1d5e5a70ce956cf227be9ae9b4022
Emit .file 0 directive earlier in DWARF 5

When the assembler supports it, the compiler automatically passes --gdwarf-5
to it, which has an interesting side effect: any assembly instruction prior
to the first .file directive defines a new line associated with .file 0 in
the .debug_line section and of course the numbering of these implicit lines
has nothing to do with that of the source code.  This can be problematic in
Ada when we do not generate .file/.loc directives for compiled-generated
functions to avoid too jumpy a debugging experience.

gcc/
* dwarf2out.c (dwarf2out_assembly_start): Emit .file 0 marker here..
(dwarf2out_finish): ...instead of here.
gcc/dwarf2out.c