+2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ Turn process_stratum_target's hostio_last_error op into a
+ method of process_target.
+
+ * target.h (struct process_stratum_target): Remove the target op.
+ (class process_target): Add the target op.
+ * target.cc: Add "hostio.h" to includes.
+ (process_target::hostio_last_error): Define.
+
+ Update the derived classes and callers below.
+
+ * hostio.cc (hostio_error): Update.
+ * linux-low.cc: Remove "hostio.h" from includes.
+ (linux_target_ops): Update.
+ * lynx-low.cc (lynx_target_ops): Update.
+ * nto-low.cc (nto_target_ops): Update.
+ * win32-low.h (class win32_process_target): Update.
+ * win32-low.cc (win32_target_ops): Update.
+ (wince_hostio_last_error): Turn into ...
+ (win32_process_target::hostio_last_error): ... this.
+
2020-02-20 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Turn process_stratum_target's get_tls_address op into a method of
static void
hostio_error (char *own_buf)
{
- the_target->hostio_last_error (own_buf);
+ the_target->pt->hostio_last_error (own_buf);
}
static void
#include <sys/uio.h>
#include "gdbsupport/filestuff.h"
#include "tracepoint.h"
-#include "hostio.h"
#include <inttypes.h>
#include "gdbsupport/common-inferior.h"
#include "nat/fork-inferior.h"
static linux_process_target the_linux_target;
static process_stratum_target linux_target_ops = {
- hostio_last_error_from_errno,
linux_qxfer_osdata,
linux_xfer_siginfo,
linux_supports_non_stop,
/* The LynxOS target_ops vector. */
static process_stratum_target lynx_target_ops = {
- NULL, /* hostio_last_error */
NULL, /* qxfer_osdata */
NULL, /* qxfer_siginfo */
NULL, /* supports_non_stop */
static nto_process_target the_nto_target;
static process_stratum_target nto_target_ops = {
- hostio_last_error_from_errno,
NULL, /* nto_qxfer_osdata */
NULL, /* xfer_siginfo */
nto_supports_non_stop,
#include "server.h"
#include "tracepoint.h"
#include "gdbsupport/byte-vector.h"
+#include "hostio.h"
process_stratum_target *the_target;
{
gdb_assert_not_reached ("target op get_tls_address not supported");
}
+
+void
+process_target::hostio_last_error (char *buf)
+{
+ hostio_last_error_from_errno (buf);
+}
shared code. */
struct process_stratum_target
{
- /* Fill BUF with an hostio error packet representing the last hostio
- error. */
- void (*hostio_last_error) (char *buf);
-
/* Read/Write OS data using qXfer packets. */
int (*qxfer_osdata) (const char *annex, unsigned char *readbuf,
unsigned const char *writebuf, CORE_ADDR offset,
support the operation. */
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);
};
extern process_stratum_target *the_target;
return FILEIO_EUNKNOWN;
}
-static void
-wince_hostio_last_error (char *buf)
+void
+win32_process_target::hostio_last_error (char *buf)
{
DWORD winerr = GetLastError ();
int fileio_err = win32_error_to_fileio_error (winerr);
static win32_process_target the_win32_target;
static process_stratum_target win32_target_ops = {
-#ifdef _WIN32_WCE
- wince_hostio_last_error,
-#else
- hostio_last_error_from_errno,
-#endif
NULL, /* qxfer_osdata */
win32_xfer_siginfo,
NULL, /* supports_non_stop */
bool stopped_by_watchpoint () override;
CORE_ADDR stopped_data_address () override;
+
+#ifdef _WIN32_WCE
+ void hostio_last_error (char *buf) override;
+#endif
};
/* Retrieve the context for this thread, if not already retrieved. */