/* Remote utility routines for the remote server for GDB.
- Copyright (C) 1986-2019 Free Software Foundation, Inc.
+ Copyright (C) 1986-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "target.h"
#include "gdbthread.h"
#include "tdesc.h"
+#include "debug.h"
#include "dll.h"
-#include "common/rsp-low.h"
-#include "common/netstuff.h"
-#include "common/filestuff.h"
+#include "gdbsupport/rsp-low.h"
+#include "gdbsupport/netstuff.h"
+#include "gdbsupport/filestuff.h"
+#include "gdbsupport/gdb-sigmask.h"
#include <ctype.h>
#if HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#include "common/gdb_sys_time.h"
+#include "gdbsupport/gdb_sys_time.h"
#include <unistd.h>
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
static gdb_fildes_t remote_desc = INVALID_DESCRIPTOR;
static gdb_fildes_t listen_desc = INVALID_DESCRIPTOR;
-/* FIXME headerize? */
-extern int using_threads;
-extern int debug_threads;
-
#ifdef USE_WIN32API
# define read(fd, buf, len) recv (fd, (char *) buf, len, 0)
# define write(fd, buf, len) send (fd, (char *) buf, len, 0)
sigemptyset (&sigio_set);
sigaddset (&sigio_set, SIGIO);
- sigprocmask (block ? SIG_BLOCK : SIG_UNBLOCK, &sigio_set, NULL);
+ gdb_sigmask (block ? SIG_BLOCK : SIG_UNBLOCK, &sigio_set, NULL);
#endif
}
saved_thread = current_thread;
- switch_to_thread (ptid);
+ switch_to_thread (the_target, ptid);
regp = current_target_desc ()->expedite_regs;
{
if (decode_X_packet (&cs.own_buf[1], len - 1, &mem_addr,
&mem_len, &mem_buf) < 0
- || write_inferior_memory (mem_addr, mem_buf, mem_len) != 0)
+ || target_write_memory (mem_addr, mem_buf, mem_len) != 0)
write_enn (cs.own_buf);
else
write_ok (cs.own_buf);
else
{
decode_M_packet (&cs.own_buf[1], &mem_addr, &mem_len, &mem_buf);
- if (write_inferior_memory (mem_addr, mem_buf, mem_len) == 0)
+ if (target_write_memory (mem_addr, mem_buf, mem_len) == 0)
write_ok (cs.own_buf);
else
write_enn (cs.own_buf);