* config/tc-sparc.c (md_show_usage): Add missing backslash at end
[deliverable/binutils-gdb.git] / gdb / main.c
index 42621ffa6ffde1fb39041a26367216843ec4eab2..11b5f87e875f9ea30d209bd4f832b5e8c5d71f62 100644 (file)
@@ -16,7 +16,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include <setjmp.h>
@@ -32,12 +32,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <ctype.h>
 
 #include "gdb_string.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifndef        NO_SYS_FILE
-#include <sys/file.h>
-#endif
 
 /* Temporary variable for SET_TOP_LEVEL.  */
 
@@ -140,7 +134,6 @@ main (argc, argv)
   current_directory = gdb_dirbuf;
 
   /* Parse arguments and options.  */
-#ifndef WIN32
   {
     int c;
     /* When var field is 0, use flag field to record the equivalent
@@ -284,6 +277,23 @@ main (argc, argv)
              else
                baud_rate = i;
            }
+         case 'l':
+           {
+             int i;
+             char *p;
+
+             i = strtol (optarg, &p, 0);
+             if (i == 0 && p == optarg)
+
+               /* Don't use *_filtered or warning() (which relies on
+                   current_target) until after initialize_all_files(). */
+
+               fprintf_unfiltered
+                 (gdb_stderr,
+                  "warning: could not set timeout limit to `%s'.\n", optarg);
+             else
+               remote_timeout = i;
+           }
            break;
 
 #ifdef ADDITIONAL_OPTION_CASES
@@ -297,6 +307,10 @@ main (argc, argv)
          }
       }
 
+    /* If --help or --version, disable window interface.  */
+    if (print_help || print_version)
+      use_windows = 0;
+
     /* OK, that's all the options.  The other arguments are filenames.  */
     count = 0;
     for (; optind < argc; optind++)
@@ -319,7 +333,6 @@ main (argc, argv)
       quiet = 1;
   }
 
-#endif
   gdb_init ();
 
   /* Do these (and anything which might call wrap_here or *_filtered)
@@ -382,7 +395,7 @@ For more information, type \"help\" from within GDB, or consult the\n\
 GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
       exit (0);
     }
-    
+
   if (!quiet)
     {
       /* Print all the junk at the top, with trailing "..." if we are about
@@ -413,7 +426,8 @@ GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
       strcpy (homeinit, getenv ("HOME"));
       strcat (homeinit, "/");
       strcat (homeinit, gdbinit);
-      if (!inhibit_gdbinit && access (homeinit, R_OK) == 0)
+
+      if (!inhibit_gdbinit)
        {
          if (!SET_TOP_LEVEL ())
            source_command (homeinit, 0);
@@ -507,7 +521,7 @@ GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
   
   if (!homedir
       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
-    if (!inhibit_gdbinit && access (gdbinit, R_OK) == 0)
+    if (!inhibit_gdbinit)
       {
        if (!SET_TOP_LEVEL ())
          source_command (gdbinit, 0);
@@ -557,17 +571,19 @@ GDB manual (available as on-line info or a printed manual).\n", gdb_stdout);
 
   if (display_space)
     {
+#ifdef HAVE_SBRK
       extern char **environ;
       char *lim = (char *) sbrk (0);
 
       printf_unfiltered ("Startup size: data size %ld\n",
                         (long) (lim - (char *) &environ));
+#endif
     }
 
   /* The default command loop. 
      The WIN32 Gui calls this main to set up gdb's state, and 
      has its own command loop. */
-#if !defined (WIN32)
+#ifndef _WIN32
   while (1)
     {
       if (!SET_TOP_LEVEL ())
@@ -594,16 +610,6 @@ init_proc ()
 {
 }
 
-int
-proc_wait (pid, status)
-     int pid;
-     int *status;
-{
-#ifndef __GO32__
-  return wait (status);
-#endif
-}
-
 void
 proc_remove_foreign (pid)
      int pid;
This page took 0.024855 seconds and 4 git commands to generate.