Utils: Don't raise SIGSTOP in the process stub

Previously, the starting inferior was sent a SIGSTOP to avoid
progress before the debugger could attach.

However, these signals are then also visible in the debugger and
need to be ignored as part of the startup handling in Creator.

The waiting effect can be achieved less intrusively by waiting
on a pipe read between fork() and exec().

Task-number: QTCREATORBUG-25073
Task-number: QTCREATORBUG-25082
Task-number: QTCREATORBUG-25227
Change-Id: Ie70b9eb5ea865f85411c26b0dbf377a019fec8d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-02-25 12:38:44 +01:00
parent d37f6648f3
commit 89646aadce
7 changed files with 50 additions and 41 deletions

View File

@@ -1147,26 +1147,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
return;
}
// Ignore signals from the process stub.
const GdbMi frame = data["frame"];
if (terminal()
&& data["reason"].data() == "signal-received"
&& data["signal-name"].data() == "SIGSTOP")
{
const QString from = frame["from"].data();
const QString func = frame["func"].data();
if (from.endsWith("/ld-linux.so.2")
|| from.endsWith("/ld-linux-x86-64.so.2")
|| func == "clone"
|| func == "kill")
{
showMessage("INTERNAL CONTINUE AFTER SIGSTOP FROM STUB", LogMisc);
notifyInferiorSpontaneousStop();
continueInferiorInternal();
return;
}
}
if (!m_onStop.isEmpty()) {
notifyInferiorStopOk();
showMessage("HANDLING QUEUED COMMANDS AFTER TEMPORARY STOP", LogMisc);
@@ -1184,6 +1164,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
QString fullName;
QString function;
QString language;
const GdbMi frame = data["frame"];
if (frame.isValid()) {
const GdbMi lineNumberG = frame["line"];
function = frame["function"].data(); // V4 protocol
@@ -4919,7 +4900,9 @@ void GdbEngine::handleStubAttached(const DebuggerResponse &response, qint64 main
notifyEngineRunAndInferiorStopOk();
continueInferiorInternal();
} else {
showMessage("INFERIOR ATTACHED AND RUNNING");
showMessage("INFERIOR ATTACHED");
QTC_ASSERT(terminal(), return);
terminal()->kickoffProcess();
//notifyEngineRunAndInferiorRunOk();
// Wait for the upcoming *stopped and handle it there.
}