+Wed Aug 7 17:18:37 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * dwarf2read.c dwarfread.c exec.c infcmd.c infrun.c main.c
+ mdebugread.c os9kread.c source.c top.c utils.c: Don't
+ include param.h or sys/file.h (or unistd.h in some cases).
+ * defs.h exec.c inflow.c remote-array.c remote-e7000.c
+ sparcl-tdep.c terminal.h utils.c: Replace all occurances of
+ __WIN32__, WINGDB, WIN32, etc... with _WIN32.
+ * main.c: Remove #ifndef WINGDB around option processing. Fix
+ bug with passing argc==0 and argv==NULL to getopt.
+ * (main) Remove calls to access() before source_command. Let
+ soure_command handle access errors.
+ * maint.c (maintenance_dump_me): #ifdef out for _WIN32.
+ * symtab.c (operator_chars): Make this global for wingdb.
+ * top.c (disconnect): #ifdef out for _WIN32.
+ * (source_command): If got an error and from_tty, then call print
+ error, else just return quietly.
+ * utils.c (fatal_dump_core): Can't kill ourselves under windows.
+ Just exit.
+ * (pollquit notice_quit): #ifdef out stuff that doesn't exist
+ under windows.
+
Wed Aug 7 09:59:19 1996 Jeffrey A Law (law@cygnus.com)
* config/pa/tm-hppa.h (EXTRACT_RETURN_VALUE): Tweak for
#endif
#ifndef SLASH_P
-#if defined(__GO32__)||defined(__WIN32__)
+#if defined(__GO32__)||defined(_WIN32)
#define SLASH_P(X) ((X)=='\\')
#else
#define SLASH_P(X) ((X)=='/')
#endif
#ifndef SLASH_CHAR
-#if defined(__GO32__)||defined(__WIN32__)
+#if defined(__GO32__)||defined(_WIN32)
#define SLASH_CHAR '\\'
#else
#define SLASH_CHAR '/'
#endif
#ifndef SLASH_STRING
-#if defined(__GO32__)||defined(__WIN32__)
+#if defined(__GO32__)||defined(_WIN32)
#define SLASH_STRING "\\"
#else
#define SLASH_STRING "/"
#include <string.h>
#include <sys/types.h>
-#ifndef NO_SYS_FILE
-#include <sys/file.h>
-#endif
-
/* .debug_info header for a compilation unit
Because of alignment constraints, this structure has padding and cannot
be mapped directly onto the beginning of the .debug_info section. */
#include <fcntl.h>
#include "gdb_string.h"
-#ifndef NO_SYS_FILE
-#include <sys/file.h>
-#endif
-
/* Some macros to provide DIE info for complaints. */
#define DIE_ID (curdie!=NULL ? curdie->die_ref : 0)
#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. */
current_directory = gdb_dirbuf;
/* Parse arguments and options. */
-#ifndef WINGDB
{
int c;
/* When var field is 0, use flag field to record the equivalent
quiet = 1;
}
-#endif
gdb_init ();
/* Do these (and anything which might call wrap_here or *_filtered)
strcat (homeinit, "/");
strcat (homeinit, gdbinit);
- if (!inhibit_gdbinit && access (homeinit, R_OK) == 0)
+ if (!inhibit_gdbinit)
{
if (!SET_TOP_LEVEL ())
source_command (homeinit, 0);
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);
/* The default command loop.
The WIN32 Gui calls this main to set up gdb's state, and
has its own command loop. */
-#if !defined (WINGDB)
+#ifndef _WIN32
while (1)
{
if (!SET_TOP_LEVEL ())
help_list (maintenancelist, "maintenance ", -1, gdb_stdout);
}
-
+#ifndef _WIN32
/* ARGSUSED */
static void
maintenance_dump_me (args, from_tty)
kill (getpid (), SIGQUIT);
}
}
+#endif
/* Someday we should allow demangling for things other than just
explicit strings. For example, we might want to be able to
&maintenanceprintlist, "maintenance print ", 0,
&maintenancelist);
+#ifndef _WIN32
add_cmd ("dump-me", class_maintenance, maintenance_dump_me,
"Get fatal error; make debugger dump its core.\n\
GDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\n\
itself a SIGQUIT signal.",
&maintenancelist);
+#endif
add_cmd ("demangle", class_maintenance, maintenance_demangle,
"Demangle a C++ mangled name.\n\
#include <sys/types.h>
#endif
-#include <sys/param.h>
-#include <sys/file.h>
#include "gdb_stat.h"
#include "gdb_string.h"
#endif
#include "obstack.h"
-#include <sys/param.h>
-#ifndef NO_SYS_FILE
-#include <sys/file.h>
-#endif
#include "gdb_stat.h"
#include <ctype.h>
#include "symtab.h"
timeout = 0; /* Don't time out -- user program is running. */
-#if !defined(__GO32__) && !defined(__MSDOS__) && !defined(__WIN32__)
+#if !defined(__GO32__) && !defined(__MSDOS__) && !defined(_WIN32)
tty_desc = SERIAL_FDOPEN (0);
ttystate = SERIAL_GET_TTY_STATE (tty_desc);
SERIAL_RAW (tty_desc);
#include "target.h"
#include "serial.h"
#include <sys/types.h>
-#include <sys/time.h>
-#if defined(__GO32__) || defined(WIN32)
-#undef HAVE_SOCKETS
-#else
+#if !defined(__GO32__) && !defined(_WIN32)
#define HAVE_SOCKETS
-#endif
-
-
-#ifdef HAVE_SOCKETS
+#include <sys/time.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
/* If we're using autoconf, it will define HAVE_TERMIOS_H,
HAVE_TERMIO_H and HAVE_SGTTY_H for us. One day we can rewrite
ser-unix.c and inflow.c to inspect those names instead of
- HAVE_TERMIOS, HAVE_TERMIO and the implicit HAVE_SGTYY (when neither
+ HAVE_TERMIOS, HAVE_TERMIO and the implicit HAVE_SGTTY (when neither
HAVE_TERMIOS or HAVE_TERMIO is set). Until then, make sure that
nothing has already defined the one of the names, and do the right
thing. */
/* nothing works with go32, and the headers aren't complete */
-#if !defined (__GO32__)
+#if !defined (__GO32__) && !defined (_WIN32)
#if !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY)
#if defined(HAVE_TERMIOS_H)
#define HAVE_TERMIOS
#elif defined(HAVE_TERMIO_H)
#define HAVE_TERMIO
-#elif defined(HAVE_SGTTY)
+#elif defined(HAVE_SGTTY_H)
#define HAVE_SGTTY
#endif
#endif
#include <termios.h>
#endif
-
-#if !defined(__GO32__) && !defined(__WIN32__) && !defined (HAVE_TERMIOS)
+#if !defined(__GO32__) && !defined(_WIN32) && !defined (HAVE_TERMIOS)
/* Define a common set of macros -- BSD based -- and redefine whatever
the system offers to make it look like that. FIXME: serial.h and
#endif
#include "gdb_string.h"
-#ifndef NO_SYS_FILE
-#include <sys/file.h>
-#endif
-#include <sys/param.h>
#include "gdb_stat.h"
#include <ctype.h>
/* Handler for SIGHUP. */
+#ifndef _WIN32
static void
disconnect (signo)
int signo;
signal (SIGHUP, SIG_DFL);
kill (getpid (), SIGHUP);
}
+#endif
/* Just a little helper function for disconnect(). */
might be in memory, shared between the two). Since we establish
a handler for SIGQUIT, when we call exec it will set the signal
to SIG_DFL for us. */
+#ifndef _WIN32
signal (SIGQUIT, do_nothing);
if (signal (SIGHUP, do_nothing) != SIG_IGN)
signal (SIGHUP, disconnect);
+#endif
signal (SIGFPE, float_handler);
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
old_cleanups = make_cleanup (free, file);
stream = fopen (file, FOPEN_RT);
- if (stream == 0)
- perror_with_name (file);
+ if (!stream)
+ if (from_tty)
+ perror_with_name (file);
+ else
+ return;
make_cleanup (fclose, stream);