Fix remote 'g' command error handling (PR remote/9665)
authorAndrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Thu, 26 Apr 2018 22:47:25 +0000 (23:47 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 26 Apr 2018 22:47:25 +0000 (23:47 +0100)
commitb75abf5bb636869fd893ecf98414b8b2fe0d4a12
tree81659aee5a6320b19104a16c8a4ea56643a03026
parenta914a7c95895161c99533d5919b8504b37ea54a0
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.
gdb/ChangeLog
gdb/remote.c
This page took 0.0284 seconds and 4 git commands to generate.