debugger: simplify the 'break at main' logic

This commit is contained in:
hjk
2010-12-14 12:50:10 +01:00
parent 49bb22134f
commit 7ef927ac6c
3 changed files with 8 additions and 24 deletions

View File

@@ -95,7 +95,6 @@ DebuggerStartParameters::DebuggerStartParameters() :
isSnapshot(false),
attachPID(-1),
useTerminal(false),
breakAtMain(false),
qmlServerAddress("127.0.0.1"),
qmlServerPort(0),
useServerStartScript(false),
@@ -493,9 +492,6 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
if (!d->m_startParameters.environment.size())
d->m_startParameters.environment = Utils::Environment();
if (d->m_startParameters.breakAtMain)
breakByFunctionMain();
const unsigned engineCapabilities = debuggerCapabilities();
debuggerCore()->action(OperateByInstruction)
->setEnabled(engineCapabilities & DisassemblerCapability);
@@ -510,21 +506,6 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
setupEngine();
}
void DebuggerEngine::breakByFunctionMain()
{
#ifdef Q_OS_WIN
// FIXME: wrong on non-Qt based binaries
emit breakByFunction("qMain");
#else
emit breakByFunction("main");
#endif
}
void DebuggerEngine::breakByFunction(const QString &functionName)
{
breakHandler()->breakByFunction(functionName);
}
void DebuggerEngine::resetLocation()
{
d->m_disassemblerAgent.resetLocation();