aboutsummaryrefslogtreecommitdiff
path: root/gas/macro.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-12-16 09:01:14 +0100
committerJan Beulich <jbeulich@suse.com>2022-12-16 09:01:14 +0100
commit22a8433e00fd33efcb1fa4961eb826cd97f2cd8b (patch)
tree0ccd9c48c3a0b29a69264f07303924fae4500c03 /gas/macro.c
parent689933867ad45487751a6bb411e69cd91ef24990 (diff)
downloadgdb-22a8433e00fd33efcb1fa4961eb826cd97f2cd8b.zip
gdb-22a8433e00fd33efcb1fa4961eb826cd97f2cd8b.tar.gz
gdb-22a8433e00fd33efcb1fa4961eb826cd97f2cd8b.tar.bz2
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 work around it by a (suspicious to me already at the time) conditional in as_where().
Diffstat (limited to 'gas/macro.c')
-rw-r--r--gas/macro.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gas/macro.c b/gas/macro.c
index c41b9c0..714fca5 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -120,8 +120,7 @@ buffer_and_nest (const char *from, const char *to, sb *ptr,
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 char *to, sb *ptr,
xfree (linefile);
}
+ line_start = ptr->len;
+ more = get_line (ptr);
while (more)
{
/* Try to find the first pseudo op on the line. */