aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2021-03-29 13:48:43 -0300
committerLuis Machado <luis.machado@linaro.org>2021-03-30 09:23:11 -0300
commit782c1ab836f73e9f18ad615a464b9dea92754f05 (patch)
tree98cdf635a3952b0ce3ea1b6c9bf59473836150c7 /gdbserver
parent5e0423804a6e421e0e8a22631eab42c984502f25 (diff)
downloadgdb-782c1ab836f73e9f18ad615a464b9dea92754f05.zip
gdb-782c1ab836f73e9f18ad615a464b9dea92754f05.tar.gz
gdb-782c1ab836f73e9f18ad615a464b9dea92754f05.tar.bz2
Fix inverted logic bug
During reviews, I changed the success/failure variables from int to bool, but missed updating the code in a couple spots. Given the logic inversion, the gdbserver code fails instead of succeeding. Fixed with the following patch. Seems fairly obvious, so I'll push it soon. gdbserver/ChangeLog: 2021-03-30 Luis Machado <luis.machado@linaro.org> * server.cc (handle_general_set, handle_query): Update variable to bool and fix verification logic.
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/ChangeLog5
-rw-r--r--gdbserver/server.cc10
2 files changed, 10 insertions, 5 deletions
diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index edce56b..58ed0f0 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-30 Luis Machado <luis.machado@linaro.org>
+
+ * server.cc (handle_general_set, handle_query): Update variable
+ to bool and fix verification logic.
+
2021-03-24 Luis Machado <luis.machado@linaro.org>
* Makefile.in (SFILES): Add /../gdb/nat/aarch64-mte-linux-ptrace.c.
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index fd5e780..2a44330 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -982,13 +982,13 @@ handle_general_set (char *own_buf)
require_running_or_return (own_buf);
- int ret = parse_store_memtags_request (own_buf, &addr, &len, tags,
+ bool ret = parse_store_memtags_request (own_buf, &addr, &len, tags,
&type);
- if (ret == 0)
+ if (ret)
ret = the_target->store_memtags (addr, len, tags, type);
- if (ret)
+ if (!ret)
write_enn (own_buf);
else
write_ok (own_buf);
@@ -2730,12 +2730,12 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
parse_fetch_memtags_request (own_buf, &addr, &len, &type);
- int ret = the_target->fetch_memtags (addr, len, tags, type);
+ bool ret = the_target->fetch_memtags (addr, len, tags, type);
if (ret)
ret = create_fetch_memtags_reply (own_buf, tags);
- if (ret)
+ if (!ret)
write_enn (own_buf);
*new_packet_len_p = strlen (own_buf);