base: adding queryAttached and querySymbol to GDB
In some cases/version these queries might be needed to make the remote GDB connect correctly to the stub. Change-Id: I98cdc9b4a952b4dc64f9357e6148af6e3351ef92 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63530 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:
@@ -1299,8 +1299,10 @@ splitAt(std::string str, const char * const delim)
|
||||
std::map<std::string, BaseRemoteGDB::QuerySetCommand>
|
||||
BaseRemoteGDB::queryMap = {
|
||||
{ "C", { &BaseRemoteGDB::queryC } },
|
||||
{ "Attached", { &BaseRemoteGDB::queryAttached} },
|
||||
{ "Supported", { &BaseRemoteGDB::querySupported, ";" } },
|
||||
{ "Xfer", { &BaseRemoteGDB::queryXfer } },
|
||||
{ "Symbol", { &BaseRemoteGDB::querySymbol ,":" } },
|
||||
{ "fThreadInfo", { &BaseRemoteGDB::queryFThreadInfo } },
|
||||
{ "sThreadInfo", { &BaseRemoteGDB::querySThreadInfo } },
|
||||
};
|
||||
@@ -1364,6 +1366,25 @@ BaseRemoteGDB::queryXfer(QuerySetCommand::Context &ctx)
|
||||
encodeXferResponse(content, encoded, offset, length);
|
||||
send(encoded);
|
||||
}
|
||||
void
|
||||
BaseRemoteGDB::querySymbol(QuerySetCommand::Context &ctx)
|
||||
{
|
||||
//The target does not need to look up any (more) symbols.
|
||||
send("OK");
|
||||
}
|
||||
|
||||
void
|
||||
BaseRemoteGDB::queryAttached(QuerySetCommand::Context &ctx)
|
||||
{
|
||||
std::string pid="";
|
||||
if (!ctx.args.empty() && !ctx.args[0].empty()){
|
||||
pid=ctx.args[0];
|
||||
}
|
||||
DPRINTF(GDBMisc, "QAttached : pid=%s\n",pid);
|
||||
//The remote server is attached to an existing process.
|
||||
send("1");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BaseRemoteGDB::queryFThreadInfo(QuerySetCommand::Context &ctx)
|
||||
|
||||
@@ -426,6 +426,8 @@ class BaseRemoteGDB
|
||||
void queryC(QuerySetCommand::Context &ctx);
|
||||
void querySupported(QuerySetCommand::Context &ctx);
|
||||
void queryXfer(QuerySetCommand::Context &ctx);
|
||||
void querySymbol(QuerySetCommand::Context &ctx);
|
||||
void queryAttached(QuerySetCommand::Context &ctx);
|
||||
|
||||
size_t threadInfoIdx = 0;
|
||||
void queryFThreadInfo(QuerySetCommand::Context &ctx);
|
||||
|
||||
Reference in New Issue
Block a user