remote.c: Use packet_check_result
commit3623271997a5c0d79609aa6a1f35ef61b4469054
authorAlexandra Hájková <ahajkova@redhat.com>
Tue, 30 Jan 2024 14:55:47 +0000 (30 15:55 +0100)
committerAlexandra Hájková <ahajkova@redhat.com>
Mon, 8 Apr 2024 11:39:51 +0000 (8 13:39 +0200)
treec201d4fa322e7e0d4c8c25514bbcbd930e30b74f
parent36192c2be137d2af13fbc2d528de05b41d546805
remote.c: Use packet_check_result

when processing the GDBserver reply to qRcmd packet.
Print error message or the error code.
Currently, when qRcmd request returns an error,
GDB just prints:

Protocol error with Rcmd

After this change, GDB will also print the error code:

Protocol error with Rcmd: 01.

Add an accept_msg argument to packet_check result. qRcmd
request (such as many other packets) does not recognise
"E.msg" form as an error right now. We want to recognise
"E.msg" as an error response only for the packets where
it's documented.

Also use packet_check result in remote_read_bytes_1.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/remote.c