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


C++ LLDBCommand::GetLldbId方法代码示例

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


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

示例1: ExpandVariable

// we need to return list of children for a variable
// we stashed the variables we got so far inside a map
void CodeLiteLLDBApp::ExpandVariable(const LLDBCommand& command)
{
    int variableId = command.GetLldbId();
    if(variableId == wxNOT_FOUND) {
        return;
    }

    LLDBVariable::Vect_t children;
    std::map<int, VariableWrapper>::iterator iter = m_variables.find(variableId);
    if(iter != m_variables.end()) {
        lldb::SBValue* pvalue = &(iter->second.value);
        lldb::SBValue deReferencedValue;
        int size = pvalue->GetNumChildren();

        lldb::TypeClass typeClass = pvalue->GetType().GetTypeClass();
        if(typeClass & lldb::eTypeClassArray) {
            size > (int)m_settings.GetMaxArrayElements() ? size = m_settings.GetMaxArrayElements() : size = size;
            wxPrintf("codelite-lldb: value %s is an array. Limiting its size\n", pvalue->GetName());
        } /*else if ( typeClass & lldb::eTypeClassPointer ) {
            // dereference is needed
            wxPrintf("codelite-lldb: value '%s' is a class pointer, dereferecning it\n", pvalue->GetName());
            deReferencedValue = pvalue->Dereference();

            // and update the number of children
            pvalue = &deReferencedValue;

            wxPrintf("codelite-lldb: new number of children is set to %d\n", size);
            size = pvalue->GetNumChildren();
        }*/

        for(int i = 0; i < size; ++i) {
            lldb::SBValue child = pvalue->GetChildAtIndex(i);
            if(child.IsValid()) {
                LLDBVariable::Ptr_t var(new LLDBVariable(child));
                children.push_back(var);
                VariableWrapper wrapper;
                wrapper.value = child;
                m_variables.insert(std::make_pair(child.GetID(), wrapper));
            }
        }

        LLDBReply reply;
        reply.SetReplyType(kReplyTypeVariableExpanded);
        reply.SetVariables(children);
        reply.SetLldbId(variableId);
        SendReply(reply);
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:50,代码来源:CodeLiteLLDBApp.cpp

示例2: DeleteWatch

void CodeLiteLLDBApp::DeleteWatch(const LLDBCommand& command)
{
    // Remove it from the m_variables table
    int lldbID = command.GetLldbId();
    wxString expression;
    std::map<int, VariableWrapper>::iterator iter = m_variables.find(lldbID);
    if(iter != m_variables.end()) {
        expression = iter->second.expression;
        wxPrintf("codelite-lldb: deleting watch '%s'\n", expression);
        m_variables.erase(iter);
    }

    // remove it from the watch list
    int where = m_watches.Index(expression);
    if(where != wxNOT_FOUND) {
        m_watches.RemoveAt(where);
    }
}
开发者ID:DoctorRover,项目名称:codelite,代码行数:18,代码来源:CodeLiteLLDBApp.cpp


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