aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@arm.com>2022-03-31 16:45:53 +0100
committerLuis Machado <luis.machado@arm.com>2022-04-05 08:44:19 +0100
commitd5ce6f2dcacf9809fb7a29a69c4b98e0320c3c94 (patch)
treedf1744e789b12e5b1fc4a55e55c9b48269fd0f72 /gdb/remote.c
parent27f9f649753b8c4bd4c40bde0f49d916c222a16a (diff)
downloadgdb-d5ce6f2dcacf9809fb7a29a69c4b98e0320c3c94.zip
gdb-d5ce6f2dcacf9809fb7a29a69c4b98e0320c3c94.tar.gz
gdb-d5ce6f2dcacf9809fb7a29a69c4b98e0320c3c94.tar.bz2
Fix qRcmd error code parsing
Someone at IRC spotted a bug in qRcmd handling. This looks like an oversight or it is that way for historical reasons. The code in gdb/remote.c:remote_target::rcmd uses isdigit instead of isxdigit. One could argue that we are expecting decimal numbers, but further below we use fromhex (). Update the function to use isxdigit instead and also update the documentation. I see there are lots of other cases of undocumented number format for error messages, mostly described as NN instead of nn. For now I'll just update this particular function.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 122f204..b002f04 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -11565,7 +11565,7 @@ remote_target::rcmd (const char *command, struct ui_file *outbuf)
if (strcmp (buf, "OK") == 0)
break;
if (strlen (buf) == 3 && buf[0] == 'E'
- && isdigit (buf[1]) && isdigit (buf[2]))
+ && isxdigit (buf[1]) && isxdigit (buf[2]))
{
error (_("Protocol error with Rcmd"));
}