[PATCH v2 2/2] gas: re-work line number tracking for macros and their expansions
Jan Beulich
jbeulich@suse.com
Thu Dec 15 10:50:56 GMT 2022
More information about the Binutils mailing list
Thu Dec 15 10:50:56 GMT 2022
- Previous message (by thread): [PATCH v2 2/2] gas: re-work line number tracking for macros and their expansions
- Next message (by thread): [PATCH v2 2/2] gas: re-work line number tracking for macros and their expansions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 14.12.2022 17:58, Andrew Burgess wrote:
> Anyway, hopefully the reproducer helps track down the problem.
It did indeed. Below the patch that addresses the issue for me,
but before committing I will want to run this through the full set
of tests (after extending the testcase which didn't catch the issue).
Jan
gas: restore Dwarf info generation after macro diagnostic adjustments
While 6fdb723799e2 ("gas: re-work line number tracking for macros and
their expansions") was meant to leave generated Dwarf as is, it really
didn't (and the testcase intended to catch that wasn't covering the case
which broke). Its adjustment to buffer_and_nest() didn't go far enough,
leading to the "linefile" directive inserted at the top to also be
processed later in the PR gas/16908 workaround (which clearly isn't
intended - it's being put there for processing during macro expansion
only). That unnoticed flaw in turn led me to worked around it by a
(suspicious to me already at the time) conditional in as_where().
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -564,9 +564,6 @@ as_where (unsigned int *linep)
do
{
- if (!saved->is_linefile)
- break;
-
if (expansion != expanding_macro)
/* Nothing. */;
else if (saved->logical_input_file != NULL
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -120,8 +120,7 @@ buffer_and_nest (const char *from, const
size_t from_len;
size_t to_len = strlen (to);
int depth = 1;
- size_t line_start = ptr->len;
- size_t more = get_line (ptr);
+ size_t line_start, more;
if (to_len == 4 && strcasecmp (to, "ENDR") == 0)
{
@@ -147,6 +146,8 @@ buffer_and_nest (const char *from, const
xfree (linefile);
}
+ line_start = ptr->len;
+ more = get_line (ptr);
while (more)
{
/* Try to find the first pseudo op on the line. */
- Previous message (by thread): [PATCH v2 2/2] gas: re-work line number tracking for macros and their expansions
- Next message (by thread): [PATCH v2 2/2] gas: re-work line number tracking for macros and their expansions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list