Debugger: Use QElapsedTimer instead of QTime::elapsed()

Deprecation looming.

Change-Id: Ibafbac6fbe48d74ba7d88c22400d581e49e4e45d
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
hjk
2019-06-12 12:23:48 +02:00
parent 2391ef6088
commit 07f50c8dec
2 changed files with 7 additions and 11 deletions

View File

@@ -324,12 +324,9 @@ static QStringList mergeEnvironment(QStringList runConfigEnvironment,
return runConfigEnvironment; return runConfigEnvironment;
} }
int CdbEngine::elapsedLogTime() const int CdbEngine::elapsedLogTime()
{ {
const int elapsed = m_logTime.elapsed(); return m_logTimer.restart();
const int delta = elapsed - m_elapsedLogTime;
m_elapsedLogTime = elapsed;
return delta;
} }
void CdbEngine::createFullBacktrace() void CdbEngine::createFullBacktrace()
@@ -352,8 +349,8 @@ void CdbEngine::setupEngine()
qDebug(">setupEngine"); qDebug(">setupEngine");
init(); init();
if (!m_logTime.elapsed()) if (!m_logTimer.elapsed())
m_logTime.start(); m_logTimer.start();
// Console: Launch the stub with the suspended application and attach to it // Console: Launch the stub with the suspended application and attach to it
// CDB in theory has a command line option '-2' that launches a // CDB in theory has a command line option '-2' that launches a

View File

@@ -32,7 +32,7 @@
#include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/idevice.h>
#include <QTime> #include <QElapsedTimer>
namespace Debugger { namespace Debugger {
namespace Internal { namespace Internal {
@@ -195,7 +195,7 @@ private:
NormalizedSourceFileName sourceMapNormalizeFileNameFromDebugger(const QString &f); NormalizedSourceFileName sourceMapNormalizeFileNameFromDebugger(const QString &f);
void doUpdateLocals(const UpdateParameters &params) override; void doUpdateLocals(const UpdateParameters &params) override;
void updateAll() override; void updateAll() override;
int elapsedLogTime() const; int elapsedLogTime();
unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto); unsigned parseStackTrace(const GdbMi &data, bool sourceStepInto);
void mergeStartParametersSourcePathMap(); void mergeStartParametersSourcePathMap();
@@ -223,8 +223,7 @@ private:
wow64Stack32Bit, wow64Stack32Bit,
wow64Stack64Bit wow64Stack64Bit
} m_wow64State = wow64Uninitialized; } m_wow64State = wow64Uninitialized;
QTime m_logTime; QElapsedTimer m_logTimer;
mutable int m_elapsedLogTime = 0;
QString m_extensionMessageBuffer; QString m_extensionMessageBuffer;
bool m_sourceStepInto = false; bool m_sourceStepInto = false;
int m_watchPointX = 0; int m_watchPointX = 0;