X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbserver%2Fremote-utils.c;h=d7da4b7aed21eee67a2274962d8d0f91ea33a2e8;hb=c5adaa1921c34d2b9711ec7cecd3cb4a253620db;hp=1734c54e39aca73705299e9adb4d496a6ee21eb6;hpb=c7ab0aef11d91b637bf091aa9176b8dc4aadee46;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 1734c54e39..d7da4b7aed 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -1,5 +1,5 @@ /* Remote utility routines for the remote server for GDB. - Copyright (C) 1986-2018 Free Software Foundation, Inc. + Copyright (C) 1986-2019 Free Software Foundation, Inc. This file is part of GDB. @@ -23,11 +23,11 @@ #include "target.h" #include "gdbthread.h" #include "tdesc.h" +#include "debug.h" #include "dll.h" -#include "rsp-low.h" -#include "gdbthread.h" -#include "netstuff.h" -#include "filestuff.h" +#include "gdbsupport/rsp-low.h" +#include "gdbsupport/netstuff.h" +#include "gdbsupport/filestuff.h" #include #if HAVE_SYS_IOCTL_H #include @@ -56,7 +56,7 @@ #if HAVE_FCNTL_H #include #endif -#include "gdb_sys_time.h" +#include "gdbsupport/gdb_sys_time.h" #include #if HAVE_ARPA_INET_H #include @@ -64,8 +64,7 @@ #include #if USE_WIN32API -#include -#include +#include #endif #if __QNX__ @@ -106,18 +105,11 @@ struct sym_cache struct sym_cache *next; }; -int remote_debug = 0; -struct ui_file *gdb_stdlog; - static int remote_is_stdio = 0; 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) @@ -231,7 +223,6 @@ void remote_prepare (const char *name) { client_state &cs = get_client_state (); - const char *port_str; #ifdef USE_WIN32API static int winsock_initialized; #endif @@ -337,7 +328,7 @@ remote_open (const char *name) port_str = strchr (name, ':'); #ifdef USE_WIN32API if (port_str == NULL) - error ("Only : is supported on this platform."); + error ("Only HOST:PORT is supported on this platform."); #endif if (strcmp (name, STDIO_CONNECTION_NAME) == 0) @@ -902,7 +893,6 @@ static unsigned char *readchar_bufp; static int readchar (void) { - client_state &cs = get_client_state (); int ch; if (readchar_bufcnt == 0) @@ -1565,7 +1555,7 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb) if (!startswith (cs.own_buf, "qSymbol:")) { - warning ("Malformed response to qSymbol, ignoring: %s\n", cs.own_buf); + warning ("Malformed response to qSymbol, ignoring: %s", cs.own_buf); return -1; } @@ -1643,7 +1633,7 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc) { 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); @@ -1651,7 +1641,7 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc) 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); @@ -1666,14 +1656,14 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc) if (cs.own_buf[0] == 'E') { - warning ("An error occurred while relocating an instruction: %s\n", + warning ("An error occurred while relocating an instruction: %s", cs.own_buf); return -1; } if (!startswith (cs.own_buf, "qRelocInsn:")) { - warning ("Malformed response to qRelocInsn, ignoring: %s\n", + warning ("Malformed response to qRelocInsn, ignoring: %s", cs.own_buf); return -1; }