aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-04-12 09:03:43 +0200
committerJan Beulich <jbeulich@suse.com>2022-04-12 09:03:43 +0200
commit657edeab3857130ddc005a88104711dd9e339ff0 (patch)
treeb4f040497736bddfd48df6a767b2c73ca0433762 /gas/read.c
parent2ee1792bec225ea19c71095cee5a3a9ae6df7c59 (diff)
downloadgdb-657edeab3857130ddc005a88104711dd9e339ff0.zip
gdb-657edeab3857130ddc005a88104711dd9e339ff0.tar.gz
gdb-657edeab3857130ddc005a88104711dd9e339ff0.tar.bz2
gas: further adjust file/line handling for .macro
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 .macro, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment while processing the expanded macro, while the goal of the PR gas/16908 workaround is to keep the expansion associated with the line invoking the macro. However, as soon as enough state was overridden _inside_ the macro to cause as_where() to no longer fall back top as_where_physical(), honor this by resuming the bumping of the logical line number. Note that from_sb_is_expansion's initializer was 1 for an unknown reason. While renaming the variable and changing its type, also change the initializer to "expanding_none", which would have been "0" in the original code. Originally the initializer value itself wasn't ever used anyway (requiring sb_index != -1), as it necessarily had changed in input_scrub_include_sb() alongside setting sb_index to other than -1. Strictly speaking input_scrub_insert_line() perhaps shouldn't use expanding_none, yet none of the other enumerators fit there either. And then strictly speaking that function probably shouldn't exist in the first place. It's used only by tic54x.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gas/read.c b/gas/read.c
index e96ce22..f9aa332 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -658,7 +658,7 @@ try_macro (char term, const char *line)
as_bad ("%s", err);
*input_line_pointer++ = term;
input_scrub_include_sb (&out,
- input_line_pointer, 1);
+ input_line_pointer, expanding_macro);
sb_kill (&out);
buffer_limit =
input_scrub_next_buffer (&input_line_pointer);
@@ -1411,7 +1411,7 @@ read_a_source_file (const char *name)
numbers and possibly file names will be incorrect. */
sb_build (&sbuf, new_length);
sb_add_buffer (&sbuf, new_buf, new_length);
- input_scrub_include_sb (&sbuf, input_line_pointer, 0);
+ input_scrub_include_sb (&sbuf, input_line_pointer, expanding_none);
sb_kill (&sbuf);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
free (new_buf);
@@ -2439,7 +2439,7 @@ s_irp (int irpc)
sb_kill (&s);
- input_scrub_include_sb (&out, input_line_pointer, 1);
+ input_scrub_include_sb (&out, input_line_pointer, expanding_repeat);
sb_kill (&out);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}
@@ -3140,7 +3140,7 @@ do_repeat (size_t count, const char *start, const char *end)
sb_kill (&one);
- input_scrub_include_sb (&many, input_line_pointer, 1);
+ input_scrub_include_sb (&many, input_line_pointer, expanding_repeat);
sb_kill (&many);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}
@@ -3198,7 +3198,7 @@ do_repeat_with_expander (size_t count,
sb_kill (&one);
- input_scrub_include_sb (&many, input_line_pointer, 1);
+ input_scrub_include_sb (&many, input_line_pointer, expanding_repeat);
sb_kill (&many);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}
@@ -6311,7 +6311,7 @@ input_scrub_insert_line (const char *line)
size_t len = strlen (line);
sb_build (&newline, len);
sb_add_buffer (&newline, line, len);
- input_scrub_include_sb (&newline, input_line_pointer, 0);
+ input_scrub_include_sb (&newline, input_line_pointer, expanding_none);
sb_kill (&newline);
buffer_limit = input_scrub_next_buffer (&input_line_pointer);
}