+2019-11-15 Christian Biesinger <cbiesinger@google.com>
+
+ * Makefile.in: Replace {posix,mingw}-strerror.c with safe-strerror.c.
+ * configure: Regenerate.
+ * configure.ac: Don't source common.host.
+ * gdbsupport/common.host: Remove.
+ * gdbsupport/mingw-strerror.c: Remove.
+ * gdbsupport/posix-strerror.c: Rename to...
+ * gdbsupport/safe-strerror.c: ...this.
+
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* maint.c (scoped_command_stats::print_time): Use localtime_r
gdbsupport/ptid.c \
gdbsupport/rsp-low.c \
gdbsupport/run-time-clock.c \
+ gdbsupport/safe-strerror.c \
gdbsupport/scoped_mmap.c \
gdbsupport/signals.c \
gdbsupport/signals-state-save-restore.c \
xtensa-linux-nat.c \
xtensa-linux-tdep.c \
xtensa-tdep.c \
- xtensa-xtregs.c \
- gdbsupport/mingw-strerror.c \
- gdbsupport/posix-strerror.c
+ xtensa-xtregs.c
# Some files need explicit build rules (due to -Werror problems) or due
# to sub-directory fun 'n' games.
. $srcdir/configure.host
-# Add in the common host objects.
-. $srcdir/gdbsupport/common.host
-gdb_host_obs="$gdb_host_obs $common_host_obs"
-
# Accumulate some settings from configure.tgt over all enabled targets
TARGET_OBS=
. $srcdir/configure.host
-# Add in the common host objects.
-. $srcdir/gdbsupport/common.host
-gdb_host_obs="$gdb_host_obs $common_host_obs"
-
# Accumulate some settings from configure.tgt over all enabled targets
TARGET_OBS=
+2019-11-15 Christian Biesinger <cbiesinger@google.com>
+
+ * Makefile.in: Add safe-strerror.c.
+ * configure: Regenerate.
+ * configure.ac: Don't source common.host.
+
2019-11-15 Christian Biesinger <cbiesinger@google.com>
* config.in: Regenerate.
$(srcdir)/gdbsupport/print-utils.c \
$(srcdir)/gdbsupport/ptid.c \
$(srcdir)/gdbsupport/rsp-low.c \
+ $(srcdir)/gdbsupport/safe-strerror.c \
$(srcdir)/gdbsupport/tdesc.c \
$(srcdir)/gdbsupport/xml-utils.c \
$(srcdir)/nat/aarch64-sve-linux-ptrace.c \
gdbsupport/print-utils.o \
gdbsupport/ptid.o \
gdbsupport/rsp-low.o \
+ gdbsupport/safe-strerror.o \
gdbsupport/signals.o \
gdbsupport/signals-state-save-restore.o \
gdbsupport/tdesc.o \
. ${srcdir}/configure.srv
-# Add in the common host objects.
-. ${srcdir}/../gdbsupport/common.host
-srv_host_obs="$common_host_obs"
-
if test "${srv_mingwce}" = "yes"; then
LIBS="$LIBS -lws2"
elif test "${srv_mingw}" = "yes"; then
done
fi
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_host_obs $srv_selftest_objs"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_selftest_objs"
GDBSERVER_LIBS="$srv_libs"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_*_compare_and_swap" >&5
. ${srcdir}/configure.srv
-# Add in the common host objects.
-. ${srcdir}/../gdbsupport/common.host
-srv_host_obs="$common_host_obs"
-
if test "${srv_mingwce}" = "yes"; then
LIBS="$LIBS -lws2"
elif test "${srv_mingw}" = "yes"; then
done
fi
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_host_obs $srv_selftest_objs"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_selftest_objs"
GDBSERVER_LIBS="$srv_libs"
dnl Check whether the target supports __sync_*_compare_and_swap.
+++ /dev/null
-# Common object files to include for each host.
-#
-# Copyright (C) 2015-2019 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 3 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, see <http://www.gnu.org/licenses/>.
-
-# Map host triplet into the common object files to be included by
-# GDB/gdbserver. This is invoked from the autoconf generated
-# configure script.
-
-# This file sets the following shell variables:
-# common_host_obs host-specific .o files to include when building
-# GDB/gdbserver
-
-case "${host}" in
-
-*-mingw*) common_host_obs=gdbsupport/mingw-strerror.o
- ;;
-*)
- common_host_obs=gdbsupport/posix-strerror.o
- ;;
-
-esac
+++ /dev/null
-/* Safe version of strerror for MinGW, for GDB, the GNU debugger.
-
- Copyright (C) 2006-2019 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 3 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, see <http://www.gnu.org/licenses/>. */
-
-#include "common-defs.h"
-
-#include <windows.h>
-
-/* Implementation of safe_strerror as defined in common-utils.h.
-
- 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. */
-
-const 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;
-}
+++ /dev/null
-/* Safe version of strerror for POSIX systems for GDB, the GNU debugger.
-
- Copyright (C) 2006-2019 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 3 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, see <http://www.gnu.org/licenses/>. */
-
-#include "common-defs.h"
-#include <string.h>
-
-/* Implementation of safe_strerror as defined in common-utils.h. */
-
-const char *
-safe_strerror (int errnum)
-{
- static thread_local char buf[1024];
-
- /* Assign the return value to an int, so we get an error if we accidentally
- get the wrong version of this function (glibc has two of them...). */
- int ret = strerror_r (errnum, buf, sizeof (buf));
- if (ret == 0)
- return buf;
-
- xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
- return buf;
-}
--- /dev/null
+/* Safe version of strerror for GDB, the GNU debugger.
+
+ Copyright (C) 2006-2019 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#include "common-defs.h"
+#include <string.h>
+
+/* Implementation of safe_strerror as defined in common-utils.h. */
+
+const char *
+safe_strerror (int errnum)
+{
+ static thread_local char buf[1024];
+
+ /* Assign the return value to an int, so we get an error if we accidentally
+ get the wrong version of this function (glibc has two of them...). */
+ int ret = strerror_r (errnum, buf, sizeof (buf));
+ if (ret == 0)
+ return buf;
+
+ xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
+ return buf;
+}