diff options
author | hjk <qtc-committer@nokia.com> | 2012-05-08 16:50:03 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-05-08 17:50:06 +0200 |
commit | 441b98b0ddd1e57f0ee9f4d59fb9fd3e929a4e13 (patch) | |
tree | 9bad26fbb7796972200c97680bcd6ce59e77f409 | |
parent | 7f3d93023e058744cdf25eedefcc344f13352fa5 (diff) | |
download | qt-creator-441b98b0ddd1e57f0ee9f4d59fb9fd3e929a4e13.tar.gz |
debugger: make debuggerengine easier accessible to profiling
Change-Id: I5c9ed1e994e490a6a6859afc6ae1756b09b87af9
Reviewed-by: hjk <qthjk@ovi.com>
-rw-r--r-- | src/plugins/debugger/debuggerengine.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index f5bf0acf42..563b5d248e 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -86,6 +86,10 @@ enum { debug = 0 }; #define SDEBUG(s) if (!debug) {} else qDebug() << s; #define XSDEBUG(s) qDebug() << s +//#define WITH_BENCHMARK +#ifdef WITH_BENCHMARK +#include <valgrind/callgrind.h> +#endif /////////////////////////////////////////////////////////////////////// // @@ -879,6 +883,9 @@ void DebuggerEngine::notifyInferiorSetupFailed() void DebuggerEngine::notifyInferiorSetupOk() { +#ifdef WITH_BENCHMARK + CALLGRIND_START_INSTRUMENTATION; +#endif showMessage(_("NOTE: INFERIOR SETUP OK")); QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << this << state()); setState(InferiorSetupOk); @@ -1174,6 +1181,10 @@ void DebuggerEnginePrivate::setRemoteSetupState(RemoteSetupState state) void DebuggerEngine::notifyEngineIll() { +#ifdef WITH_BENCHMARK + CALLGRIND_STOP_INSTRUMENTATION; + CALLGRIND_DUMP_STATS; +#endif showMessage(_("NOTE: ENGINE ILL ******")); d->m_targetState = DebuggerFinished; d->m_lastGoodState = d->m_state; @@ -1203,6 +1214,10 @@ void DebuggerEngine::notifyEngineIll() void DebuggerEngine::notifyEngineSpontaneousShutdown() { +#ifdef WITH_BENCHMARK + CALLGRIND_STOP_INSTRUMENTATION; + CALLGRIND_DUMP_STATS; +#endif showMessage(_("NOTE: ENGINE SPONTANEOUS SHUTDOWN")); setState(EngineShutdownOk, true); if (isMasterEngine()) @@ -1211,6 +1226,10 @@ void DebuggerEngine::notifyEngineSpontaneousShutdown() void DebuggerEngine::notifyInferiorExited() { +#ifdef WITH_BENCHMARK + CALLGRIND_STOP_INSTRUMENTATION; + CALLGRIND_DUMP_STATS; +#endif showMessage(_("NOTE: INFERIOR EXITED")); d->resetLocation(); setState(InferiorExitOk); |