From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Subject: [PATCH 2/5] gas: squash (some) .linefile from listings
Date: Tue, 29 Nov 2022 11:36:59 +0100 [thread overview]
Message-ID: <2ae84a68-29f3-d94d-1a12-c3d0c81f81a3@suse.com> (raw)
In-Reply-To: <9afdf9c8-323b-78c1-d75b-8964e00cdec5@suse.com>
Not so long ago we started to insert these artificially when expanding
certain macro-like constructs; zap them as cluttering what actually
results from user input.
---
We may want to also zap ones resulting from "# <line> <file>", albeit
these anyway appear in listings only when assembling from stdin. Such
zapping also would need to happen elsewhere and/or in a different
manner.
Slightly RFC: Am I at risk of zapping a label named "linefile" this way?
(At least we can assume that this directive is the only think on a line,
_if_ it is a directive, for being internal only.) If so, lifting
buffer_and_nest()'s respective logic into a helper function may be the
way to go.
--- a/gas/read.c
+++ b/gas/read.c
@@ -867,7 +867,10 @@ read_a_source_file (const char *name)
/* Find the end of the current expanded macro line. */
s = find_end_of_line (input_line_pointer, flag_m68k_mri);
- if (s != last_eol)
+ if (s != last_eol
+ && !startswith (input_line_pointer,
+ !flag_m68k_mri ? " .linefile "
+ : " linefile "))
{
char *copy;
size_t len;
next prev parent reply other threads:[~2022-11-29 10:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 10:34 [PATCH 0/5] gas: diagnostics for macros and some tidying Jan Beulich
2022-11-29 10:36 ` [PATCH 1/5] gas: avoid inserting extra newline in buffer_and_nest() Jan Beulich
2022-11-29 10:36 ` Jan Beulich [this message]
2022-11-29 10:37 ` [PATCH 3/5] gas: add Dwarf line number test for .macro expansions Jan Beulich
2022-11-29 10:38 ` [PATCH 4/5] Arm: avoid unhelpful use of .macro in testsuite Jan Beulich
2022-11-29 10:44 ` [PATCH 5/5] gas: re-work line number tracking for macros and their expansions Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ae84a68-29f3-d94d-1a12-c3d0c81f81a3@suse.com \
--to=jbeulich@suse.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).