gas: further adjust file/line handling for .irp and alike
authorJan Beulich <jbeulich@suse.com>
Tue, 12 Apr 2022 07:03:13 +0000 (09:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Apr 2022 07:03:13 +0000 (09:03 +0200)
commit2ee1792bec225ea19c71095cee5a3a9ae6df7c59
treece92065f05ebf6d086191bcb901306c07fa64b5d
parent1a42a9fe4e60599bba1f047743a5b8b2ba96ee1f
gas: further adjust file/line handling for .irp and alike

Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp
and alike blocks"), while dealing okay with actual assembly source files
not using .file/.line and alike outside but not inside of .irp et al,
has undue effects when the logical file/line pair was already
overridden: Line numbers would continuously increment upon every
iteration, thus potentially getting far off. Furthermore it left it to
the user to actually insert .file/.line inside such constructs. Note
though that before aforementioned change things weren't pretty either:
Diagnostics (and debug info) would be associated with the directive
terminating the iteration construct, rather than with the actual lines.

Handle this automatically by simply latching the present line and then
re-instating coordinates first thing on every iteration; note that the
file can't change from what was previously pushed on the scrubber's
state stack, and hence can be taken from there by using a new flavor of
.linefile (which is far better memory-footprint-wise than recording the
full path in the inserted directive). (This then leaves undisturbed any
file/line control occurring in the body of the construct, as these will
only be seen and processed afterwards.)
17 files changed:
gas/input-scrub.c
gas/macro.c
gas/read.c
gas/testsuite/gas/aarch64/illegal-ldapr.l
gas/testsuite/gas/aarch64/illegal.l
gas/testsuite/gas/arm/mve-vctp-bad.l
gas/testsuite/gas/arm/mve-vldr-bad-3.l
gas/testsuite/gas/arm/mve-vldr-vstr-bad.l
gas/testsuite/gas/arm/mve-vqdmlah-bad.l
gas/testsuite/gas/arm/mve-vqdmlash-bad.l
gas/testsuite/gas/arm/mve-vrint-bad.l
gas/testsuite/gas/elf/dwarf-5-irp.d
gas/testsuite/gas/elf/dwarf-5-irp.s
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/elf/line.l [new file with mode: 0644]
gas/testsuite/gas/elf/line.s [new file with mode: 0644]
gas/testsuite/gas/mmix/err-greg1.s