Debugger: Shift initial breakpoint setting even further down

In case of 'attach' this is still a bit too early to avoid pending
breakpoints, but we are getting there.

Also, lump in the commandsAfterConnect bits into the initial breakpoint
setting, as this is the right time. The function is mis-nomed now, will
be fixed in a later patch.

Change-Id: I8c4c53d02b4eab31e8e095865fc3cb24265c5028
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-01-06 16:45:03 +01:00
parent b4cc084a98
commit 0cb171ac96

View File

@@ -3857,14 +3857,6 @@ void GdbEngine::handleInferiorPrepared()
{
CHECK_STATE(EngineSetupRequested);
const DebuggerRunParameters &rp = runParameters();
if (!rp.commandsAfterConnect.isEmpty()) {
const QString commands = expand(rp.commandsAfterConnect);
for (const QString &command : commands.split('\n'))
runCommand({command, NativeCommand});
}
claimInitialBreakpoints();
notifyEngineSetupOk();
runEngine();
}
@@ -4024,7 +4016,7 @@ bool GdbEngine::isTermEngine() const
void GdbEngine::claimInitialBreakpoints()
{
CHECK_STATE(EngineSetupRequested);
CHECK_STATE(EngineRunRequested);
const DebuggerRunParameters &rp = runParameters();
if (rp.startMode != AttachToCore) {
@@ -4048,6 +4040,12 @@ void GdbEngine::claimInitialBreakpoints()
// response, as the command is synchronous from Creator's point of view,
// and even if it fails (e.g. due to stripped binaries), continuing with
// the start up is the best we can do.
if (!rp.commandsAfterConnect.isEmpty()) {
const QString commands = expand(rp.commandsAfterConnect);
for (const QString &command : commands.split('\n'))
runCommand({command, NativeCommand});
}
}
void GdbEngine::setupInferior()
@@ -4186,6 +4184,8 @@ void GdbEngine::runEngine()
{
CHECK_STATE(EngineRunRequested);
claimInitialBreakpoints();
const DebuggerRunParameters &rp = runParameters();
if (rp.startMode == AttachToRemoteProcess) {