当前位置: 首页>>代码示例>>C++>>正文


C++ GdbMi::data方法代码示例

本文整理汇总了C++中GdbMi::data方法的典型用法代码示例。如果您正苦于以下问题:C++ GdbMi::data方法的具体用法?C++ GdbMi::data怎么用?C++ GdbMi::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GdbMi的用法示例。


在下文中一共展示了GdbMi::data方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parseBreakPoint

// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r,
                     QString *expression /*  = 0 */)
{
    gdbmiChildToBool(gdbmi, "enabled", &(r->enabled));
    gdbmiChildToBool(gdbmi, "deferred", &(r->pending));
    r->id = BreakpointResponseId();
    const GdbMi idG = gdbmi.findChild("id");
    if (idG.isValid()) { // Might not be valid if there is not id
        bool ok;
        const int id = idG.data().toInt(&ok);
        if (ok)
            r->id = BreakpointResponseId(id);
    }
    const GdbMi moduleG = gdbmi.findChild("module");
    if (moduleG.isValid())
        r->module = QString::fromLocal8Bit(moduleG.data());
    if (expression) {
        const GdbMi expressionG = gdbmi.findChild("expression");
        if (expressionG.isValid())
            *expression = QString::fromLocal8Bit(expressionG.data());
    }
    const GdbMi addressG = gdbmi.findChild("address");
    if (addressG.isValid())
        r->address = addressG.data().toULongLong(0, 0);
    if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount)))
        r->ignoreCount--;
    gdbmiChildToInt(gdbmi, "thread", &(r->threadSpec));
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:31,代码来源:cdbparsehelpers.cpp

示例2: parseBreakPoint

// Parse extension command listing breakpoints.
// Note that not all fields are returned, since file, line, function are encoded
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r,
                     QString *expression /*  = 0 */)
{
    gdbmiChildToBool(gdbmi, "enabled", &(r->enabled));
    gdbmiChildToBool(gdbmi, "deferred", &(r->pending));
    r->id = BreakpointResponseId();
    // Might not be valid if there is not id
    r->id = cdbIdToBreakpointResponseId(gdbmi["id"]);
    const GdbMi moduleG = gdbmi["module"];
    if (moduleG.isValid())
        r->module = QString::fromLocal8Bit(moduleG.data());
    const GdbMi sourceFileName = gdbmi["srcfile"];
    if (sourceFileName.isValid()) {
        r->fileName = QString::fromLocal8Bit(sourceFileName.data());
        const GdbMi lineNumber = gdbmi["srcline"];
        if (lineNumber.isValid())
            r->lineNumber = lineNumber.data().toULongLong(0, 0);
    }
    if (expression) {
        const GdbMi expressionG = gdbmi["expression"];
        if (expressionG.isValid())
            *expression = QString::fromLocal8Bit(expressionG.data());
    }
    const GdbMi addressG = gdbmi["address"];
    if (addressG.isValid())
        r->address = addressG.data().toULongLong(0, 0);
    if (gdbmiChildToInt(gdbmi, "passcount", &(r->ignoreCount)))
        r->ignoreCount--;
    gdbmiChildToInt(gdbmi, "thread", &(r->threadSpec));
}
开发者ID:REZ1DENT3,项目名称:qt-creator,代码行数:33,代码来源:cdbparsehelpers.cpp

示例3: handleContinuation

void LldbEngine::handleContinuation(const GdbMi &data)
{
    if (data.data() == "updateLocals") {
        updateLocals();
    } else if (data.data() == "updateAll") {
        updateAll();
    } else {
        QTC_ASSERT(false, qDebug() << "Unknown continuation: " << data.data());
    }
}
开发者ID:aheubusch,项目名称:qt-creator,代码行数:10,代码来源:lldbengine.cpp

示例4: gdbmiChildToBool

// Helper to retrieve an bool child from GDBMI
static inline bool gdbmiChildToBool(const GdbMi &parent, const char *childName, bool *target)
{
    const GdbMi childBA = parent[childName];
    if (childBA.isValid()) {
        *target = childBA.data() == "true";
        return true;
    }
    return false;
}
开发者ID:REZ1DENT3,项目名称:qt-creator,代码行数:10,代码来源:cdbparsehelpers.cpp

示例5: refreshState

void PdbEngine::refreshState(const GdbMi &reportedState)
{
    QByteArray newState = reportedState.data();
    if (newState == "stopped") {
        notifyInferiorSpontaneousStop();
        updateAll();
    } else if (newState == "inferiorexited") {
        notifyInferiorExited();
    }
}
开发者ID:kowalikm,项目名称:qt-creator,代码行数:10,代码来源:pdbengine.cpp

示例6: cdbIdToBreakpointId

inline ModelId cdbIdToBreakpointId(const GdbMi &data)
{
    if (data.isValid()) { // Might not be valid if there is not id
        bool ok;
        const int id = data.data().toInt(&ok);
        if (ok)
            return cdbIdToBreakpointId<ModelId>(id);
    }
    return ModelId();
}
开发者ID:REZ1DENT3,项目名称:qt-creator,代码行数:10,代码来源:cdbparsehelpers.cpp

示例7: fromGdbMI

void WinException::fromGdbMI(const GdbMi &gdbmi)
{
    exceptionCode = gdbmi["exceptionCode"].data().toUInt();
    exceptionFlags = gdbmi["exceptionFlags"].data().toUInt();
    exceptionAddress = gdbmi["exceptionAddress"].data().toULongLong();
    firstChance = gdbmi["firstChance"].data() != "0";
    const GdbMi ginfo1 = gdbmi["exceptionInformation0"];
    if (ginfo1.isValid()) {
        info1 = ginfo1.data().toULongLong();
        const GdbMi ginfo2  = gdbmi["exceptionInformation1"];
        if (ginfo2.isValid())
            info2 = ginfo1.data().toULongLong();
    }
    const GdbMi gLineNumber = gdbmi["exceptionLine"];
    if (gLineNumber.isValid()) {
        lineNumber = gLineNumber.toInt();
        file = gdbmi["exceptionFile"].data();
    }
    function = gdbmi["exceptionFunction"].data();
}
开发者ID:REZ1DENT3,项目名称:qt-creator,代码行数:20,代码来源:cdbparsehelpers.cpp

示例8: gdbmiChildToInt

// Helper to retrieve an int child from GDBMI
static inline bool gdbmiChildToInt(const GdbMi &parent, const char *childName, int *target)
{
    const GdbMi childBA = parent[childName];
    if (childBA.isValid()) {
        bool ok;
        const int v = childBA.data().toInt(&ok);
        if (ok) {
            *target = v;
            return  true;
        }
    }
    return false;
}
开发者ID:REZ1DENT3,项目名称:qt-creator,代码行数:14,代码来源:cdbparsehelpers.cpp

示例9: parse

void WatchItem::parse(const GdbMi &data)
{
    iname = data["iname"].data();

    GdbMi wname = data["wname"];
    if (wname.isValid()) // Happens (only) for watched expressions.
        name = QString::fromUtf8(QByteArray::fromHex(wname.data()));
    else
        name = QString::fromLatin1(data["name"].data());

    parseHelper(data);

    if (wname.isValid())
        exp = name.toUtf8();
}
开发者ID:acacid,项目名称:qt-creator,代码行数:15,代码来源:watchdata.cpp

示例10: updateThreads

void ThreadsHandler::updateThreads(const GdbMi &data)
{
    // ^done,threads=[{id="1",target-id="Thread 0xb7fdc710 (LWP 4264)",
    // frame={level="0",addr="0x080530bf",func="testQString",args=[],
    // file="/.../app.cpp",fullname="/../app.cpp",line="1175"},
    // state="stopped",core="0"}],current-thread-id="1"

    // Emit changed for previous frame.
    if (m_currentIndex != -1) {
        dataChanged(m_currentIndex);
        m_currentIndex = -1;
    }

    ThreadId currentId;
    const GdbMi current = data["current-thread-id"];
    if (current.isValid())
        currentId = ThreadId(current.data().toLongLong());

    const QList<GdbMi> items = data["threads"].children();
    const int n = items.size();
    for (int index = 0; index != n; ++index) {
        const GdbMi item = items.at(index);
        const GdbMi frame = item["frame"];
        ThreadData thread;
        thread.id = ThreadId(item["id"].toInt());
        thread.targetId = item["target-id"].toLatin1();
        thread.details = item["details"].toLatin1();
        thread.core = item["core"].toLatin1();
        thread.state = item["state"].toLatin1();
        thread.address = frame["addr"].toAddress();
        thread.function = frame["func"].toLatin1();
        thread.fileName = frame["fullname"].toLatin1();
        thread.lineNumber = frame["line"].toInt();
        thread.module = QString::fromLocal8Bit(frame["from"].data());
        thread.stopped = true;
        thread.name = item["name"].toLatin1();
        if (thread.state == QLatin1String("running"))
            thread.stopped = false;
        if (thread.id == currentId)
            m_currentIndex = index;
        updateThread(thread);
    }

    if (m_currentIndex != -1)
        dataChanged(m_currentIndex);

    updateThreadBox();
}
开发者ID:ProDataLab,项目名称:qt-creator,代码行数:48,代码来源:threadshandler.cpp

示例11: showFullBacktrace

void LldbEngine::showFullBacktrace(const GdbMi &data)
{
    Internal::openTextEditor(_("Backtrace $"),
        QString::fromUtf8(QByteArray::fromHex(data.data())));
}
开发者ID:aheubusch,项目名称:qt-creator,代码行数:5,代码来源:lldbengine.cpp

示例12: parseHelper

void WatchItem::parseHelper(const GdbMi &input)
{
    setChildrenUnneeded();

    GdbMi mi = input["type"];
    if (mi.isValid())
        setType(mi.data());

    editvalue = input["editvalue"].data();
    editformat = DebuggerDisplay(input["editformat"].toInt());
    editencoding = DebuggerEncoding(input["editencoding"].data());

    mi = input["valueelided"];
    if (mi.isValid())
        elided = mi.toInt();

    mi = input["bitpos"];
    if (mi.isValid())
        bitpos = mi.toInt();

    mi = input["bitsize"];
    if (mi.isValid())
        bitsize = mi.toInt();

    mi = input["origaddr"];
    if (mi.isValid())
        origaddr = mi.toAddress();

    mi = input["address"];
    if (mi.isValid()) {
        address = mi.toAddress();
        if (exp.isEmpty()) {
            if (iname.startsWith("local.") && iname.count('.') == 1)
                // Solve one common case of adding 'class' in
                // *(class X*)0xdeadbeef for gdb.
                exp = name.toLatin1();
            else
                exp = "*(" + gdbQuoteTypes(type) + "*)" + hexAddress();
        }
    }

    mi = input["value"];
    QByteArray enc = input["valueencoded"].data();
    if (mi.isValid() || !enc.isEmpty()) {
        setValue(decodeData(mi.data(), enc));
    } else {
        setValueNeeded();
    }

    mi = input["size"];
    if (mi.isValid())
        size = mi.toInt();

    mi = input["exp"];
    if (mi.isValid())
        exp = mi.data();

    mi = input["valueenabled"];
    if (mi.data() == "true")
        valueEnabled = true;
    else if (mi.data() == "false")
        valueEnabled = false;

    mi = input["valueeditable"];
    if (mi.data() == "true")
        valueEditable = true;
    else if (mi.data() == "false")
        valueEditable = false;

    mi = input["numchild"]; // GDB/MI
    if (mi.isValid())
        setHasChildren(mi.toInt() > 0);
    mi = input["haschild"]; // native-mixed
    if (mi.isValid())
        setHasChildren(mi.toInt() > 0);

    mi = input["arraydata"];
    if (mi.isValid()) {
        DebuggerEncoding encoding(input["arrayencoding"].data());
        QByteArray childType = input["childtype"].data();
        decodeArrayData(this, mi.data(), encoding, childType);
    } else {
        const GdbMi children = input["children"];
        if (children.isValid()) {
            bool ok = false;
            // Try not to repeat data too often.
            const GdbMi childType = input["childtype"];
            const GdbMi childNumChild = input["childnumchild"];

            qulonglong addressBase = input["addrbase"].data().toULongLong(&ok, 0);
            qulonglong addressStep = input["addrstep"].data().toULongLong(&ok, 0);

            for (int i = 0, n = int(children.children().size()); i != n; ++i) {
                const GdbMi &subinput = children.children().at(i);
                WatchItem *child = new WatchItem;
                if (childType.isValid())
                    child->setType(childType.data());
                if (childNumChild.isValid())
                    child->setHasChildren(childNumChild.toInt() > 0);
                GdbMi name = subinput["name"];
//.........这里部分代码省略.........
开发者ID:acacid,项目名称:qt-creator,代码行数:101,代码来源:watchdata.cpp


注:本文中的GdbMi::data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。