From e7cb7471c0aa2d8dbdf44b4255cd95159b086f2e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 4 May 2011 15:40:15 +0200 Subject: [PATCH] Debugger: Fix Action enabling, implement breakOnMain for CDB. --- src/plugins/debugger/cdb/cdbengine.cpp | 6 ++++++ src/plugins/debugger/debuggerplugin.cpp | 15 +++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 495b116e404..d2c38dff43f 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -820,6 +820,12 @@ void CdbEngine::setupInferior() if (debug) qDebug("setupInferior"); attemptBreakpointSynchronization(); + + if (startParameters().breakOnMain) { + const BreakpointParameters bp(BreakpointAtMain); + postCommand(cdbAddBreakpointCommand(bp, m_sourcePathMappings, + BreakpointId(-1), true), 0); + } postCommand("sxn 0x4000001f", 0); // Do not break on WowX86 exceptions. postCommand(".asm source_line", 0); // Source line in assembly postExtensionCommand("pid", QByteArray(), 0, &CdbEngine::handlePid); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index b741b70fc95..13da5ee04a7 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1396,15 +1396,7 @@ void DebuggerPluginPrivate::startExternalApplication() // Set up an ARM Symbian Abi sp.toolChainAbi = Abi(Abi::ArmArchitecture, Abi::SymbianOS, Abi::SymbianDeviceFlavor, Abi::ElfFormat, false); - if (dlg.breakAtMain()) { -#ifdef Q_OS_WIN - // FIXME: wrong on non-Qt based binaries - breakHandler()->breakByFunction("qMain"); -#else - breakHandler()->breakByFunction("main"); -#endif - } - + sp.breakOnMain = dlg.breakAtMain(); if (RunControl *rc = m_debuggerRunControlFactory->create(sp)) startDebugger(rc); } @@ -2100,7 +2092,10 @@ void DebuggerPluginPrivate::updateDebugActions() { ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); Project *project = pe->startupProject(); - m_debugAction->setEnabled(pe->canRun(project, Constants::DEBUGMODE)); + m_debugAction->setEnabled(pe->canRun(project, _(Constants::DEBUGMODE))); + const bool canStepInto = pe->canRun(project, _(Constants::DEBUGMODE2)); + m_stepAction->setEnabled(canStepInto); + m_nextAction->setEnabled(canStepInto); } void DebuggerPluginPrivate::onCoreAboutToOpen()