Commit 0653843d authored by hjk's avatar hjk
Browse files

debugger: implement stub for qThreadExtraInfo, add some debugging aid

parent 67bf3f23
......@@ -1510,7 +1510,7 @@ QString GdbEngine::fullName(const QString &fileName)
{
if (fileName.isEmpty())
return QString();
QTC_ASSERT(!m_sourcesListOutdated, /* */)
//QTC_ASSERT(!m_sourcesListOutdated, /* */)
QTC_ASSERT(!m_sourcesListUpdating, /* */)
return m_shortToFullName.value(fileName, QString());
}
......
......@@ -655,16 +655,28 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
else if (cmd == "g") {
// Read general registers.
if (m_snapshot.registerValid) {
//qDebug() << "Using cached register contents";
logMessage(msgGdbPacket(QLatin1String("Read registers")));
sendGdbServerAck();
reportRegisters();
} else {
//qDebug() << "Fetching register contents";
sendGdbServerAck();
sendTrkMessage(0x12,
TrkCB(handleAndReportReadRegisters),
trkReadRegistersMessage());
}
}
else if (cmd == "gg") {
// Force re-reading general registers for debugging purpose.
sendGdbServerAck();
m_snapshot.registerValid = false;
sendTrkMessage(0x12,
TrkCB(handleAndReportReadRegisters),
trkReadRegistersMessage());
}
else if (cmd.startsWith("Hc")) {
logMessage(msgGdbPacket(QLatin1String("Set thread & continue")));
// Set thread for subsequent operations (`m', `M', `g', `G', et.al.).
......@@ -741,6 +753,7 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
//sendGdbServerMessage("E01", "read single unknown register");
}
} else {
//qDebug() << "Fetching single register";
sendTrkMessage(0x12,
TrkCB(handleAndReportReadRegister),
trkReadRegistersMessage(), registerNumber);
......@@ -796,6 +809,12 @@ void TrkGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
"qXfer:features:read+");
}
else if (cmd.startsWith("qThreadExtraInfo")) {
// $qThreadExtraInfo,1f9#55
sendGdbServerAck();
sendGdbServerMessage(QByteArray("Nothing special").toHex());
}
else if (cmd == "qfDllInfo") {
// That's the _first_ query package.
// Happens with gdb 6.4.50.20060226-cvs / CodeSourcery.
......@@ -1092,6 +1111,7 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
#if 1
// We almost always need register values, so get them
// now before informing gdb about the stop.s
//qDebug() << "Auto-fetching registers";
sendTrkMessage(0x12,
TrkCB(handleAndReportReadRegistersAfterStop),
trkReadRegistersMessage());
......@@ -1100,7 +1120,8 @@ void TrkGdbAdapter::handleTrkResult(const TrkResult &result)
// several instruction steps, better avoid the multiple
// roundtrips through TRK in favour of an additional
// roundtrip through gdb. But gdb will ask for all registers.
sendGdbServerMessage("S05", "Target stopped");
//sendGdbServerMessage("S05", "Target stopped");
// -- or --
QByteArray ba = "T05";
appendRegister(&ba, RegisterPSGdb, addr);
sendGdbServerMessage(ba, "Registers");
......@@ -1453,7 +1474,7 @@ void TrkGdbAdapter::tryAnswerGdbMemoryRequest(bool buffered)
it = m_snapshot.memory.begin();
et = m_snapshot.memory.end();
for ( ; it != et; ++it)
qDebug() << it.key().from << it.key().to;
qDebug() << hexNumber(it.key().from) << hexNumber(it.key().to);
qDebug() << "WANTED" << wanted.from << wanted.to;
#endif
sendGdbServerMessage("E22", "");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment