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 <bbruce@ucdavis.edu> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -971,7 +971,7 @@ std::map<char, BaseRemoteGDB::GdbCommand> BaseRemoteGDB::commandMap = {
|
||||
// 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
|
||||
@@ -1105,6 +1105,22 @@ BaseRemoteGDB::cmdSetThread(GdbCommand::Context &ctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -378,6 +378,7 @@ class BaseRemoteGDB
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user