Пример #1
0
void Variable::attachMaybe(QObject *callback, const char *callbackMethod)
{
    if (hasStartedSession()) {
        // FIXME: Eventually, should be a property of variable.
        KDevelop::IDebugSession* is = KDevelop::ICore::self()->debugController()->currentSession();
        DebugSession* s = static_cast<DebugSession*>(is);
        QStringList args;
        args << "-n " + expression();
        args << QString("-d %0").arg(s->frameStackModel()->currentFrame());
        s->connection()->sendCommand("property_get", args, QByteArray(),
                                     new PropertyGetCallback(this, callback, callbackMethod));
    }
}
Variable* Watches::add(const QString& expression)
{
    if (!hasStartedSession()) return 0;

    Variable* v = currentSession()->variableController()->createVariable(
        model(), this, expression);
    appendChild(v);
    v->attachMaybe();
    if (childCount() == 1 && !isExpanded()) {
        setExpanded(true);
    }
    return v;
}
Пример #3
0
void Variable::fetchMoreChildren()
{
    int c = childItems.size();
    // FIXME: should not even try this if app is not started.
    // Probably need to disable open, or something
    if (hasStartedSession()) {
        // FIXME: Eventually, should be a property of variable.
        KDevelop::IDebugSession* is = KDevelop::ICore::self()->debugController()->currentSession();
        DebugSession* s = static_cast<DebugSession*>(is);
        kDebug() << expression() << m_fullName;
        QStringList args;
        args << "-n " + m_fullName;
        args << QString("-d %0").arg(s->frameStackModel()->currentFrame());
        s->connection()->sendCommand("property_get", args, QByteArray(),
                                     new PropertyGetCallback(this, 0, 0));
    }
}
Пример #4
0
DebugSession *currentSession()
{
    if (!hasStartedSession()) return 0;
    return static_cast<DebugSession*>(KDevelop::ICore::self()->debugController()->currentSession());
}