* Makefile.in (mingw-hdep.o, posix-hdep.o): New dependencies.

(ALLDEPFILES): Add mingw-hdep.c and posix-hdep.c.
	* configure.ac: Add gdb_host_obs to CONFIG_OBS.  Set gdb_host_obs
	to posix-hdep.o by default.
	* configure: Regenerated.
	* configure.host: Document gdb_host_obs.  Add an entry for
	i[34567]86-*-mingw32*.
	* mingw-hdep.c, posix-hdep.c: New files.
	* utils.c (safe_strerror): Remove, moved to posix-hdep.o.
This commit is contained in:
Daniel Jacobowitz 2006-02-10 21:53:51 +00:00
parent 1f82754b11
commit 121ce6e53d
8 changed files with 364 additions and 395 deletions

View File

@ -1,3 +1,15 @@
2006-02-10 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (mingw-hdep.o, posix-hdep.o): New dependencies.
(ALLDEPFILES): Add mingw-hdep.c and posix-hdep.c.
* configure.ac: Add gdb_host_obs to CONFIG_OBS. Set gdb_host_obs
to posix-hdep.o by default.
* configure: Regenerated.
* configure.host: Document gdb_host_obs. Add an entry for
i[34567]86-*-mingw32*.
* mingw-hdep.c, posix-hdep.c: New files.
* utils.c (safe_strerror): Remove, moved to posix-hdep.o.
2006-02-10 Joel Brobecker <brobecker@adacore.com>
* defs.h (gdb_osabi): New enum value GDB_OSABI_AIX.

View File

@ -1425,6 +1425,7 @@ ALLDEPFILES = \
m68kbsd-nat.c m68kbsd-tdep.c \
m68klinux-nat.c m68klinux-tdep.c \
m88k-tdep.c m88kbsd-nat.c \
mingw-hdep.c \
mips-linux-nat.c mips-linux-tdep.c \
mips-irix-tdep.c \
mips-tdep.c mipsv4-nat.c \
@ -1433,6 +1434,7 @@ ALLDEPFILES = \
nbsd-tdep.c obsd-tdep.c \
solib-osf.c \
somread.c solib-som.c $(HPREAD_SOURCE) \
posix-hdep.c \
ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \
ppcnbsd-nat.c ppcnbsd-tdep.c \
ppcobsd-nat.c ppcobsd-tdep.c \
@ -2280,6 +2282,7 @@ memattr.o: memattr.c $(defs_h) $(command_h) $(gdbcmd_h) $(memattr_h) \
$(target_h) $(value_h) $(language_h) $(gdb_string_h)
mem-break.o: mem-break.c $(defs_h) $(symtab_h) $(breakpoint_h) $(inferior_h) \
$(target_h)
mingw-hdep.o: mingw-hdep.c $(defs_h) $(gdb_string_h)
minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \
$(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(cp_abi_h)
mips64obsd-nat.o: mips64obsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
@ -2375,6 +2378,7 @@ p-exp.o: p-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(value_h) \
p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \
$(valprint_h) $(value_h)
posix-hdep.o: posix-hdep.c $(defs_h) $(gdb_string_h)
ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \
$(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \
$(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \

597
gdb/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -112,6 +112,10 @@ AC_DEFINE_DIR(DEBUGDIR, debugdir,
AC_CONFIG_SUBDIRS(doc testsuite)
# Provide defaults for some variables set by the per-host and per-target
# configuration.
gdb_host_obs=posix-hdep.o
. $srcdir/configure.host
. $srcdir/configure.tgt
@ -1225,6 +1229,9 @@ case ${host} in
esac
AC_SUBST(WIN32LIBS)
# Add any host-specific objects to GDB.
CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
LIBGUI="../libgui/src/libgui.a"
GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
AC_SUBST(LIBGUI)

View File

@ -7,6 +7,7 @@
# gdb_host_float_format host's float floatformat, or 0
# gdb_host_double_format host's double floatformat, or 0
# gdb_host_long_double_format host's long double floatformat, or 0
# gdb_host_obs host-specific .o files to include
# Map host cpu into the config cpu subdirectory name.
# The default is $host_cpu.
@ -64,6 +65,9 @@ i[34567]86-*-netbsdelf* | i[34567]86-*-knetbsd*-gnu)
gdb_host=nbsdelf ;;
i[34567]86-*-netbsd*) gdb_host=nbsdaout ;;
i[34567]86-*-go32*) gdb_host=go32 ;;
i[34567]86-*-mingw32*) gdb_host=mingw
gdb_host_obs=mingw-hdep.o
;;
i[34567]86-*-msdosdjgpp*) gdb_host=go32 ;;
i[34567]86-*-linux*) gdb_host=linux ;;
i[34567]86-*-lynxos*) gdb_host=i386lynx ;;

71
gdb/mingw-hdep.c Normal file
View File

@ -0,0 +1,71 @@
/* Host support routines for MinGW, for GDB, the GNU debugger.
Copyright (C) 2006
Free Software Foundation, Inc.
This file is part of GDB.
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 2 of the License, or
(at your option) any later version.
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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "defs.h"
#include "gdb_string.h"
#include <windows.h>
/* The strerror() function can return NULL for errno values that are
out of range. Provide a "safe" version that always returns a
printable string.
The Windows runtime implementation of strerror never returns NULL,
but does return a useless string for anything above sys_nerr;
unfortunately this includes all socket-related error codes.
This replacement tries to find a system-provided error message. */
char *
safe_strerror (int errnum)
{
static char *buffer;
int len;
if (errnum >= 0 && errnum < sys_nerr)
return strerror (errnum);
if (buffer)
{
LocalFree (buffer);
buffer = NULL;
}
if (FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM,
NULL, errnum,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &buffer, 0, NULL) == 0)
{
static char buf[32];
xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
return buf;
}
/* Windows error messages end with a period and a CR-LF; strip that
out. */
len = strlen (buffer);
if (len > 3 && strcmp (buffer + len - 3, ".\r\n") == 0)
buffer[len - 3] = '\0';
return buffer;
}

45
gdb/posix-hdep.c Normal file
View File

@ -0,0 +1,45 @@
/* Host support routines for MinGW, for GDB, the GNU debugger.
Copyright (C) 2006
Free Software Foundation, Inc.
This file is part of GDB.
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 2 of the License, or
(at your option) any later version.
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 this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "defs.h"
#include "gdb_string.h"
/* The strerror() function can return NULL for errno values that are
out of range. Provide a "safe" version that always returns a
printable string. */
char *
safe_strerror (int errnum)
{
char *msg;
msg = strerror (errnum);
if (msg == NULL)
{
static char buf[32];
xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
msg = buf;
}
return (msg);
}

View File

@ -839,25 +839,6 @@ internal_warning (const char *file, int line, const char *string, ...)
va_end (ap);
}
/* The strerror() function can return NULL for errno values that are
out of range. Provide a "safe" version that always returns a
printable string. */
char *
safe_strerror (int errnum)
{
char *msg;
msg = strerror (errnum);
if (msg == NULL)
{
static char buf[32];
xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
msg = buf;
}
return (msg);
}
/* Print the system error message for errno, and also mention STRING
as the file name for which the error was encountered.
Then return to command level. */