From 441b98b0ddd1e57f0ee9f4d59fb9fd3e929a4e13 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 8 May 2012 16:50:03 +0200 Subject: debugger: make debuggerengine easier accessible to profiling Change-Id: I5c9ed1e994e490a6a6859afc6ae1756b09b87af9 Reviewed-by: hjk --- src/plugins/debugger/debuggerengine.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 +#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); -- cgit v1.2.1