From: Richard Henderson Date: Tue, 19 Aug 1997 03:45:56 +0000 (+0000) Subject: * as.c (show_usage): Add -am. X-Git-Tag: gdb-4_18~5002 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96e0ff4665a86d9d3348a0453507e08880f99146;p=platform%2Fupstream%2Fbinutils.git * 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. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 65c16cf..4fc7d11 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,20 @@ +Mon Aug 18 20:33:06 1997 Richard Henderson + + * 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. + Mon Aug 18 11:26:36 1997 Nick Clifton * config/tc-v850.c (md_apply_fix3): Add support for new 16 bit PC 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.