summaryrefslogtreecommitdiff
path: root/src/plugins/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r--src/plugins/debugger/breakhandler.cpp2
-rw-r--r--src/plugins/debugger/breakhandler.h2
-rw-r--r--src/plugins/debugger/debuggerengine.cpp21
-rw-r--r--src/plugins/debugger/debuggermainwindow.cpp12
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp17
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp2
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp6
7 files changed, 48 insertions, 14 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index f49bbf6881..207cddbf27 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -733,6 +733,7 @@ PROPERTY(QString, functionName, setFunctionName)
PROPERTY(BreakpointType, type, setType)
PROPERTY(int, threadSpec, setThreadSpec)
PROPERTY(QByteArray, condition, setCondition)
+PROPERTY(QString, command, setCommand)
PROPERTY(quint64, address, setAddress)
PROPERTY(QString, expression, setExpression)
PROPERTY(QString, message, setMessage)
@@ -757,6 +758,7 @@ void Breakpoint::addToCommand(DebuggerCommand *cmd) const
cmd->arg("type", type());
cmd->arg("ignorecount", ignoreCount());
cmd->arg("condition", condition().toHex());
+ cmd->arg("command", command().toUtf8().toHex());
cmd->arg("function", functionName().toUtf8());
cmd->arg("oneshot", isOneShot());
cmd->arg("enabled", isEnabled());
diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h
index 922e6fee71..af1ac48556 100644
--- a/src/plugins/debugger/breakhandler.h
+++ b/src/plugins/debugger/breakhandler.h
@@ -112,6 +112,8 @@ public:
QString expression() const;
void setExpression(const QString &expression);
QString message() const;
+ QString command() const;
+ void setCommand(const QString &command);
void setMessage(const QString &m);
BreakpointType type() const;
void setType(const BreakpointType &type);
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 11f8528918..1c9f374182 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -282,6 +282,7 @@ public slots:
void resetLocation()
{
+ m_lookupRequests.clear();
m_locationTimer.stop();
m_locationMark.reset();
m_stackHandler.resetLocation();
@@ -337,6 +338,9 @@ public:
Utils::FileInProjectFinder m_fileFinder;
QByteArray m_qtNamespace;
+
+ // Safety net to avoid infinite lookups.
+ QSet<QByteArray> m_lookupRequests; // FIXME: Integrate properly.
};
@@ -2022,6 +2026,23 @@ bool DebuggerEngine::canHandleToolTip(const DebuggerToolTipContext &context) con
void DebuggerEngine::updateItem(const QByteArray &iname)
{
+ if (d->m_lookupRequests.contains(iname)) {
+ showMessage(QString::fromLatin1("IGNORING REPEATED REQUEST TO EXPAND " + iname));
+ WatchHandler *handler = watchHandler();
+ WatchItem *item = handler->findItem(iname);
+ if (!item->hasChildren()) {
+ handler->notifyUpdateStarted({iname});
+ item->setValue(decodeData({}, "notaccessible"));
+ item->setHasChildren(false);
+ item->outdated = false;
+ item->update();
+ handler->notifyUpdateFinished();
+ return;
+ }
+ // We could legitimately end up here after expanding + closing + re-expaning an item.
+ }
+ d->m_lookupRequests.insert(iname);
+
UpdateParameters params;
params.partialVariable = iname;
doUpdateLocals(params);
diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp
index 8d8749709f..d4b6a8c955 100644
--- a/src/plugins/debugger/debuggermainwindow.cpp
+++ b/src/plugins/debugger/debuggermainwindow.cpp
@@ -81,12 +81,16 @@ DebuggerMainWindow::~DebuggerMainWindow()
{
// As we have to setParent(0) on dock widget that are not selected,
// we keep track of all and make sure we don't leak any
+ foreach (QDockWidget *dock, m_dockForDockId) {
+ if (dock && !dock->parentWidget())
+ delete dock;
+ }
+
foreach (const Perspective &perspective, m_perspectiveForPerspectiveId) {
foreach (const Perspective::Operation &operation, perspective.operations()) {
if (operation.widget && !operation.widget->parentWidget()) {
- // These are from inactive perspectives. We call setParent(0) when deactivating
- // a perspective so that the widgets can't be accidentally enabled in the wrong
- // perspectives. That's why we have to delete them manually here.
+ // These are from perspectives that never got enabled. We've taken ownership for
+ // those, so we need to delete them.
delete operation.widget;
}
}
@@ -154,7 +158,7 @@ void DebuggerMainWindow::finalizeSetup()
hbox->addWidget(m_perspectiveChooser);
hbox->addWidget(m_controlsStackWidget);
hbox->addWidget(m_statusLabel);
- hbox->addStretch();
+ hbox->addStretch(1);
hbox->addWidget(new Utils::StyledSeparator);
hbox->addWidget(viewButton);
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index ebe30a53a0..75ed55aff3 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -966,6 +966,7 @@ public:
QIcon m_locationMarkIcon;
+ QLabel *m_threadLabel = 0;
QComboBox *m_threadBox = 0;
BaseTreeView *m_breakView = 0;
@@ -1686,13 +1687,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
cmd = ActionManager::registerAction(qmlSelectDummyAction, Constants::QML_SELECTTOOL);
debugMenu->addAction(cmd);
- auto qmlZoomDummyAction = new QAction(tr("Zoom"), this);
- qmlZoomDummyAction->setCheckable(true);
- qmlZoomDummyAction->setIcon(Core::Icons::ZOOM_TOOLBAR.icon());
- qmlZoomDummyAction->setEnabled(false);
- cmd = ActionManager::registerAction(qmlZoomDummyAction, Constants::QML_ZOOMTOOL);
- debugMenu->addAction(cmd);
-
debugMenu->addSeparator();
// Don't add '1' to the string as it shows up in the shortcut dialog.
@@ -1795,7 +1789,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
}
toolbar.addWidget(new StyledSeparator);
- toolbar.addWidget(new QLabel(tr("Threads:")));
+
+ m_threadLabel = new QLabel(tr("Threads:"));
+ toolbar.addWidget(m_threadLabel);
m_threadBox = new QComboBox;
m_threadBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
@@ -1810,7 +1806,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
// qmlToolbar.addAction(qmlShowAppOnTopDummyAction);
// qmlToolbar.addWidget(new StyledSeparator);
// qmlToolbar.addAction(qmlSelectDummyAction);
-// qmlToolbar.addAction(qmlZoomDummyAction);
// qmlToolbar.addWidget(new StyledSeparator);
Perspective basePerspective({}, {
@@ -2380,6 +2375,7 @@ void DebuggerPluginPrivate::connectEngine(DebuggerEngine *engine)
engine->watchHandler()->resetWatchers();
m_localsView->hideProgressIndicator();
+ updateActiveLanguages();
}
static void changeFontSize(QWidget *widget, qreal size)
@@ -2498,6 +2494,8 @@ void DebuggerPluginPrivate::setInitialState()
action(AutoDerefPointers)->setEnabled(true);
action(ExpandStack)->setEnabled(false);
+
+ m_threadLabel->setEnabled(false);
}
void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
@@ -2595,6 +2593,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_attachToUnstartedApplication->setEnabled(true);
m_threadBox->setEnabled(state == InferiorStopOk || state == InferiorUnrunnable);
+ m_threadLabel->setEnabled(m_threadBox->isEnabled());
const bool isCore = engine->runParameters().startMode == AttachCore;
const bool stopped = state == InferiorStopOk;
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 9ff2da841b..5b99bcd2c8 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -2233,7 +2233,7 @@ void GdbEngine::executeReturn()
setTokenBarrier();
notifyInferiorRunRequested();
showStatusMessage(tr("Immediate return from function requested..."), 5000);
- runCommand({"-exec-finish", RunRequest, CB(handleExecuteReturn)});
+ runCommand({"-exec-return", RunRequest, CB(handleExecuteReturn)});
}
void GdbEngine::handleExecuteReturn(const DebuggerResponse &response)
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index 196972a013..283b2c87d8 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -283,6 +283,10 @@ void LldbEngine::startLldbStage2()
m_lldbProc.write("script from lldbbridge import *\n");
m_lldbProc.write("script print(dir())\n");
m_lldbProc.write("script theDumper = Dumper()\n"); // This triggers reportState("enginesetupok")
+
+ const QString commands = stringSetting(GdbStartupCommands);
+ if (!commands.isEmpty())
+ m_lldbProc.write(commands.toLocal8Bit());
}
void LldbEngine::setupInferior()
@@ -895,6 +899,8 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState)
notifyInferiorRunOk();
else if (newState == "inferiorrunfailed")
notifyInferiorRunFailed();
+ else if (newState == "continueafternextstop")
+ m_continueAtNextSpontaneousStop = true;
else if (newState == "stopped") {
notifyInferiorSpontaneousStop();
if (m_continueAtNextSpontaneousStop) {