diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 3fa987103ffe296e96a1609b8e989b663e29494a..3b5431012aa8c2837041898e26f4adcf88951bbb 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -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(); diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 84f8ab32f82a1af820a8f01c93291583686a7440..41137705879d749e5228d5c7c1215f448a82ea95 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -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 diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 9330df449a39d4a9a342de2f1e50c0e8f88e9cb9..7686619734ae4cee60119430e3c5a927207b7167 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -1275,4 +1275,4 @@ struct QMetaTypeId< QMap<uint, QStringList> > return metatype_id; \ } \ }; -QT_END_NAMESPACE \ No newline at end of file +QT_END_NAMESPACE