base: Use the correct string size in BaseRemoteGDB::cmd_query_var.

The size of the command should be len, the length of the command string,
not len - 1. Looking at query strings shows that they were previously
being truncated by one character.

Change-Id: I283891eadafaa07d12453f085e8a106d59a4f889
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44026
Reviewed-by: Boris Shingarov <shingarov@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-06-07 17:28:32 -07:00
committed by Gabe Black
parent 49f7565904
commit d8078f3665

View File

@@ -922,7 +922,7 @@ BaseRemoteGDB::cmd_mem_w(GdbCommand::Context &ctx)
bool
BaseRemoteGDB::cmd_query_var(GdbCommand::Context &ctx)
{
std::string s(ctx.data, ctx.len - 1);
std::string s(ctx.data, ctx.len);
std::string xfer_read_prefix = "Xfer:features:read:";
if (s.rfind("Supported:", 0) == 0) {
std::ostringstream oss;