From 7992631e8c0b0e711fbaba991348ef6f6e583725 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 23 Mar 2022 08:46:39 +0100 Subject: gas/Dwarf: improve debug info generation from .irp and alike blocks Tying the bumping of the logical line number to reading from the original source file looks wrong: Upon finishing of the processing of an sb the original values will be restored anyway. Yet without bumping the line counter uses of .line inside e.g. an .irp construct won't have the intended effect: Such uses may be necessary to ensure proper debug info is emitted in particular when switching sections inside the .irp body, as dwarf2_gen_line_info() would bail without doing anything when it finds the line number unchanged from what it saw last. --- gas/input-scrub.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gas/input-scrub.c') diff --git a/gas/input-scrub.c b/gas/input-scrub.c index 26af4fe..d9f1694 100644 --- a/gas/input-scrub.c +++ b/gas/input-scrub.c @@ -429,11 +429,10 @@ void bump_line_counters (void) { if (sb_index == (size_t) -1) - { - ++physical_input_line; - if (logical_input_line != -1u) - ++logical_input_line; - } + ++physical_input_line; + + if (logical_input_line != -1u) + ++logical_input_line; } /* Tells us what the new logical line number and file are. -- cgit v1.1