forked from qt-creator/qt-creator
Debugger: Implement basic value assignment for PdbEngine
Change-Id: I505c3e9c4a239ed381d525b5acaf1acf3a06a59a Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -233,6 +233,14 @@ def qdebug(cmd, args):
|
|||||||
% (module, dir(module) if module else []))
|
% (module, dir(module) if module else []))
|
||||||
self.flushOutput()
|
self.flushOutput()
|
||||||
|
|
||||||
|
def assignValue(self, args):
|
||||||
|
exp = args['expression']
|
||||||
|
value = args['value']
|
||||||
|
cmd = "%s=%s" % (exp, exp, value)
|
||||||
|
eval(cmd, {})
|
||||||
|
self.put("CMD: '%s'" % cmd)
|
||||||
|
self.flushOutput()
|
||||||
|
|
||||||
def stackListFrames(self, args):
|
def stackListFrames(self, args):
|
||||||
#isNativeMixed = int(args.get('nativeMixed', 0))
|
#isNativeMixed = int(args.get('nativeMixed', 0))
|
||||||
#result = 'stack={current-thread="%s"' % thread.GetThreadID()
|
#result = 'stack={current-thread="%s"' % thread.GetThreadID()
|
||||||
|
|||||||
@@ -454,18 +454,17 @@ bool PdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PdbEngine::assignValueInDebugger(const Internal::WatchData *, const QString &expression, const QVariant &value)
|
void PdbEngine::assignValueInDebugger(const WatchData *, const QString &expression, const QVariant &value)
|
||||||
{
|
{
|
||||||
Q_UNUSED(expression);
|
//DebuggerCommand cmd("assignValue");
|
||||||
Q_UNUSED(value);
|
//cmd.arg("expression", expression);
|
||||||
SDEBUG("ASSIGNING: " << (expression + QLatin1Char('=') + value.toString()));
|
//cmd.arg("value", value.toString());
|
||||||
#if 0
|
//runCommand(cmd);
|
||||||
m_scriptEngine->evaluate(expression + QLatin1Char('=') + value.toString());
|
QByteArray exp = expression.toUtf8();
|
||||||
|
postDirectCommand("global " + exp + ';' + exp + "=" + value.toString().toUtf8());
|
||||||
updateLocals();
|
updateLocals();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PdbEngine::updateWatchData(const WatchData &data, const WatchUpdateFlags &flags)
|
void PdbEngine::updateWatchData(const WatchData &data, const WatchUpdateFlags &flags)
|
||||||
{
|
{
|
||||||
Q_UNUSED(data);
|
Q_UNUSED(data);
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ QString WatchItem::expression() const
|
|||||||
if (!p->d.exp.isEmpty())
|
if (!p->d.exp.isEmpty())
|
||||||
return QString::fromLatin1("(%1).%2").arg(QString::fromLatin1(p->d.exp), d.name);
|
return QString::fromLatin1("(%1).%2").arg(QString::fromLatin1(p->d.exp), d.name);
|
||||||
}
|
}
|
||||||
return QString();
|
return d.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString WatchItem::displayName() const
|
QString WatchItem::displayName() const
|
||||||
@@ -754,7 +754,7 @@ QVariant WatchItem::data(int column, int role) const
|
|||||||
case Qt::EditRole: {
|
case Qt::EditRole: {
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case 0:
|
case 0:
|
||||||
return QVariant(expression());
|
return expression();
|
||||||
case 1:
|
case 1:
|
||||||
return editValue();
|
return editValue();
|
||||||
case 2:
|
case 2:
|
||||||
@@ -785,7 +785,7 @@ QVariant WatchItem::data(int column, int role) const
|
|||||||
return color();
|
return color();
|
||||||
|
|
||||||
case LocalsExpressionRole:
|
case LocalsExpressionRole:
|
||||||
return QVariant(expression());
|
return expression();
|
||||||
|
|
||||||
case LocalsRawExpressionRole:
|
case LocalsRawExpressionRole:
|
||||||
return d.exp;
|
return d.exp;
|
||||||
|
|||||||
Reference in New Issue
Block a user