diff options
author | Christopher Faylor <me+cygwin@cgf.cx> | 2001-11-24 18:21:27 +0000 |
---|---|---|
committer | Christopher Faylor <me+cygwin@cgf.cx> | 2001-11-24 18:21:27 +0000 |
commit | 2a3d56452522dae64cbc02bc72166e674dbc1032 (patch) | |
tree | d0959987485d878f2c0e8669a371433570f57a51 /gdb/win32-nat.c | |
parent | e2334072bd560eeeff7ae49245c53796ef481d36 (diff) | |
download | gdb-2a3d56452522dae64cbc02bc72166e674dbc1032.zip gdb-2a3d56452522dae64cbc02bc72166e674dbc1032.tar.gz gdb-2a3d56452522dae64cbc02bc72166e674dbc1032.tar.bz2 |
* win32-nat.c (_initialize_check_for_gdb_ini): New function.
* config/i386/xm-cygwin.h: Remove obsolete handling of __CYGWIN32__.
(GDBINIT_FILENAME): Remove.
Diffstat (limited to 'gdb/win32-nat.c')
-rw-r--r-- | gdb/win32-nat.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c index ab5f3f3..48ac893 100644 --- a/gdb/win32-nat.c +++ b/gdb/win32-nat.c @@ -32,6 +32,7 @@ #include "command.h" #include "completer.h" #include "regcache.h" +#include "top.h" #include <signal.h> #include <sys/types.h> #include <fcntl.h> @@ -1753,3 +1754,31 @@ _initialize_core_win32 (void) { add_core_fns (&win32_elf_core_fns); } + +void +_initialize_check_for_gdb_ini (void) +{ + char *homedir; + if (inhibit_gdbinit) + return; + + homedir = getenv ("HOME"); + if (homedir) + { + char *p; + char *oldini = (char *) alloca (strlen (homedir) + + sizeof ("/gdb.ini")); + strcpy (oldini, homedir); + p = strchr (oldini, '\0'); + if (p > oldini && p[-1] != '/') + *p++ = '/'; + strcpy (p, "gdb.ini"); + if (access (oldini, 0) == 0) + { + int len = strlen (oldini); + char *newini = alloca (len + 1); + sprintf (newini, "%.*s.gdbinit", len - (sizeof ("gdb.ini") - 1), oldini); + warning ("obsolete '%s' found. Rename to '%s'.", oldini, newini); + } + } +} |