diff options
author | John Gilmore <gnu@cygnus> | 1991-08-14 00:11:20 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-08-14 00:11:20 +0000 |
commit | e522fb52bf667829017a29318fde85f123eb69da (patch) | |
tree | 765fafae03b6dda4b12864e42613be8f7f66c89b /gdb/main.c | |
parent | 715d2e0649266f405f7a394291d2f333cb7a41df (diff) | |
download | gdb-e522fb52bf667829017a29318fde85f123eb69da.zip gdb-e522fb52bf667829017a29318fde85f123eb69da.tar.gz gdb-e522fb52bf667829017a29318fde85f123eb69da.tar.bz2 |
* source.c: #if defined => #ifdef.
* main.c (main): Only try to attach "corefile" argument if
it starts with a digit.
Diffstat (limited to 'gdb/main.c')
-rw-r--r-- | gdb/main.c | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -3,19 +3,19 @@ This file is part of GDB. -GDB is free software; you can redistribute it and/or modify +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 1, or (at your option) -any later version. +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. -GDB is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GDB; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> int fclose (); @@ -28,9 +28,11 @@ int fclose (); #include "target.h" #include "breakpoint.h" -#include <getopt.h> -#include <readline/readline.h> -#include <readline/history.h> +#include "getopt.h" + +/* readline include files */ +#include "readline.h" +#include "history.h" /* readline defines this. */ #undef savestring @@ -45,11 +47,11 @@ int fclose (); #include <setjmp.h> #include <sys/param.h> #include <sys/stat.h> +#include <ctype.h> #ifdef SET_STACK_LIMIT_HUGE #include <sys/time.h> #include <sys/resource.h> -#include <ctype.h> int original_stack_limit; #endif @@ -581,7 +583,7 @@ GDB manual (available as on-line info or a printed manual).\n", stderr); if (corearg != NULL) if (!setjmp (to_top_level)) core_file_command (corearg, !batch); - else if (!setjmp (to_top_level)) + else if (isdigit (corearg[0]) && !setjmp (to_top_level)) attach_command (corearg, !batch); do_cleanups (ALL_CLEANUPS); @@ -1157,6 +1159,13 @@ command_line_input (prrompt, repeat) while (1) { + /* Reports are that some Sys V's don't flush stdout/err on reads + from stdin, when stdin/out are sockets rather than ttys. So we + have to do it ourselves, to make emacs-gdb and xxgdb work. + On other machines, doing this once per input should be a cheap nop. */ + fflush (stdout); + fflush (stderr); + /* Don't use fancy stuff if not talking to stdin. */ if (command_editing_p && instream == stdin && ISATTY (instream)) |