aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-04-12 20:23:54 +0100
committerPedro Alves <pedro@palves.net>2021-04-13 13:26:44 +0100
commit0256da25c04a5f797ccb210b2cb05a3fdb084495 (patch)
treed1d2022c34315bec94f050df771e369e6fef8b00 /gdbserver
parentd2f1139ef0c006f35210fac76cb034cfe8d57c2e (diff)
downloadfsf-binutils-gdb-0256da25c04a5f797ccb210b2cb05a3fdb084495.zip
fsf-binutils-gdb-0256da25c04a5f797ccb210b2cb05a3fdb084495.tar.gz
fsf-binutils-gdb-0256da25c04a5f797ccb210b2cb05a3fdb084495.tar.bz2
Remove process_stratum_target::hostio_last_error abstraction
Now that the WinCE port is gone, all ports map host I/O errors from errno, so this abstraction is no longer necessary. Basically undoes: https://sourceware.org/pipermail/gdb-patches/2008-January/055511.html https://sourceware.org/pipermail/gdb-patches/attachments/20080131/f44e7012/attachment.bin gdbserver/ChangeLog: * Makefile.in (SFILES): Remove hostio-errno.cc. * configure: Regenerate. * configure.ac (GDBSERVER_DEPFILES): No longer add $srv_hostio_err_objs. * configure.srv (srv_hostio_err_objs): Delete. * hostio-errno.cc: Delete. * hostio.cc (hostio_error): Inline hostio_last_error_from_errno here. * hostio.h (hostio_last_error_from_errno): Delete. * target.cc (process_stratum_target::hostio_last_error): Delete. * target.h (class process_stratum_target) <hostio_last_error>: Delete.
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/ChangeLog15
-rw-r--r--gdbserver/Makefile.in1
-rwxr-xr-xgdbserver/configure2
-rw-r--r--gdbserver/configure.ac2
-rw-r--r--gdbserver/configure.srv5
-rw-r--r--gdbserver/hostio-errno.cc36
-rw-r--r--gdbserver/hostio.cc8
-rw-r--r--gdbserver/hostio.h4
-rw-r--r--gdbserver/target.cc6
-rw-r--r--gdbserver/target.h4
10 files changed, 22 insertions, 61 deletions
diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index e558364..dfaaa60 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,3 +1,18 @@
+2021-04-13 Pedro Alves <pedro@palves.net>
+
+ * Makefile.in (SFILES): Remove hostio-errno.cc.
+ * configure: Regenerate.
+ * configure.ac (GDBSERVER_DEPFILES): No longer add
+ $srv_hostio_err_objs.
+ * configure.srv (srv_hostio_err_objs): Delete.
+ * hostio-errno.cc: Delete.
+ * hostio.cc (hostio_error): Inline hostio_last_error_from_errno
+ here.
+ * hostio.h (hostio_last_error_from_errno): Delete.
+ * target.cc (process_stratum_target::hostio_last_error): Delete.
+ * target.h (class process_stratum_target) <hostio_last_error>:
+ Delete.
+
2021-04-12 Simon Marchi <simon.marchi@polymtl.ca>
* win32-low.cc: Remove all code guarded by _WIN32_WCE.
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index a05cd1a..f7ade7d 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -186,7 +186,6 @@ SFILES = \
$(srcdir)/dll.cc \
$(srcdir)/gdbreplay.cc \
$(srcdir)/hostio.cc \
- $(srcdir)/hostio-errno.cc \
$(srcdir)/i387-fp.cc \
$(srcdir)/inferiors.cc \
$(srcdir)/linux-aarch64-low.cc \
diff --git a/gdbserver/configure b/gdbserver/configure
index 0db0ad3..032b4ae 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -10633,7 +10633,7 @@ $as_echo "#define USE_XML 1" >>confdefs.h
done
fi
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
GDBSERVER_LIBS="$srv_libs"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_*_compare_and_swap" >&5
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 6c50477..5ec222d 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -379,7 +379,7 @@ if test "$srv_xmlfiles" != ""; then
done
fi
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
GDBSERVER_LIBS="$srv_libs"
dnl Check whether the target supports __sync_*_compare_and_swap.
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 2dd8f75..971f537 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -8,8 +8,6 @@
# srv_regobj The register protocol appropriate for this target.
# srv_tgtobj Any other target-specific modules appropriate
# for this target.
-# srv_hostio_err The object implementing the hostio_last_error
-# target method.
# srv_xmlfiles All XML files which should be available for
# gdbserver in this configuration.
# ipa_obj Any other target-specific modules appropriate
@@ -24,9 +22,6 @@
# srv_linux_usrregs Set to "yes" if we can get at registers via
# PTRACE_PEEKUSR / PTRACE_POKEUSR.
-# Default hostio_last_error implementation
-srv_hostio_err_objs="hostio-errno.o"
-
ipa_ppc_linux_regobj="powerpc-32l-ipa.o powerpc-altivec32l-ipa.o powerpc-vsx32l-ipa.o powerpc-isa205-32l-ipa.o powerpc-isa205-altivec32l-ipa.o powerpc-isa205-vsx32l-ipa.o powerpc-isa205-ppr-dscr-vsx32l-ipa.o powerpc-isa207-vsx32l-ipa.o powerpc-isa207-htm-vsx32l-ipa.o powerpc-e500l-ipa.o powerpc-64l-ipa.o powerpc-altivec64l-ipa.o powerpc-vsx64l-ipa.o powerpc-isa205-64l-ipa.o powerpc-isa205-altivec64l-ipa.o powerpc-isa205-vsx64l-ipa.o powerpc-isa205-ppr-dscr-vsx64l-ipa.o powerpc-isa207-vsx64l-ipa.o powerpc-isa207-htm-vsx64l-ipa.o"
# Linux object files. This is so we don't have to repeat
diff --git a/gdbserver/hostio-errno.cc b/gdbserver/hostio-errno.cc
deleted file mode 100644
index 4cb3922..0000000
--- a/gdbserver/hostio-errno.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Host file transfer support for gdbserver.
- Copyright (C) 2007-2021 Free Software Foundation, Inc.
-
- Contributed by CodeSourcery.
-
- 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/>. */
-
-/* This file implements the hostio_last_error target callback
- on top of errno. */
-
-#include "server.h"
-
-#include "hostio.h"
-
-#include "gdbsupport/fileio.h"
-
-void
-hostio_last_error_from_errno (char *buf)
-{
- int error = errno;
- int fileio_error = host_to_fileio_error (error);
- sprintf (buf, "F-1,%x", fileio_error);
-}
diff --git a/gdbserver/hostio.cc b/gdbserver/hostio.cc
index 26c0f11..0654bba 100644
--- a/gdbserver/hostio.cc
+++ b/gdbserver/hostio.cc
@@ -191,12 +191,14 @@ require_valid_fd (int fd)
return -1;
}
-/* Fill in own_buf with the last hostio error packet, however it
- suitable for the target. */
+/* Fill BUF with an hostio error packet representing the last hostio
+ error, from errno. */
+
static void
hostio_error (char *own_buf)
{
- the_target->hostio_last_error (own_buf);
+ int fileio_error = host_to_fileio_error (errno);
+ sprintf (own_buf, "F-1,%x", fileio_error);
}
static void
diff --git a/gdbserver/hostio.h b/gdbserver/hostio.h
index 61c4219..97c27c6 100644
--- a/gdbserver/hostio.h
+++ b/gdbserver/hostio.h
@@ -22,10 +22,6 @@
/* Per-connection setup. */
extern void hostio_handle_new_gdb_connection (void);
-/* Functions from hostio.c. */
extern int handle_vFile (char *, int, int *);
-/* Functions from hostio-errno.c. */
-extern void hostio_last_error_from_errno (char *own_buf);
-
#endif /* GDBSERVER_HOSTIO_H */
diff --git a/gdbserver/target.cc b/gdbserver/target.cc
index 5ec3e5c..6660cc0 100644
--- a/gdbserver/target.cc
+++ b/gdbserver/target.cc
@@ -505,12 +505,6 @@ process_stratum_target::get_tls_address (thread_info *thread,
gdb_assert_not_reached ("target op get_tls_address not supported");
}
-void
-process_stratum_target::hostio_last_error (char *buf)
-{
- hostio_last_error_from_errno (buf);
-}
-
bool
process_stratum_target::supports_qxfer_osdata ()
{
diff --git a/gdbserver/target.h b/gdbserver/target.h
index 769d828..2c4393e 100644
--- a/gdbserver/target.h
+++ b/gdbserver/target.h
@@ -256,10 +256,6 @@ public:
virtual int get_tls_address (thread_info *thread, CORE_ADDR offset,
CORE_ADDR load_module, CORE_ADDR *address);
- /* Fill BUF with an hostio error packet representing the last hostio
- error. */
- virtual void hostio_last_error (char *buf);
-
/* Return true if the qxfer_osdata target op is supported. */
virtual bool supports_qxfer_osdata ();