Quentin Forcioli has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/63527?usp=email )
(
9 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
)Change subject: base: cmdIsThreadAlive implementation
......................................................................
base: cmdIsThreadAlive implementation
Some GDB implementations, specifically ARM's, needed this to be able to
switch between thread.
Change-Id: I0d4db0c008c336eac51008bcfefd04c375c333f7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63527
Reviewed-by: Bobby Bruce <bbr...@ucdavis.edu>
Maintainer: Bobby Bruce <bbr...@ucdavis.edu>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/base/remote_gdb.cc
M src/base/remote_gdb.hh
2 files changed, 34 insertions(+), 1 deletion(-)
Approvals:
Bobby Bruce: 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 fb778a6..2cc8402 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -971,7 +971,7 @@
// signal and step
{ 'S', { "KGDB_ASYNC_STEP", &BaseRemoteGDB::cmdAsyncStep } },
// find out if the thread is alive
- { 'T', { "KGDB_THREAD_ALIVE", &BaseRemoteGDB::cmdUnsupported } },
+ { 'T', { "KGDB_THREAD_ALIVE", &BaseRemoteGDB::cmdIsThreadAlive } },
//multi letter command
{ 'v', { "KGDB_MULTI_LETTER", &BaseRemoteGDB::cmdMultiLetter } },
// target exited
@@ -1106,6 +1106,22 @@
}
bool
+BaseRemoteGDB::cmdIsThreadAlive(GdbCommand::Context &ctx)
+{
+ const char *p = ctx.data;
+ int tid = 0;
+ bool all, any;
+ if (!parseThreadId(&p, all, any, tid))
+ throw CmdError("E01");
+ if (all)
+ throw CmdError("E03");
+ if (threads.find(tid) == threads.end())
+ throw CmdError("E04");
+ send("OK");
+ return true;
+}
+
+bool
BaseRemoteGDB::cmdMemR(GdbCommand::Context &ctx)
{
const char *p = ctx.data;
diff --git a/src/base/remote_gdb.hh b/src/base/remote_gdb.hh
index 3d8f703..d0c4781 100644
--- a/src/base/remote_gdb.hh
+++ b/src/base/remote_gdb.hh
@@ -378,6 +378,7 @@
bool cmdRegR(GdbCommand::Context &ctx);
bool cmdRegW(GdbCommand::Context &ctx);
bool cmdSetThread(GdbCommand::Context &ctx);
+ bool cmdIsThreadAlive(GdbCommand::Context &ctx);
bool cmdMemR(GdbCommand::Context &ctx);
bool cmdMemW(GdbCommand::Context &ctx);
bool cmdQueryVar(GdbCommand::Context &ctx);
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/63527?usp=email
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: I0d4db0c008c336eac51008bcfefd04c375c333f7
Gerrit-Change-Number: 63527
Gerrit-PatchSet: 11
Gerrit-Owner: Quentin Forcioli <quentin.forci...@telecom-paris.fr>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Quentin Forcioli <quentin.forci...@telecom-paris.fr>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org