aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1997-08-19 03:45:56 +0000
committerRichard Henderson <rth@redhat.com>1997-08-19 03:45:56 +0000
commit96e0ff4665a86d9d3348a0453507e08880f99146 (patch)
tree19648256e34012c46ffd72b366426e5b52cade02 /gas/read.c
parent36339ecd2b90b159b9e52d642e94e29d1ccc48ba (diff)
downloadgdb-96e0ff4665a86d9d3348a0453507e08880f99146.zip
gdb-96e0ff4665a86d9d3348a0453507e08880f99146.tar.gz
gdb-96e0ff4665a86d9d3348a0453507e08880f99146.tar.bz2
* as.c (show_usage): Add -am.
* input-scrub.c (input_scrub_include_sb): Don't add leading \n if we've already got one. * listing.c (struct list_info_struct): Add line_contents. (listing_newline): Put unused argument to work: if non-null, save it... (listing_listing): ... and regurgitate during listing instead of line from file. * listing.h (LISTING_MACEXP): New define. (LISTING_NEWLINE): Argument is NULL. * read.c (read_a_source_file): If expanding macros, break up input lines and pass them to listing_newline. * doc/as.texinfo: Document -ac and -am. * cond.c (s_ifc): Add missing demand_empty_rest_of_line.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/gas/read.c b/gas/read.c
index 791ca88..ab66ffe 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -487,7 +487,7 @@ read_a_source_file (name)
buffer = input_scrub_new_file (name);
listing_file (name);
- listing_newline ("");
+ listing_newline (NULL);
register_dependency (name);
while ((buffer_limit = input_scrub_next_buffer (&input_line_pointer)) != 0)
@@ -602,7 +602,39 @@ read_a_source_file (name)
c = *input_line_pointer++;
}
know (c != ' '); /* No further leading whitespace. */
- LISTING_NEWLINE ();
+
+#ifndef NO_LISTING
+ /* If listing is on, and we are expanding a macro, then give
+ the listing code the contents of the expanded line. */
+ if (listing)
+ {
+ if ((listing & LISTING_MACEXP) && macro_nest > 0)
+ {
+ char *copy;
+ int len;
+
+ /* Find the end of the current expanded macro line. */
+ for (s = input_line_pointer-1; *s ; ++s)
+ if (is_end_of_line[(unsigned char) *s])
+ break;
+
+ /* Copy it for safe keeping. Also give an indication of
+ how much macro nesting is involved at this point. */
+ len = s - (input_line_pointer-1);
+ copy = (char *) xmalloc (len + macro_nest + 2);
+ memset (copy, '>', macro_nest);
+ copy[macro_nest] = ' ';
+ memcpy (copy + macro_nest + 1, input_line_pointer-1, len);
+ copy[macro_nest+1+len] = '\0';
+
+ /* Install the line with the listing facility. */
+ listing_newline (copy);
+ }
+ else
+ listing_newline (NULL);
+ }
+#endif
+
/*
* C is the 1st significant character.
* Input_line_pointer points after that character.