Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/44029 )
Change subject: base: Report actual thread numbers to remote GDB.
......................................................................
base: Report actual thread numbers to remote GDB.
This is more accurate, and will help when the GDB stub is able to manage
multiple threads through the same connection.
Change-Id: Ica04a8e2b5e93ca254fb2c2e1b44075634a69b9c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44029
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/base/remote_gdb.cc
M src/base/remote_gdb.hh
2 files changed, 19 insertions(+), 2 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 432943e..9278eb0 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -139,6 +139,7 @@
#include <string>
#include <utility>
+#include "base/cprintf.hh"
#include "base/intmath.hh"
#include "base/socket.hh"
#include "base/trace.hh"
@@ -863,7 +864,7 @@
BaseRemoteGDB::cmdSetThread(GdbCommand::Context &ctx)
{
const char *p = ctx.data + 1; // Ignore the subcommand byte.
- if (hex2i(&p) != 0)
+ if (hex2i(&p) != tc->contextId())
throw CmdError("E01");
send("OK");
return true;
@@ -937,12 +938,14 @@
{ "C", { &BaseRemoteGDB::queryC } },
{ "Supported", { &BaseRemoteGDB::querySupported, ";" } },
{ "Xfer", { &BaseRemoteGDB::queryXfer } },
+ { "fThreadInfo", { &BaseRemoteGDB::queryFThreadInfo } },
+ { "sThreadInfo", { &BaseRemoteGDB::querySThreadInfo } },
};
void
BaseRemoteGDB::queryC(QuerySetCommand::Context &ctx)
{
- send("QC0");
+ send(csprintf("QC%x", tc->contextId()).c_str());
}
void
@@ -999,6 +1002,18 @@
send(encoded.c_str());
}
+void
+BaseRemoteGDB::queryFThreadInfo(QuerySetCommand::Context &ctx)
+{
+ send(csprintf("m%x", tc->contextId()).c_str());
+}
+
+void
+BaseRemoteGDB::querySThreadInfo(QuerySetCommand::Context &ctx)
+{
+ send("l");
+}
+
bool
BaseRemoteGDB::cmdQueryVar(GdbCommand::Context &ctx)
{
diff --git a/src/base/remote_gdb.hh b/src/base/remote_gdb.hh
index fb9131b..0d67b09 100644
--- a/src/base/remote_gdb.hh
+++ b/src/base/remote_gdb.hh
@@ -324,6 +324,8 @@
void queryC(QuerySetCommand::Context &ctx);
void querySupported(QuerySetCommand::Context &ctx);
void queryXfer(QuerySetCommand::Context &ctx);
+ void queryFThreadInfo(QuerySetCommand::Context &ctx);
+ void querySThreadInfo(QuerySetCommand::Context &ctx);
protected:
ThreadContext *context() { return tc; }
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44029
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ica04a8e2b5e93ca254fb2c2e1b44075634a69b9c
Gerrit-Change-Number: 44029
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-CC: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s