diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-07-06 20:39:31 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-07-06 20:39:31 +0000 |
commit | 85a961c6a12151673dd31463b66ab32f742242e9 (patch) | |
tree | 746d5de9d666ef652888f44adcb4cf2858814dd0 /gas/as.c | |
parent | 1d5d75e90a9b5056199ad43a521c3a77bce6fc2a (diff) | |
download | gdb-85a961c6a12151673dd31463b66ab32f742242e9.zip gdb-85a961c6a12151673dd31463b66ab32f742242e9.tar.gz gdb-85a961c6a12151673dd31463b66ab32f742242e9.tar.bz2 |
Patches from Jerry Blakely <gerry_blakley@wellfleet.com>:
* as.c (listing_filename): New static variable.
(show_usage): Mention -a=file.
(parse_args): Support = option of -a to set name of listing file.
(main): Pass listing_filename to listing_print.
* listing.c (list_file): New static variable.
(various): Replace printf with fprintf to list_file.
(listing_print): If name argument is not NULL, open it as
list_file.
* doc/as.texinfo, doc/as.1: Document -a=file.
PR 6354.
Diffstat (limited to 'gas/as.c')
-rw-r--r-- | gas/as.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -45,6 +45,8 @@ static void perform_an_assembly_pass PARAMS ((int argc, char **argv)); int listing; /* true if a listing is wanted */ +static char *listing_filename = NULL; /* Name of listing file. */ + char *myname; /* argv[0] */ #ifdef BFD_ASSEMBLER segT reg_section, expr_section; @@ -81,7 +83,8 @@ Options:\n\ h include high-level source\n\ l include assembly\n\ n omit forms processing\n\ - s include symbols\n"); + s include symbols\n\ + =file set listing file name (must be last sub-option)\n"); fprintf (stream, "\ -D produce assembler debugging messages\n\ -f skip whitespace and comment preprocessing\n\ @@ -401,6 +404,12 @@ parse_args (pargc, pargv) case 's': listing |= LISTING_SYMBOLS; break; + case '=': + listing_filename = strdup (optarg + 1); + if (listing_filename == NULL) + as_fatal ("virtual memory exhausted"); + optarg += strlen (listing_filename); + break; default: as_fatal ("invalid listing option `%c'", *optarg); break; @@ -528,7 +537,7 @@ main (argc, argv) write_object_file (); #ifndef NO_LISTING - listing_print (""); + listing_print (listing_filename); #endif #ifndef OBJ_VMS /* does its own file handling */ |