forked from qt-creator/qt-creator
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:
@@ -524,14 +524,17 @@ void CdbEngine::handleInitialSessionIdle()
|
|||||||
// QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
|
// QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
|
||||||
// (attemptBreakpointSynchronization() will be directly called then)
|
// (attemptBreakpointSynchronization() will be directly called then)
|
||||||
if (rp.breakOnMain) {
|
if (rp.breakOnMain) {
|
||||||
// FIXME:
|
BreakpointParameters bp(BreakpointAtMain);
|
||||||
// const BreakpointParameters bp(BreakpointAtMain);
|
if (rp.startMode == StartInternal || rp.startMode == StartExternal) {
|
||||||
// BreakpointModelId id(quint16(-1));
|
const QString &moduleFileName = Utils::FileName::fromString(rp.inferior.executable)
|
||||||
// QString function = cdbAddBreakpointCommand(bp, m_sourcePathMappings, id, true);
|
.fileName();
|
||||||
// runCommand({function, BuiltinCommand,
|
bp.module = moduleFileName.left(moduleFileName.indexOf('.'));
|
||||||
// [this, id](const DebuggerResponse &r) { handleBreakInsert(r, id); }});
|
}
|
||||||
|
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?
|
// Take ownership of the breakpoint. Requests insertion. TODO: Cpp only?
|
||||||
BreakpointManager::claimBreakpointsForEngine(this);
|
BreakpointManager::claimBreakpointsForEngine(this);
|
||||||
runCommand({".symopt+0x8000"}); // disable searching public symbol table - improving the symbol lookup speed
|
runCommand({".symopt+0x8000"}); // disable searching public symbol table - improving the symbol lookup speed
|
||||||
|
@@ -122,6 +122,8 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
|
|||||||
case BreakpointAtMain: {
|
case BreakpointAtMain: {
|
||||||
BreakpointParameters rc(BreakpointByFunction);
|
BreakpointParameters rc(BreakpointByFunction);
|
||||||
rc.functionName = "main";
|
rc.functionName = "main";
|
||||||
|
rc.module = p.module;
|
||||||
|
rc.oneShot = true;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
} // switch
|
} // switch
|
||||||
|
Reference in New Issue
Block a user