Commit eb83377f authored by hjk's avatar hjk

debugger: enhance time logging for individual commands

parent 09a4409c
......@@ -738,6 +738,7 @@ void GdbEngine::postCommand(const QString &command, GdbCommandFlags flags,
void GdbEngine::flushCommand(GdbCommand &cmd)
{
++currentToken();
cmd.postTime = QTime::currentTime();
m_cookieForToken[currentToken()] = cmd;
cmd.command = QString::number(currentToken()) + cmd.command;
if (cmd.flags & EmbedToken)
......@@ -761,6 +762,11 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record)
return;
GdbCommand cmd = m_cookieForToken.take(token);
if (theDebuggerBoolSetting(LogTimeStamps)) {
emit gdbOutputAvailable(LogTime, _("Response time: %1: %2 s")
.arg(cmd.command)
.arg(cmd.postTime.msecsTo(QTime::currentTime()) / 1000.));
}
if (record.token < m_oldestAcceptableToken && (cmd.flags & Discardable)) {
//qDebug() << "### SKIPPING OLD RESULT" << record.toString();
......
......@@ -44,6 +44,7 @@
#include <QtCore/QProcess>
#include <QtCore/QPoint>
#include <QtCore/QTextCodec>
#include <QtCore/QTime>
#include <QtCore/QVariant>
QT_BEGIN_NAMESPACE
......@@ -164,6 +165,7 @@ private:
const char *callbackName;
QString command;
QVariant cookie;
QTime postTime;
};
// type and cookie are sender-internal data, opaque for the "event
......
......@@ -1275,4 +1275,4 @@ struct QMetaTypeId< QMap<uint, QStringList> >
return metatype_id; \
} \
};
QT_END_NAMESPACE
\ No newline at end of file
QT_END_NAMESPACE
Markdown is supported
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