m_sourceStepInto(false),
m_wX86BreakpointCount(0),
m_watchPointX(0),
- m_watchPointY(0)
+ m_watchPointY(0),
+ m_ignoreCdbOutput(false)
{
Utils::SavedAction *assemblerAction = theAssemblerAction();
m_operateByInstructionPending = assemblerAction->isChecked();
connect(&m_process, SIGNAL(readyReadStandardError()), this, SLOT(readyReadStandardOut()));
}
+void CdbEngine::init()
+{
+ m_effectiveStartMode = NoStartMode;
+ m_inferiorPid = 0;
+ m_accessible = false;
+ m_specialStopMode = NoSpecialStop;
+ m_nextCommandToken = 0;
+ m_currentBuiltinCommandIndex = -1;
+ m_operateByInstructionPending = true;
+ m_operateByInstruction = true; // Default CDB setting
+ m_notifyEngineShutdownOnTermination = false;
+ m_hasDebuggee = false;
+ m_sourceStepInto = false;
+ m_wX86BreakpointCount = 0;
+ m_watchPointX = m_watchPointY = 0;
+ m_ignoreCdbOutput = false;
+
+ m_outputBuffer.clear();
+ m_builtinCommandQueue.clear();
+ m_extensionCommandQueue.clear();
+ m_extensionMessageBuffer.clear();
+ m_pendingBreakpointMap.clear();
+ QTC_ASSERT(m_process.state() != QProcess::Running, Utils::SynchronousProcess::stopProcess(m_process); )
+}
+
CdbEngine::~CdbEngine()
{
}
&(m_options->symbolPaths)))
m_options->toSettings(Core::ICore::instance()->settings());
- m_logTime.start();
+ init();
+ if (!m_logTime.elapsed())
+ m_logTime.start();
QString errorMessage;
// Console: Launch the stub with the suspended application and attach to it
// CDB in theory has a command line option '-2' that launches a
return;
}
if (!canInterruptInferior() || commandsPending()) {
+ QString msg = QLatin1String("Cannot interrupt the inferior");
+ if (commandsPending())
+ msg += QLatin1String(" (pending)");
+ msg += QLatin1Char('.');
+ showMessage(msg, LogWarning);
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorShutdownFailed")
notifyInferiorShutdownFailed();
return;
}
// No longer trigger anything from messages
- disconnect(&m_process, SIGNAL(readyReadStandardOutput()), this, 0);
- disconnect(&m_process, SIGNAL(readyReadStandardError()), this, 0);
+ m_ignoreCdbOutput = true;
// Go for kill if there are commands pending.
if (m_accessible && !commandsPending()) {
// detach: Wait for debugger to finish.
bool CdbEngine::canInterruptInferior() const
{
- return m_effectiveStartMode != AttachToRemote;
+ return m_effectiveStartMode != AttachToRemote && m_inferiorPid;
}
void CdbEngine::interruptInferior()
{
+ if (debug)
+ qDebug() << "CdbEngine::interruptInferior()" << stateName(state());
if (canInterruptInferior()) {
doInterruptInferior(NoSpecialStop);
} else {
const SpecialStopMode oldSpecialMode = m_specialStopMode;
m_specialStopMode = sm;
QString errorMessage;
+ showMessage(QString::fromLatin1("Interrupting process %1...").arg(m_inferiorPid), LogMisc);
if (!winDebugBreakProcess(m_inferiorPid, &errorMessage)) {
m_specialStopMode = oldSpecialMode;
- showMessage(errorMessage, LogError);
+ showMessage(QString::fromLatin1("Cannot interrupt process %1: %2").arg(m_inferiorPid).arg(errorMessage), LogError);
}
#else
Q_UNUSED(sm)
void CdbEngine::readyReadStandardOut()
{
+ if (m_ignoreCdbOutput)
+ return;
m_outputBuffer += m_process.readAllStandardOutput();
// Split into lines and parse line by line.
while (true) {