Fix remote 'g' command error handling (PR remote/9665)
'g' command returns hex-string as response so simply checking for 'E'
to determine if it failed is not enough and can trigger spurious error
messages. For example, invalid behaviour can be easily triggered on
Cortex-M as follows:
(gdb) set $r0 = 0xe0
Sending packet: $P0=
e0000000#72...Packet received: OK
Packet P (set-register) is supported
Sending packet: $g#67...Packet received:
E0000000849A0020...
Remote failure reply:
E0000000849A0020...
This patch fixes the problem by calling putpkt()/getpkt() directly and
checking result with packet_check_result(). This works fine since Enn
response has odd number of bytes while proper response has even number
of bytes.
Also, remote_send() is now not used anywhere so it can be removed.
gdb/Changelog:
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.