2001-02-20 Andreas Jaeger <aj@suse.de>
[deliverable/binutils-gdb.git] / gas / as.c
index 2f78cad486addaa08695eb4ab35d1b7d68f8c1ff..8c7493db2a49215c42f0a8874f8f84d8873bb37a 100644 (file)
--- a/gas/as.c
+++ b/gas/as.c
@@ -1,5 +1,5 @@
 /* as.c - GAS main program.
-   Copyright (C) 1987, 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+   Copyright (C) 1987, 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -40,6 +40,7 @@
 #include "output-file.h"
 #include "sb.h"
 #include "macro.h"
+#include "dwarf2dbg.h"
 
 #ifdef HAVE_ITBL_CPU
 #include "itbl-ops.h"
@@ -68,7 +69,7 @@ static char *listing_filename = NULL;
 
 /* Type of debugging to generate.  */
 
-enum debug_info_type debug_type = DEBUG_NONE;
+enum debug_info_type debug_type = DEBUG_UNSPECIFIED;
 
 /* Maximum level of macro nesting.  */
 int max_macro_nest = 100;
@@ -91,8 +92,7 @@ int debug_memory = 0;
 /* We build a list of defsyms as we read the options, and then define
    them after we have initialized everything.  */
 
-struct defsym_list
-{
+struct defsym_list {
   struct defsym_list *next;
   char *name;
   valueT value;
@@ -102,8 +102,7 @@ static struct defsym_list *defsyms;
 
 /* Keep a record of the itbl files we read in.  */
 
-struct itbl_file_list
-{
+struct itbl_file_list {
   struct itbl_file_list *next;
   char *name;
 };
@@ -266,6 +265,8 @@ Options:\n\
   fprintf (stream, _("\
   --help                  show this message and exit\n"));
   fprintf (stream, _("\
+  --target-help           show target specific options\n"));
+  fprintf (stream, _("\
   -I DIR                  add DIR to search list for .include directives\n"));
   fprintf (stream, _("\
   -J                      don't warn about signed overflow\n"));
@@ -350,24 +351,23 @@ parse_args (pargc, pargv)
 
   char *shortopts;
   extern CONST char *md_shortopts;
-  static const char std_shortopts[] =
-    {
-      '-', 'J',
+  static const char std_shortopts[] = {
+    '-', 'J',
 #ifndef WORKING_DOT_WORD
-      /* -K is not meaningful if .word is not being hacked.  */
-      'K',
+    /* -K is not meaningful if .word is not being hacked.  */
+    'K',
 #endif
-      'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':',
+    'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':',
 #ifndef VMS
-      /* -v takes an argument on VMS, so we don't make it a generic
-         option.  */
-      'v',
+    /* -v takes an argument on VMS, so we don't make it a generic
+       option.  */
+    'v',
 #endif
-      'w', 'X',
-      /* New option for extending instruction set (see also --itbl below)  */
-      't', ':',
-      '\0'
-    };
+    'w', 'X',
+    /* New option for extending instruction set (see also --itbl below)  */
+    't', ':',
+    '\0'
+  };
   struct option *longopts;
   extern struct option md_longopts[];
   extern size_t md_longopts_size;
@@ -419,8 +419,12 @@ parse_args (pargc, pargv)
     {"no-warn", no_argument, NULL, 'W'},
 #define OPTION_WARN (OPTION_STD_BASE + 18)
     {"warn", no_argument, NULL, OPTION_WARN},
-#define OPTION_WARN_FATAL (OPTION_STD_BASE + 19)
+#define OPTION_TARGET_HELP (OPTION_STD_BASE + 19)
+    {"target-help", no_argument, NULL, OPTION_TARGET_HELP},
+#define OPTION_WARN_FATAL (OPTION_STD_BASE + 20)
     {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
+    /* When you add options here, check that they do not collide with
+       OPTION_MD_BASE.  See as.h.  */
   };
 
   /* Construct the option lists from the standard list and the target
@@ -474,7 +478,7 @@ parse_args (pargc, pargv)
                 VMS code in md_parse_option can return 0 in that case,
                 but it has no way of pushing the filename argument back.  */
              if (optarg && *optarg)
-               new_argv[new_argc++] = optarg,  new_argv[new_argc] = NULL;
+               new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL;
              else
 #else
              case 'v':
@@ -495,6 +499,10 @@ parse_args (pargc, pargv)
          new_argv[new_argc] = NULL;
          break;
 
+       case OPTION_TARGET_HELP:
+          md_show_usage (stdout);
+          exit (EXIT_SUCCESS);
+
        case OPTION_HELP:
          show_usage (stdout);
          exit (EXIT_SUCCESS);
@@ -517,7 +525,7 @@ parse_args (pargc, pargv)
        case OPTION_VERSION:
          /* This output is intended to follow the GNU standards document.  */
          printf (_("GNU assembler %s\n"), VERSION);
-         printf (_("Copyright 2000 Free Software Foundation, Inc.\n"));
+         printf (_("Copyright 2001 Free Software Foundation, Inc.\n"));
          printf (_("\
 This program is free software; you may redistribute it under the terms of\n\
 the GNU General Public License.  This program has absolutely no warranty.\n"));
@@ -878,6 +886,10 @@ main (argc, argv)
   md_end ();
 #endif
 
+  /* If we've been collecting dwarf2 .debug_line info, either for
+     assembly debugging or on behalf of the compiler, emit it now.  */
+  dwarf2_finish ();
+
   if (seen_at_least_1_file ()
       && (flag_always_generate_output || had_errors () == 0))
     keep_it = 1;
This page took 0.041898 seconds and 4 git commands to generate.