Debugger: fix start and break on main for cdb

Change-Id: Ifba8ff024b63987f3576caee594cf249f957616d
Fixes: QTCREATORBUG-22263
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2019-05-03 10:58:47 +02:00
parent 56a1b499b5
commit bc51772c1d
2 changed files with 12 additions and 7 deletions

View File

@@ -524,14 +524,17 @@ void CdbEngine::handleInitialSessionIdle()
// QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
// (attemptBreakpointSynchronization() will be directly called then)
if (rp.breakOnMain) {
// FIXME:
// const BreakpointParameters bp(BreakpointAtMain);
// BreakpointModelId id(quint16(-1));
// QString function = cdbAddBreakpointCommand(bp, m_sourcePathMappings, id, true);
// runCommand({function, BuiltinCommand,
// [this, id](const DebuggerResponse &r) { handleBreakInsert(r, id); }});
BreakpointParameters bp(BreakpointAtMain);
if (rp.startMode == StartInternal || rp.startMode == StartExternal) {
const QString &moduleFileName = Utils::FileName::fromString(rp.inferior.executable)
.fileName();
bp.module = moduleFileName.left(moduleFileName.indexOf('.'));
}
QString function = cdbAddBreakpointCommand(bp, m_sourcePathMappings);
runCommand({function, BuiltinCommand, [this](const DebuggerResponse &r) {
handleBreakInsert(r, Breakpoint());
}});
}
// Take ownership of the breakpoint. Requests insertion. TODO: Cpp only?
BreakpointManager::claimBreakpointsForEngine(this);
runCommand({".symopt+0x8000"}); // disable searching public symbol table - improving the symbol lookup speed

View File

@@ -122,6 +122,8 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
case BreakpointAtMain: {
BreakpointParameters rc(BreakpointByFunction);
rc.functionName = "main";
rc.module = p.module;
rc.oneShot = true;
return rc;
}
} // switch