* win32-nat.c (_initialize_check_for_gdb_ini): New function.

* config/i386/xm-cygwin.h: Remove obsolete handling of __CYGWIN32__.
(GDBINIT_FILENAME): Remove.
This commit is contained in:
Christopher Faylor
2001-11-24 18:21:27 +00:00
parent e2334072bd
commit 2a3d564525
6 changed files with 74 additions and 13 deletions

View File

@@ -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);
}
}
}