Commit d27430f5 authored by hjk's avatar hjk

debugger: some infrastructure for gdb's target-async

parent 834ebe0c
......@@ -252,6 +252,13 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
item->setValue(true);
insertItem(LoadGdbInit, item);
item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("TargetAsync"));
item->setCheckable(true);
item->setDefaultValue(false);
item->setValue(false);
insertItem(TargetAsync, item);
item = new SavedAction(this);
item->setSettingsKey(debugModeGroup, QLatin1String("ScriptFile"));
item->setDefaultValue(QString());
......
......@@ -106,6 +106,7 @@ enum DebuggerActionCode
GdbScriptFile,
ExecuteCommand,
GdbWatchdogTimeout,
TargetAsync,
// Stack
MaximalStackDepth,
......
......@@ -642,9 +642,14 @@ void GdbEngine::readGdbStandardOutput()
void GdbEngine::interruptInferior()
{
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state(); return);
showStatusMessage(tr("Stop requested..."), 5000);
showMessage(_("TRYING TO INTERRUPT INFERIOR"));
m_gdbAdapter->interruptInferior();
if (debuggerCore()->boolSetting(TargetAsync)) {
postCommand("-exec-interrupt");
} else {
showStatusMessage(tr("Stop requested..."), 5000);
showMessage(_("TRYING TO INTERRUPT INFERIOR"));
m_gdbAdapter->interruptInferior();
}
}
void GdbEngine::interruptInferiorTemporarily()
......@@ -4157,18 +4162,20 @@ void GdbEngine::handleFetchDisassemblerByCli(const GdbResponse &response)
// Starting up & shutting down
//
bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QString &settingsIdHint)
bool GdbEngine::startGdb(const QStringList &args, const QString &gdb,
const QString &settingsIdHint)
{
gdbProc()->disconnect(); // From any previous runs
const DebuggerStartParameters &sp = startParameters();
m_gdb = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_PATH"));
if (m_gdb.isEmpty() && startParameters().startMode != StartRemoteGdb)
m_gdb = debuggerCore()->gdbBinaryForToolChain(startParameters().toolChainType);
if (m_gdb.isEmpty() && sp.startMode != StartRemoteGdb)
m_gdb = debuggerCore()->gdbBinaryForToolChain(sp.toolChainType);
if (m_gdb.isEmpty())
m_gdb = gdb;
if (m_gdb.isEmpty()) {
handleAdapterStartFailed(
msgNoBinaryForToolChain(startParameters().toolChainType),
msgNoBinaryForToolChain(sp.toolChainType),
GdbOptionsPage::settingsId());
return false;
}
......@@ -4301,6 +4308,11 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr
postCommand("set height 0");
postCommand("set auto-solib-add on");
if (debuggerCore()->boolSetting(TargetAsync)) {
postCommand("set target-async on");
postCommand("set non-stop on");
}
if (false && m_isMacGdb) {
// FIXME: m_isMacGdb is only known after handleShowVersion!
// also, setting load-rules seems to be only possible after 'file'
......
......@@ -186,6 +186,8 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
m_ui->scriptFileChooser);
m_group.insert(debuggerCore()->action(LoadGdbInit),
m_ui->checkBoxLoadGdbInit);
m_group.insert(debuggerCore()->action(TargetAsync),
m_ui->checkBoxTargetAsync);
m_group.insert(debuggerCore()->action(AdjustBreakpointLocations),
m_ui->checkBoxAdjustBreakpointLocations);
m_group.insert(debuggerCore()->action(GdbWatchdogTimeout),
......@@ -222,6 +224,7 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
QTextStream(&m_searchKeywords)
<< sep << m_ui->groupBoxLocations->title()
<< sep << m_ui->checkBoxLoadGdbInit->text()
<< sep << m_ui->checkBoxTargetAsync->text()
<< sep << m_ui->labelGdbStartupScript->text()
<< sep << m_ui->labelGdbWatchdogTimeout->text()
<< sep << m_ui->checkBoxEnableReverseDebugging->text()
......
......@@ -109,6 +109,13 @@ on slow machines. In this case, the value should be increased.</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxTargetAsync">
<property name="text">
<string>Use asyncronous mode to control the inferior</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment