Commit aa670782 authored by hjk's avatar hjk

Debugger: Implement basic value assignment for PdbEngine

Change-Id: I505c3e9c4a239ed381d525b5acaf1acf3a06a59a
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent d70bdaf4
......@@ -233,6 +233,14 @@ def qdebug(cmd, args):
% (module, dir(module) if module else []))
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):
#isNativeMixed = int(args.get('nativeMixed', 0))
#result = 'stack={current-thread="%s"' % thread.GetThreadID()
......
......@@ -454,18 +454,17 @@ bool PdbEngine::setToolTipExpression(TextEditor::TextEditorWidget *,
return true;
}
void PdbEngine::assignValueInDebugger(const Internal::WatchData *, const QString &expression, const QVariant &value)
{
Q_UNUSED(expression);
Q_UNUSED(value);
SDEBUG("ASSIGNING: " << (expression + QLatin1Char('=') + value.toString()));
#if 0
m_scriptEngine->evaluate(expression + QLatin1Char('=') + value.toString());
void PdbEngine::assignValueInDebugger(const WatchData *, const QString &expression, const QVariant &value)
{
//DebuggerCommand cmd("assignValue");
//cmd.arg("expression", expression);
//cmd.arg("value", value.toString());
//runCommand(cmd);
QByteArray exp = expression.toUtf8();
postDirectCommand("global " + exp + ';' + exp + "=" + value.toString().toUtf8());
updateLocals();
#endif
}
void PdbEngine::updateWatchData(const WatchData &data, const WatchUpdateFlags &flags)
{
Q_UNUSED(data);
......
......@@ -673,7 +673,7 @@ QString WatchItem::expression() const
if (!p->d.exp.isEmpty())
return QString::fromLatin1("(%1).%2").arg(QString::fromLatin1(p->d.exp), d.name);
}
return QString();
return d.name;
}
QString WatchItem::displayName() const
......@@ -754,7 +754,7 @@ QVariant WatchItem::data(int column, int role) const
case Qt::EditRole: {
switch (column) {
case 0:
return QVariant(expression());
return expression();
case 1:
return editValue();
case 2:
......@@ -785,7 +785,7 @@ QVariant WatchItem::data(int column, int role) const
return color();
case LocalsExpressionRole:
return QVariant(expression());
return expression();
case LocalsRawExpressionRole:
return d.exp;
......
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