+2018-04-26 Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
+
+ PR remote/9665
+ * remote.c (send_g_packet): Use putpkt/getpkt/packet_check_result
+ instead of remote_send.
+ (remote_send): Remove.
+
2018-04-26 Pedro Alves <palves@redhat.com>
* elfread.c (elf_gnu_ifunc_resolver_return_stop): Use
static void extended_remote_restart (void);
-static void remote_send (char **buf, long *sizeof_buf_p);
-
static int readchar (int timeout);
static void remote_serial_write (const char *str, int len);
int buf_len;
xsnprintf (rs->buf, get_remote_packet_size (), "g");
- remote_send (&rs->buf, &rs->buf_size);
+ putpkt (rs->buf);
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ if (packet_check_result (rs->buf) == PACKET_ERROR)
+ error (_("Could not read registers; remote failure reply '%s'"),
+ rs->buf);
/* We can get out of synch in various cases. If the first character
in the buffer is not a hex character, assume that has happened
set_quit_flag ();
}
-/* Send the command in *BUF to the remote machine, and read the reply
- into *BUF. Report an error if we get an error reply. Resize
- *BUF using xrealloc if necessary to hold the result, and update
- *SIZEOF_BUF. */
-
-static void
-remote_send (char **buf,
- long *sizeof_buf)
-{
- putpkt (*buf);
- getpkt (buf, sizeof_buf, 0);
-
- if ((*buf)[0] == 'E')
- error (_("Remote failure reply: %s"), *buf);
-}
-
/* Return a string representing an escaped version of BUF, of len N.
E.g. \n is converted to \\n, \t to \\t, etc. */